From 3443866dab494f034e0e847f09833843540a32b5 Mon Sep 17 00:00:00 2001 From: Crudelis Date: Thu, 21 Sep 2023 16:31:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=84=EC=B2=B4=20List=20=EB=B6=80=EB=B6=84?= =?UTF-8?q?=20=EC=8B=9C=EC=B2=AD=20=EC=9A=94=EA=B5=AC=EC=82=AC=ED=95=AD?= =?UTF-8?q?=EB=8C=80=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Database, DataModel, 등등 수정 --- .../CustomUserControl/ApplicantList.cs | 18 +-- .../ListCertificate.Designer.cs | 1 + .../CustomUserControl/ListCertificate.cs | 46 ++++--- .../ListProceeds.Designer.cs | 119 +++++++++-------- .../CustomUserControl/ListProceeds.cs | 9 +- .../CustomUserControl/UserList.cs | 79 ++++++----- .../DataModel.cs | 2 +- .../Database.cs | 126 +++++++++++++----- .../Extends.cs | 9 +- .../Global.cs | 12 +- ...SUCO_Cargo_Garage_Operation_Program.csproj | 2 + .../PrintCertificate.cs | 30 ++--- .../PrintFilingReceipt.cs | 6 +- 13 files changed, 264 insertions(+), 195 deletions(-) diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs index 5d73afa..05bbc9e 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs @@ -17,7 +17,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl metroComboBox_SearchType.SelectedIndex = 0; } - + void DataChange() { @@ -46,14 +46,14 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl var dataTable = new DataTable(); dataTable.Columns.Add("접수번호"); - dataTable.Columns.Add("성명(법인명)"); - dataTable.Columns.Add("생년월일(법인등록번호)"); + dataTable.Columns.Add("성명\r\n(법인명)"); + dataTable.Columns.Add("생년월일\r\n(법인등록번호)"); dataTable.Columns.Add("연락처"); dataTable.Columns.Add("주소"); - dataTable.Columns.Add("차량번호(화물)"); - dataTable.Columns.Add("차종(화물)"); - dataTable.Columns.Add("차량번호(승용)"); - dataTable.Columns.Add("차종(승용)"); + dataTable.Columns.Add("차량번호\r\n(화물)"); + dataTable.Columns.Add("차종\r\n(화물)"); + dataTable.Columns.Add("차량번호\r\n(승용)"); + dataTable.Columns.Add("차종\r\n(승용)"); dataTable.Columns.Add("차량 타입"); dataTable.Columns.Add("신청일"); @@ -73,11 +73,11 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl applicants[i].VehicleType == 0 ? "대형(4.5톤 미만)" : "특대형(4.5톤 이상)", applicants[i].DateOfApplication - ); + ); } dataGridView_List.DataSource = dataTable; - dataGridView_List.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + dataGridView_List.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView_List.Columns[0].MinimumWidth = 100; dataGridView_List.Columns[0].FillWeight = 100; diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.Designer.cs index 08e6619..dd3cfab 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.Designer.cs @@ -162,6 +162,7 @@ this.Controls.Add(this.dataGridView_List); this.Name = "ListCertificate"; this.Size = new System.Drawing.Size(750, 470); + this.Load += new System.EventHandler(this.ListCertificate_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView_List)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.cs index 468d5f7..09f501d 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.cs @@ -38,33 +38,34 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl private void metroButton_Search_Click(object sender, EventArgs e) { - List certificateDatas = Database.GetLedgerCertificate(metroDateTime_StartDate.Value, metroDateTime_EndDate.Value); + List certificateInformation = Database.GetLedgerCertificate(metroDateTime_StartDate.Value, metroDateTime_EndDate.Value); var dataTable = new DataTable(); dataTable.Columns.Add("발급번호"); dataTable.Columns.Add("발급일자"); - dataTable.Columns.Add("차량번호(화물)"); - dataTable.Columns.Add("차량번호(승용)"); dataTable.Columns.Add("이름"); + dataTable.Columns.Add("생년월일"); + dataTable.Columns.Add("주소ㅋ"); + dataTable.Columns.Add("차량번호\r\n(화물)"); + dataTable.Columns.Add("이용시작일"); + dataTable.Columns.Add("이용종료일"); + dataTable.Columns.Add("이용금액"); - dataTable.Columns.Add("증명일자 시작일"); - dataTable.Columns.Add("발급일자 종료일"); - - - for (int i = 0; i < certificateDatas.Count; i++) + for (int i = 0; i < certificateInformation.Count; i++) { dataTable.Rows .Add( - certificateDatas[i].IssueNumber, - certificateDatas[i].IssueDate, - certificateDatas[i].CargoVehicleNumber, - certificateDatas[i].Name, - - - certificateDatas[i].StartDate, - certificateDatas[i].EndDate + certificateInformation[i].IssueNumber, + certificateInformation[i].IssueDate, + certificateInformation[i].Name, + certificateInformation[i].PersonalNumber, + certificateInformation[i].Address, + certificateInformation[i].CargoVehicleNumber, + certificateInformation[i].StartDate, + certificateInformation[i].EndDate, + certificateInformation[i].Amount ); } @@ -92,12 +93,9 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl } string issueNumber = dataGridView_List.SelectedRows[0].Cells[0].Value.ToString(); - CertificateData certificateData = Database.GetCertificate(issueNumber); - - var print = new PrintCertificate(new List() { certificateData }, Global.GlobalSettings.GarageName); - - + CertificateInformation certificateInformation = Database.GetCertificate(issueNumber); + var print = new PrintCertificate(new List() { certificateInformation }, Global.GlobalSettings.GarageName); var printPreviewDialog = new PrintPreviewDialog(); printPreviewDialog.Icon = Resources.free_icon_trucks_8552082; @@ -106,5 +104,11 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl printPreviewDialog.ShowDialog(); } + + private void ListCertificate_Load(object sender, EventArgs e) + { + metroDateTime_StartDate.Value = metroDateTime_StartDate.Value.AddDays(1 - metroDateTime_StartDate.Value.Day); + metroDateTime_EndDate.Value = metroDateTime_EndDate.Value.AddMonths(1).AddDays(-metroDateTime_EndDate.Value.Day); + } } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.Designer.cs index ccb74eb..9706917 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.Designer.cs @@ -28,15 +28,15 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.metroDateTime_EndDate = new MetroFramework.Controls.MetroDateTime(); + this.metroDateTime_StartDate = new MetroFramework.Controls.MetroDateTime(); + this.metroButton_Search = new MetroFramework.Controls.MetroButton(); + this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); this.dataGridView_List = new System.Windows.Forms.DataGridView(); this.metroButton_ExportExcel = new MetroFramework.Controls.MetroButton(); - this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); - this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); - this.metroButton_Search = new MetroFramework.Controls.MetroButton(); - this.metroDateTime_StartDate = new MetroFramework.Controls.MetroDateTime(); - this.metroDateTime_EndDate = new MetroFramework.Controls.MetroDateTime(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView_List)).BeginInit(); this.SuspendLayout(); @@ -56,6 +56,51 @@ this.groupBox1.TabStop = false; this.groupBox1.Text = "검색"; // + // metroDateTime_EndDate + // + this.metroDateTime_EndDate.Location = new System.Drawing.Point(110, 50); + this.metroDateTime_EndDate.MinimumSize = new System.Drawing.Size(0, 29); + this.metroDateTime_EndDate.Name = "metroDateTime_EndDate"; + this.metroDateTime_EndDate.Size = new System.Drawing.Size(200, 29); + this.metroDateTime_EndDate.TabIndex = 8; + // + // metroDateTime_StartDate + // + this.metroDateTime_StartDate.Location = new System.Drawing.Point(110, 15); + this.metroDateTime_StartDate.MinimumSize = new System.Drawing.Size(0, 29); + this.metroDateTime_StartDate.Name = "metroDateTime_StartDate"; + this.metroDateTime_StartDate.Size = new System.Drawing.Size(200, 29); + this.metroDateTime_StartDate.TabIndex = 7; + // + // metroButton_Search + // + this.metroButton_Search.FontSize = MetroFramework.MetroButtonSize.Tall; + this.metroButton_Search.Location = new System.Drawing.Point(316, 15); + this.metroButton_Search.Name = "metroButton_Search"; + this.metroButton_Search.Size = new System.Drawing.Size(131, 64); + this.metroButton_Search.TabIndex = 6; + this.metroButton_Search.Text = "조회"; + this.metroButton_Search.UseSelectable = true; + this.metroButton_Search.Click += new System.EventHandler(this.metroButton_Search_Click); + // + // metroLabel2 + // + this.metroLabel2.AutoSize = true; + this.metroLabel2.Location = new System.Drawing.Point(20, 50); + this.metroLabel2.Name = "metroLabel2"; + this.metroLabel2.Size = new System.Drawing.Size(83, 19); + this.metroLabel2.TabIndex = 1; + this.metroLabel2.Text = "검색 종료일"; + // + // metroLabel1 + // + this.metroLabel1.AutoSize = true; + this.metroLabel1.Location = new System.Drawing.Point(20, 20); + this.metroLabel1.Name = "metroLabel1"; + this.metroLabel1.Size = new System.Drawing.Size(83, 19); + this.metroLabel1.TabIndex = 0; + this.metroLabel1.Text = "검색 시작일"; + // // dataGridView_List // this.dataGridView_List.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -63,14 +108,14 @@ | System.Windows.Forms.AnchorStyles.Right))); this.dataGridView_List.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; this.dataGridView_List.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView_List.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView_List.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView_List.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView_List.Location = new System.Drawing.Point(20, 120); this.dataGridView_List.Name = "dataGridView_List"; @@ -93,51 +138,6 @@ this.metroButton_ExportExcel.UseSelectable = true; this.metroButton_ExportExcel.Click += new System.EventHandler(this.metroButton_ExportExcel_Click); // - // metroLabel1 - // - this.metroLabel1.AutoSize = true; - this.metroLabel1.Location = new System.Drawing.Point(20, 20); - this.metroLabel1.Name = "metroLabel1"; - this.metroLabel1.Size = new System.Drawing.Size(83, 19); - this.metroLabel1.TabIndex = 0; - this.metroLabel1.Text = "검색 시작일"; - // - // metroLabel2 - // - this.metroLabel2.AutoSize = true; - this.metroLabel2.Location = new System.Drawing.Point(20, 50); - this.metroLabel2.Name = "metroLabel2"; - this.metroLabel2.Size = new System.Drawing.Size(83, 19); - this.metroLabel2.TabIndex = 1; - this.metroLabel2.Text = "검색 종료일"; - // - // metroButton_Search - // - this.metroButton_Search.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_Search.Location = new System.Drawing.Point(316, 15); - this.metroButton_Search.Name = "metroButton_Search"; - this.metroButton_Search.Size = new System.Drawing.Size(131, 64); - this.metroButton_Search.TabIndex = 6; - this.metroButton_Search.Text = "조회"; - this.metroButton_Search.UseSelectable = true; - this.metroButton_Search.Click += new System.EventHandler(this.metroButton_Search_Click); - // - // metroDateTime_StartDate - // - this.metroDateTime_StartDate.Location = new System.Drawing.Point(110, 15); - this.metroDateTime_StartDate.MinimumSize = new System.Drawing.Size(0, 29); - this.metroDateTime_StartDate.Name = "metroDateTime_StartDate"; - this.metroDateTime_StartDate.Size = new System.Drawing.Size(200, 29); - this.metroDateTime_StartDate.TabIndex = 7; - // - // metroDateTime_EndDate - // - this.metroDateTime_EndDate.Location = new System.Drawing.Point(110, 50); - this.metroDateTime_EndDate.MinimumSize = new System.Drawing.Size(0, 29); - this.metroDateTime_EndDate.Name = "metroDateTime_EndDate"; - this.metroDateTime_EndDate.Size = new System.Drawing.Size(200, 29); - this.metroDateTime_EndDate.TabIndex = 8; - // // ListProceeds // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -148,6 +148,7 @@ this.Controls.Add(this.groupBox1); this.Name = "ListProceeds"; this.Size = new System.Drawing.Size(750, 470); + this.Load += new System.EventHandler(this.ListProceeds_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView_List)).EndInit(); diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.cs index cdb393f..ad7cd1d 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.cs @@ -32,8 +32,8 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl var dataTable = new DataTable(); - dataTable.Columns.Add("차량번호(화물)"); - dataTable.Columns.Add("차량번호(승용)"); + dataTable.Columns.Add("차량번호\r\n(화물)"); + dataTable.Columns.Add("차량번호\r\n(승용)"); dataTable.Columns.Add("이름"); dataTable.Columns.Add("수익금 종류"); dataTable.Columns.Add("금액"); @@ -88,5 +88,10 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl dataGridView_List.Columns[2].FillWeight = 60; } + private void ListProceeds_Load(object sender, EventArgs e) + { + metroDateTime_StartDate.Value = metroDateTime_StartDate.Value.AddDays(1 - metroDateTime_StartDate.Value.Day); + metroDateTime_EndDate.Value = metroDateTime_EndDate.Value.AddMonths(1).AddDays(-metroDateTime_EndDate.Value.Day); + } } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs index 64555ab..bb0589c 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs @@ -3,7 +3,6 @@ using MetroFramework; using System; using System.Collections.Generic; using System.Data; -using System.Drawing.Printing; using System.Linq; using System.Text; using System.Windows.Forms; @@ -73,9 +72,9 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl dataTable.Columns.Add("연락처"); dataTable.Columns.Add("주소"); dataTable.Columns.Add("주차구역"); - dataTable.Columns.Add("차량번호(화물)"); + dataTable.Columns.Add("차량번호\r\n(화물)"); dataTable.Columns.Add("차종(화물)"); - dataTable.Columns.Add("차량번호(승용)"); + dataTable.Columns.Add("차량번호\r\n(승용)"); dataTable.Columns.Add("차종(승용)"); dataTable.Columns.Add("이용시작일"); dataTable.Columns.Add("이용종료일"); @@ -121,7 +120,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl dataGridView_List.Columns[2].FillWeight = 60; dataGridView_List.Columns[15].DefaultCellStyle.WrapMode = DataGridViewTriState.True; - + } private void metroButton_Search_Click(object sender, EventArgs e) @@ -197,24 +196,22 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl MessageBoxIcon.Question); if (result == DialogResult.No) return; - // 사용자 정보 가져와야함 - int code = int.Parse(dataGridView_List.SelectedRows[0].Cells[0].Value.ToString()); - CertificateInformation certificateInformation = new CertificateInformation(); - + CertificateInformation certificateInformation = new CertificateInformation(); //DB 에서 다시 가져오는 선택? + certificateInformation.Name = dataGridView_List.SelectedRows[0].Cells[4].Value.ToString(); certificateInformation.PersonalNumber = dataGridView_List.SelectedRows[0].Cells[5].Value.ToString(); certificateInformation.Address = dataGridView_List.SelectedRows[0].Cells[7].Value.ToString(); certificateInformation.CargoVehicleNumber = dataGridView_List.SelectedRows[0].Cells[10].Value.ToString(); - //certificateInformation.Amount = dataGridView_List.SelectedRows[0].Cells[7].Value.ToString(); + certificateInformation.Amount = Database.GetAmountByCertificate(dataGridView_List.SelectedRows[0].Cells[0].Value.ToString()); certificateInformation.Area = dataGridView_List.SelectedRows[0].Cells[8].Value.ToString(); - + certificateInformation.StartDate = - DateTime.Parse(dataGridView_List.SelectedRows[0].Cells[14].Value.ToString()); - certificateInformation.EndDate = DateTime.Parse(dataGridView_List.SelectedRows[0].Cells[15].Value.ToString()); + DateTime.Parse(dataGridView_List.SelectedRows[0].Cells[13].Value.ToString()); + certificateInformation.EndDate = DateTime.Parse(dataGridView_List.SelectedRows[0].Cells[14].Value.ToString()); certificateInformation.IssueDate = nowDateTime; - - + + int lastNo = Database.GetLastCertificate(nowDateTime.Year); lastNo++; certificateInformation.IssueNumber = nowDateTime.Year.ToString() + "-" + lastNo.ToString(); @@ -226,33 +223,45 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl setCertificateInformation.IssueDate = certificateInformation.IssueDate; setCertificateInformation.StartDate = certificateInformation.StartDate; setCertificateInformation.EndDate = certificateInformation.EndDate; - //bool dbResult = Database.SetCertificate(setCertificateInformation); + setCertificateInformation.Amount = certificateInformation.Amount; - // 요금 상계 - //SetProceedsInfo setProceedsInfo = new SetProceedsInfo(); - //setProceedsInfo.No = certificate.No; - //setProceedsInfo.Date = nowDateTime; - //setProceedsInfo.Type = ProceedsType.Certificate; - // 요금 상계 부분 - // setProceedsInfo.Amount = Global.GlobalSettings.CertificateFee; - //dbResult = Database.SetProceeds(setProceedsInfo); + // 증명서 발급 요금 계산 + SetProceedsInfo setProceedsInfo = new SetProceedsInfo(); + setProceedsInfo.No = setCertificateInformation.UserNo; + setProceedsInfo.Date = nowDateTime; + setProceedsInfo.Type = ProceedsType.Certificate; + + EVehicleType eVehicleType = Database.GetVehicleType(setCertificateInformation.UserNo); + switch (eVehicleType) + { + case EVehicleType.Large: + setProceedsInfo.Amount = Global.GlobalSettings.CargoLargeCertificateFee; + break; + case EVehicleType.Oversized: + setProceedsInfo.Amount = Global.GlobalSettings.CargoOversizedFee; + break; + } + string amount = string.Format("{0:N0} 원", setProceedsInfo.Amount); + var dialogResult = MetroMessageBox.Show(this, $"증명서 발급요금이 {amount} 발생했습니다. 발급하시겠습니까?", "Question", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); + if (dialogResult == DialogResult.OK) + { + Database.SetCertificate(setCertificateInformation); + Database.SetProceeds(setProceedsInfo); + + var print = new PrintCertificate(new List() { certificateInformation }, Global.GlobalSettings.GarageName); + + var printPreviewDialog = new PrintPreviewDialog(); + printPreviewDialog.Icon = Resources.free_icon_trucks_8552082; + printPreviewDialog.WindowState = FormWindowState.Maximized; + printPreviewDialog.Document = print.printDocument; + printPreviewDialog.ShowDialog(); + + } - - var print = new PrintCertificate(new List() { certificateInformation }, Global.GlobalSettings.GarageName); - var printDocument = new PrintDocument(); - printDocument.DocumentName = "차고지 이용 증명서"; - - printDocument.PrintPage += print.PrintPage; - - var printPreviewDialog = new PrintPreviewDialog(); - printPreviewDialog.Icon = Resources.free_icon_trucks_8552082; - printPreviewDialog.WindowState = FormWindowState.Maximized; - printPreviewDialog.Document = printDocument; - printPreviewDialog.ShowDialog(); } } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs b/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs index 81d6f34..f3f4056 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs @@ -99,7 +99,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program public string PersonalNumber { get; set; } public string Address { get; set; } public string CargoVehicleNumber { get; set; } - public string Amount { get; set; } + public int Amount { get; set; } public string Area { get; set; } public string IssueNumber { get; set; } public DateTime IssueDate { get; set; } diff --git a/HSUCO_Cargo_Garage_Operation_Program/Database.cs b/HSUCO_Cargo_Garage_Operation_Program/Database.cs index 4e8c926..1635045 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Database.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Database.cs @@ -1,10 +1,8 @@ -using HSUCO_Cargo_Garage_Operation_Program.CustomUserControl; -using System; +using System; using System.Collections.Generic; using System.Data.SQLite; using System.Globalization; using System.IO; -using System.Windows.Forms; namespace HSUCO_Cargo_Garage_Operation_Program { @@ -187,11 +185,23 @@ namespace HSUCO_Cargo_Garage_Operation_Program public static ResultApplicantInsertInformation SetApplicant(ApplicantInformation applicant) { - string year = DateTime.Now.Year.ToString(); - string suffix = applicant.ApplicantType ? Global.SuffixApplicantLot : Global.SuffixApplicantWait; - int lastNo = GetLastApplicant(year, suffix); + int year = DateTime.Now.Year; + string suffix; + EGetLastNumber eGetLastNumber; + if (applicant.ApplicantType) + { + suffix = Global.SuffixApplicantLot; + eGetLastNumber = EGetLastNumber.ApplicantListLots; + } + else + { + suffix = Global.SuffixApplicantWait; + eGetLastNumber = EGetLastNumber.ApplicantListWait; + } + + int lastNo = GetLastNo(eGetLastNumber, year); lastNo++; - string no = $"{year}-{suffix}{lastNo.ToString("D4")}"; + string no = $"{year}-{suffix}{lastNo}"; int waitOrder = 0; string query; if (!applicant.ApplicantType) @@ -213,7 +223,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program } } query = - $"INSERT INTO ApplicantList VALUES('{applicant.ApplicantType.BoolToInt()}','{no}','{applicant.CargoVehicleNumber}','{applicant.CargoVehicleName}','{applicant.PassengerVehicleNumber}','{applicant.PassengerVehicleName}','{applicant.VehicleType}','{applicant.Name}','{applicant.PersonalNumber}','{applicant.Phone}','{applicant.Address}','{applicant.DateOfApplication.DateTimeDatabase()}') "; + $"INSERT INTO ApplicantList VALUES('{applicant.ApplicantType.BoolToInt()}','{no}','{applicant.CargoVehicleNumber}','{applicant.CargoVehicleName}','{applicant.PassengerVehicleNumber}','{applicant.PassengerVehicleName}','{(int)applicant.VehicleType}','{applicant.Name}','{applicant.PersonalNumber}','{applicant.Phone}','{applicant.Address}','{applicant.DateOfApplication.DateTimeDatabase()}') "; int insertResult; using (var command = _sqLiteConnection.CreateCommand()) @@ -478,7 +488,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program var proceedsDatas = new List(); var query = - $"SELECT UserList.CargoVehicleNumber, UserList.PassengerVehicleNumber, UserList.Name, LedgerProceeds.Type, LedgerProceeds.Amount, LedgerProceeds.Date From LedgerProceeds INNER JOIN UserList ON LedgerProceeds.No = UserList.No Where LedgerProceeds.Date >='{startDateTime.StartDateTime()}' And LedgerProceeds.Date <='{endDateTime.EndDateTime()}'"; + $"SELECT U.CargoVehicleNumber, U.PassengerVehicleNumber, U.Name, P.Type, P.Amount, P.Date From LedgerProceeds P INNER JOIN UserList U ON P.UserNo = U.No Where P.Date >='{startDateTime.StartDateTime()}' And P.Date <='{endDateTime.EndDateTime()}'"; using (var command = _sqLiteConnection.CreateCommand()) { @@ -503,6 +513,24 @@ namespace HSUCO_Cargo_Garage_Operation_Program return proceedsDatas; } + public static int GetAmountByCertificate(string userNo) + { + int amount = 0; + var query = $"SELECT SUM(Amount) as Amount From LedgerProceeds Where Type >= 0 And Type <= 1 And UserNo='{userNo}'"; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + amount = int.Parse(reader["Amount"].ToString()); + } + } + } + return amount; + } + /// /// 증명서 발급 대장 조회용 /// @@ -511,9 +539,9 @@ namespace HSUCO_Cargo_Garage_Operation_Program /// public static List GetLedgerCertificate(DateTime startDateTime, DateTime endDateTime) { - var certificateDatas = new List(); + List certificateInformations = new List(); var query = - $"SELECT UserList.Name, UserList.PersonalNumber, UserList.Address, UserList.CargoVehicleNumber, LedgerCertificate.IssueNumber, LedgerCertificate.IssueDate, LedgerCertificate.StartDate, LedgerCertificate.EndDate From LedgerCertificate INNER JOIN UserList ON LedgerCertificate.No = UserList.No Where LedgerCertificate.IssueDate >='{startDateTime.StartDateTime()}' And LedgerCertificate.IssueDate <='{endDateTime.EndDateTime()}'"; + $"SELECT U.Name, U.PersonalNumber, U.Address, U.CargoVehicleNumber, C.No, C.IssueDate, C.StartDate, C.EndDate, C.Amount From LedgerCertificate C INNER JOIN UserList U ON C.UserNo = U.No Where C.IssueDate >='{startDateTime.StartDateTime()}' And C.IssueDate <='{endDateTime.EndDateTime()}'"; using (var command = _sqLiteConnection.CreateCommand()) { @@ -523,23 +551,25 @@ namespace HSUCO_Cargo_Garage_Operation_Program { while (reader.Read()) { - var certificateData = new CertificateInformation(); - certificateData.Name = reader["Name"].ToString(); - certificateData.PersonalNumber = reader["PersonalNumber"].ToString(); - certificateData.Address = reader["Address"].ToString(); - certificateData.CargoVehicleNumber = reader["CargoVehicleNumber"].ToString(); + CertificateInformation certificateInformation = new CertificateInformation(); - certificateData.IssueNumber = reader["IssueNumber"].ToString(); - certificateData.IssueDate = DateTime.Parse(reader["IssueDate"].ToString()); - certificateData.StartDate = DateTime.Parse(reader["StartDate"].ToString()); - certificateData.EndDate = DateTime.Parse(reader["EndDate"].ToString()); - certificateDatas.Add(certificateData); + certificateInformation.Name = reader["Name"].ToString(); + certificateInformation.PersonalNumber = reader["PersonalNumber"].ToString(); + certificateInformation.Address = reader["Address"].ToString(); + certificateInformation.CargoVehicleNumber = reader["CargoVehicleNumber"].ToString(); + certificateInformation.IssueNumber = reader["No"].ToString(); + certificateInformation.Amount = int.Parse(reader["Amount"].ToString()); + certificateInformation.IssueDate = DateTime.Parse(reader["IssueDate"].ToString()); + certificateInformation.StartDate = DateTime.Parse(reader["StartDate"].ToString()); + certificateInformation.EndDate = DateTime.Parse(reader["EndDate"].ToString()); + certificateInformations.Add(certificateInformation); } } } - return certificateDatas; + return certificateInformations; } + /// /// 발급 번호로 발급데이터 조회 /// @@ -547,20 +577,23 @@ namespace HSUCO_Cargo_Garage_Operation_Program /// public static CertificateInformation GetCertificate(string issueNumber) { - CertificateInformation certificateInformation = new CertificateInformation(); - var query = $"SELECT UserList.CargoVehicleNumber, UserList.PassengerVehicleNumber, UserList.Name, LedgerCertificate.IssueNumber, LedgerCertificate.IssueDate, LedgerCertificate.StartDate, LedgerCertificate.EndDate From LedgerCertificate INNER JOIN UserList ON LedgerCertificate.No = UserList.No Where IssueNumber='{issueNumber}'"; + CertificateInformation certificateInformation = new CertificateInformation(); + var query = $"SELECT U.Name, U.PersonalNumber, U.Address, U.CargoVehicleNumber, C.Amount, U.Area, C.IssueDate, C.StartDate, C.EndDate From LedgerCertificate C INNER JOIN UserList U ON (C.UserNo = U.No) Where C.No='{issueNumber}'"; using (var command = _sqLiteConnection.CreateCommand()) { command.CommandText = query; using (var reader = command.ExecuteReader()) - { + { // 이거면 안됨 while (reader.Read()) { - certificateInformation.CargoVehicleNumber = reader["CargoVehicleNumber"].ToString(); - //certificateData.PassengerVehicleNumber = reader["PassengerVehicleNumber"].ToString(); + certificateInformation.IssueNumber = issueNumber; certificateInformation.Name = reader["Name"].ToString(); - certificateInformation.IssueNumber = reader["IssueNumber"].ToString(); + certificateInformation.PersonalNumber = reader["PersonalNumber"].ToString(); + certificateInformation.Address = reader["Address"].ToString(); + certificateInformation.CargoVehicleNumber = reader["CargoVehicleNumber"].ToString(); + certificateInformation.Amount = int.Parse(reader["Amount"].ToString()); + certificateInformation.Area = reader["Area"].ToString(); certificateInformation.IssueDate = DateTime.Parse(reader["IssueDate"].ToString()); certificateInformation.StartDate = DateTime.Parse(reader["StartDate"].ToString()); certificateInformation.EndDate = DateTime.Parse(reader["EndDate"].ToString()); @@ -575,10 +608,12 @@ namespace HSUCO_Cargo_Garage_Operation_Program { return GetLastNo(EGetLastNumber.ApplicantListLots, year); } + public static int GetLastApplicantWait(int year) { return GetLastNo(EGetLastNumber.ApplicantListWait, year); } + public static int GetLastCertificate(int year) { return GetLastNo(EGetLastNumber.LedgerCertificate, year); @@ -588,7 +623,8 @@ namespace HSUCO_Cargo_Garage_Operation_Program { return GetLastNo(EGetLastNumber.UserList, year); } - public static int GetLastNo(EGetLastNumber eGetLastNumber, int year) + + private static int GetLastNo(EGetLastNumber eGetLastNumber, int year) { string tableName = string.Empty; string suffix = string.Empty; @@ -598,21 +634,23 @@ namespace HSUCO_Cargo_Garage_Operation_Program tableName = "ApplicantList"; suffix = "L"; break; + case EGetLastNumber.ApplicantListWait: tableName = "ApplicantList"; suffix = "W"; break; + case EGetLastNumber.UserList: tableName = "UserList"; suffix = "U"; break; + case EGetLastNumber.LedgerCertificate: tableName = "LedgerCertificate"; suffix = "C"; break; - } - var query = $"SELECT No FROM {tableName} Where IssueNumber Like '{year}-{suffix}%' Order By No DESC LIMIT 1"; + var query = $"SELECT No FROM {tableName} Where No Like '{year}-{suffix}%' Order By No DESC LIMIT 1"; var lastNo = 0; using (var command = _sqLiteConnection.CreateCommand()) { @@ -622,7 +660,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program { while (reader.Read()) { - var issueNumber = reader["IssueNumber"].ToString(); + var issueNumber = reader["No"].ToString(); issueNumber = issueNumber.Substring(6, issueNumber.Length - 6); lastNo = int.Parse(issueNumber); } @@ -630,10 +668,11 @@ namespace HSUCO_Cargo_Garage_Operation_Program } return lastNo; } - public static bool SetCertificate(Certificate certificate) + + public static bool SetCertificate(SetCertificateInformation setCertificateInformation) { var query = - $"INSERT INTO LedgerCertificate VALUES('{certificate.No}','{certificate.IssueNumber}','{certificate.IssueDate.DateTimeDatabase()}','{certificate.StartDate.StartDateTime()}','{certificate.EndDate.EndDateTime()}') "; + $"INSERT INTO LedgerCertificate VALUES('{setCertificateInformation.No}','{setCertificateInformation.UserNo}','{setCertificateInformation.IssueDate.DateTimeDatabase()}','{setCertificateInformation.StartDate.StartDateTime()}','{setCertificateInformation.EndDate.EndDateTime()}',{setCertificateInformation.Amount}) "; using (var insertCommand = _sqLiteConnection.CreateCommand()) { @@ -654,6 +693,25 @@ namespace HSUCO_Cargo_Garage_Operation_Program } } + public static EVehicleType GetVehicleType(string no) + { + var query = $"SELECT VehicleType From UserList Where No='{no}'"; + int type = 0; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; + + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + type = int.Parse(reader["VehicleType"].ToString()); + } + } + } + return (EVehicleType)type; + } + public static Settings LoadSettings() { var settings = new Settings(); diff --git a/HSUCO_Cargo_Garage_Operation_Program/Extends.cs b/HSUCO_Cargo_Garage_Operation_Program/Extends.cs index 18a954e..484eb56 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Extends.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Extends.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading.Tasks; namespace HSUCO_Cargo_Garage_Operation_Program { @@ -20,8 +15,8 @@ namespace HSUCO_Cargo_Garage_Operation_Program public static string StartDateTime(this DateTime date) { return $"{date.Year:D4}-{date.Month:D2}-{date.Day:D2} 00:00:00"; - - + + } public static string EndDateTime(this DateTime date) diff --git a/HSUCO_Cargo_Garage_Operation_Program/Global.cs b/HSUCO_Cargo_Garage_Operation_Program/Global.cs index 6eca99f..7bbb8b1 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Global.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Global.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HSUCO_Cargo_Garage_Operation_Program +namespace HSUCO_Cargo_Garage_Operation_Program { public static class Global { @@ -12,8 +6,8 @@ namespace HSUCO_Cargo_Garage_Operation_Program public static readonly string AreaLarge = "13m × 3.25m"; public static readonly string AreaOversized = "17m × 3.5m"; - public static readonly string SuffixApplicantLot = "FL"; - public static readonly string SuffixApplicantWait = "FW"; + public static readonly string SuffixApplicantLot = "L"; + public static readonly string SuffixApplicantWait = "W"; public static readonly string SuffixCertificate = "C"; } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/HSUCO_Cargo_Garage_Operation_Program.csproj b/HSUCO_Cargo_Garage_Operation_Program/HSUCO_Cargo_Garage_Operation_Program.csproj index 4ba72d0..90ebaaa 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/HSUCO_Cargo_Garage_Operation_Program.csproj +++ b/HSUCO_Cargo_Garage_Operation_Program/HSUCO_Cargo_Garage_Operation_Program.csproj @@ -172,6 +172,7 @@ ApplicantControl.cs + Designer ListCertificate.cs @@ -190,6 +191,7 @@ ApplicantList.cs + Designer Master.cs diff --git a/HSUCO_Cargo_Garage_Operation_Program/PrintCertificate.cs b/HSUCO_Cargo_Garage_Operation_Program/PrintCertificate.cs index 4ec8d81..e8bfbcb 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/PrintCertificate.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/PrintCertificate.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Drawing; using System.Drawing.Printing; -using System.Web; using Font = System.Drawing.Font; namespace HSUCO_Cargo_Garage_Operation_Program @@ -13,15 +12,16 @@ namespace HSUCO_Cargo_Garage_Operation_Program private readonly string _garageName; private int _count; public PrintDocument printDocument; - public PrintCertificate(List certificateDatas, string garageName ) + public PrintCertificate(List certificateDatas, string garageName) { - _certificateDatas = certificateDatas; - _garageName = garageName; + _certificateInformation = certificateDatas; + _garageName = garageName; _count = 0; printDocument = new PrintDocument(); printDocument.DocumentName = "차고지 이용 증명서"; printDocument.PrintPage += PrintPage; - printDocument.DefaultPageSettings.Margins.Top = Convert.ToInt32(50); printDocument.DefaultPageSettings.Margins.Left = Convert.ToInt32(50); + printDocument.DefaultPageSettings.Margins.Top = Convert.ToInt32(50); + printDocument.DefaultPageSettings.Margins.Bottom = Convert.ToInt32(50); printDocument.DefaultPageSettings.Margins.Left = Convert.ToInt32(30); printDocument.DefaultPageSettings.Margins.Right = Convert.ToInt32(30); @@ -32,24 +32,24 @@ namespace HSUCO_Cargo_Garage_Operation_Program e.MarginBounds.Width, e.MarginBounds.Height); int totalWidth = (int)e.PageBounds.Width; int totalHeight = (int)e.PageBounds.Height; - + e.Graphics.DrawString($"발급번호 : {_certificateInformation[_count].IssueNumber}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 10, e.MarginBounds.Top + 10); CenterTextWriter($"화물자동차 공영차고지 이용 증명서", new Font("맑은 고딕", 30, FontStyle.Bold), e.Graphics, totalWidth, e.MarginBounds.Top + 100); - e.Graphics.DrawString($"■ 성  명 : {_certificateDatas[_count].Name}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 250); - e.Graphics.DrawString($"■ 생년월일 : {_certificateDatas[_count].PersonalNumber}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 300); - e.Graphics.DrawString($"■ 주  소 : {_certificateDatas[_count].Address}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 350); - e.Graphics.DrawString($"■ 차량번호 : {_certificateDatas[_count].CargoVehicleNumber}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 400); - e.Graphics.DrawString($"■ 이용요금 : {_certificateDatas[_count].Amount}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 450); - e.Graphics.DrawString($"■ 이용면적 : {_certificateDatas[_count].AreaSize}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 500); - e.Graphics.DrawString($"■ 이용기한 : {_certificateDatas[_count].StartDate.ToString("yyyy-MM-dd")} ~ {_certificateDatas[_count].EndDate.ToString("yyyy-MM-dd")}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 550); + e.Graphics.DrawString($"■ 성  명 : {_certificateInformation[_count].Name}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 250); + e.Graphics.DrawString($"■ 생년월일 : {_certificateInformation[_count].PersonalNumber}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 300); + e.Graphics.DrawString($"■ 주  소 : {_certificateInformation[_count].Address}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 350); + e.Graphics.DrawString($"■ 차량번호 : {_certificateInformation[_count].CargoVehicleNumber}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 400); + e.Graphics.DrawString($"■ 이용요금 : {string.Format("{0:N0} 원", _certificateInformation[_count].Amount)}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 450); + e.Graphics.DrawString($"■ 이용면적 : {_certificateInformation[_count].Area}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 500); + e.Graphics.DrawString($"■ 이용기한 : {_certificateInformation[_count].StartDate.ToString("yyyy-MM-dd")} ~ {_certificateInformation[_count].EndDate.ToString("yyyy-MM-dd")}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 550); e.Graphics.DrawString($"■ 차 고 지 : {_garageName}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 600); CenterTextWriter($"위 차량에 대하여 {_garageName} 화물자동차 공영차고지 이용을 증명합니다.", new Font("맑은 고딕", 12, FontStyle.Bold), e.Graphics, totalWidth, e.MarginBounds.Top + 700); - CenterTextWriter($"{_certificateDatas[_count].IssueDate.ToString("yyyy년 MM월 dd일")}", new Font("맑은 고딕", 15), e.Graphics, totalWidth, e.MarginBounds.Top + 800); + CenterTextWriter($"{_certificateInformation[_count].IssueDate.ToString("yyyy년 MM월 dd일")}", new Font("맑은 고딕", 15), e.Graphics, totalWidth, e.MarginBounds.Top + 800); CenterTextWriter("화성도시공사 사장", new Font("맑은 고딕", 20, FontStyle.Bold), e.Graphics, totalWidth, e.MarginBounds.Top + 900); _count++; - e.HasMorePages = _certificateDatas.Count > _count; + e.HasMorePages = _certificateInformation.Count > _count; } private void CenterTextWriter(string text, Font font, Graphics g, int totalWidth, int posY) diff --git a/HSUCO_Cargo_Garage_Operation_Program/PrintFilingReceipt.cs b/HSUCO_Cargo_Garage_Operation_Program/PrintFilingReceipt.cs index bb05614..d5e25fe 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/PrintFilingReceipt.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/PrintFilingReceipt.cs @@ -37,7 +37,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program e.Graphics.DrawLine(new Pen(Brushes.Black, 1), new Point(e.MarginBounds.Left, e.MarginBounds.Top + 490), new Point(e.MarginBounds.Right, e.MarginBounds.Top + 490)); e.Graphics.DrawLine(new Pen(Brushes.Black, 1), new Point(e.MarginBounds.Left, e.MarginBounds.Top + 540), new Point(e.MarginBounds.Right, e.MarginBounds.Top + 540)); - e.Graphics.DrawLine(new Pen(Brushes.Black, 1), new Point(e.MarginBounds.Left+280, e.MarginBounds.Top + 290), new Point(e.MarginBounds.Left + 280, e.MarginBounds.Top + 540)); + e.Graphics.DrawLine(new Pen(Brushes.Black, 1), new Point(e.MarginBounds.Left + 280, e.MarginBounds.Top + 290), new Point(e.MarginBounds.Left + 280, e.MarginBounds.Top + 540)); e.Graphics.DrawLine(new Pen(Brushes.Black, 1), new Point(e.MarginBounds.Left + 520, e.MarginBounds.Top + 440), new Point(e.MarginBounds.Left + 520, e.MarginBounds.Top + 490)); @@ -45,11 +45,11 @@ namespace HSUCO_Cargo_Garage_Operation_Program int totalHeight = (int)e.PageBounds.Height; CenterTextWriter($"접 수 증", new Font("맑은 고딕", 30, FontStyle.Bold), e.Graphics, totalWidth, e.MarginBounds.Top + 100); - + e.Graphics.DrawString($"제 {_printFilingReceiptInformation[_count].No}호", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 100, e.MarginBounds.Top + 250); e.Graphics.DrawString($"접수일 : {_printFilingReceiptInformation[_count].DateReception.ToString("yyyy-MM-dd")}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 500, e.MarginBounds.Top + 250); - + e.Graphics.DrawString($"① 신청인", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 300); e.Graphics.DrawString($"{_printFilingReceiptInformation[_count].Name}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 300, e.MarginBounds.Top + 300); e.Graphics.DrawString($"② 생년월일(법인등록번호)", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 350);