diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.Designer.cs index 15b7dac..68044c3 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.Designer.cs @@ -34,6 +34,9 @@ this.metroButton_Cancel = new MetroFramework.Controls.MetroButton(); this.metroDateTime_Start = new MetroFramework.Controls.MetroDateTime(); this.metroDateTime_End = new MetroFramework.Controls.MetroDateTime(); + this.metroLabel3 = new MetroFramework.Controls.MetroLabel(); + this.metroTextBox_Cost = new MetroFramework.Controls.MetroTextBox(); + this.metroLabel4 = new MetroFramework.Controls.MetroLabel(); this.SuspendLayout(); // // metroLabel1 @@ -57,7 +60,7 @@ // metroButton_Promotion // this.metroButton_Promotion.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_Promotion.Location = new System.Drawing.Point(131, 188); + this.metroButton_Promotion.Location = new System.Drawing.Point(131, 203); this.metroButton_Promotion.Name = "metroButton_Promotion"; this.metroButton_Promotion.Size = new System.Drawing.Size(100, 50); this.metroButton_Promotion.TabIndex = 3; @@ -68,7 +71,7 @@ // metroButton_Cancel // this.metroButton_Cancel.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_Cancel.Location = new System.Drawing.Point(237, 188); + this.metroButton_Cancel.Location = new System.Drawing.Point(237, 203); this.metroButton_Cancel.Name = "metroButton_Cancel"; this.metroButton_Cancel.Size = new System.Drawing.Size(100, 50); this.metroButton_Cancel.TabIndex = 4; @@ -83,6 +86,7 @@ this.metroDateTime_Start.Name = "metroDateTime_Start"; this.metroDateTime_Start.Size = new System.Drawing.Size(200, 29); this.metroDateTime_Start.TabIndex = 5; + this.metroDateTime_Start.ValueChanged += new System.EventHandler(this.metroDateTime_Start_ValueChanged); // // metroDateTime_End // @@ -91,6 +95,58 @@ this.metroDateTime_End.Name = "metroDateTime_End"; this.metroDateTime_End.Size = new System.Drawing.Size(200, 29); this.metroDateTime_End.TabIndex = 6; + this.metroDateTime_End.ValueChanged += new System.EventHandler(this.metroDateTime_Start_ValueChanged); + // + // metroLabel3 + // + this.metroLabel3.AutoSize = true; + this.metroLabel3.Location = new System.Drawing.Point(30, 174); + this.metroLabel3.Name = "metroLabel3"; + this.metroLabel3.Size = new System.Drawing.Size(87, 19); + this.metroLabel3.TabIndex = 7; + this.metroLabel3.Text = "총 이용 금액"; + // + // metroTextBox_Cost + // + // + // + // + this.metroTextBox_Cost.CustomButton.Image = null; + this.metroTextBox_Cost.CustomButton.Location = new System.Drawing.Point(158, 1); + this.metroTextBox_Cost.CustomButton.Name = ""; + this.metroTextBox_Cost.CustomButton.Size = new System.Drawing.Size(21, 21); + this.metroTextBox_Cost.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.metroTextBox_Cost.CustomButton.TabIndex = 1; + this.metroTextBox_Cost.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.metroTextBox_Cost.CustomButton.UseSelectable = true; + this.metroTextBox_Cost.CustomButton.Visible = false; + this.metroTextBox_Cost.Lines = new string[] { + "0"}; + this.metroTextBox_Cost.Location = new System.Drawing.Point(131, 170); + this.metroTextBox_Cost.MaxLength = 32767; + this.metroTextBox_Cost.Name = "metroTextBox_Cost"; + this.metroTextBox_Cost.PasswordChar = '\0'; + this.metroTextBox_Cost.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.metroTextBox_Cost.SelectedText = ""; + this.metroTextBox_Cost.SelectionLength = 0; + this.metroTextBox_Cost.SelectionStart = 0; + this.metroTextBox_Cost.ShortcutsEnabled = true; + this.metroTextBox_Cost.Size = new System.Drawing.Size(180, 23); + this.metroTextBox_Cost.TabIndex = 8; + this.metroTextBox_Cost.Text = "0"; + this.metroTextBox_Cost.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.metroTextBox_Cost.UseSelectable = true; + this.metroTextBox_Cost.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.metroTextBox_Cost.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // metroLabel4 + // + this.metroLabel4.AutoSize = true; + this.metroLabel4.Location = new System.Drawing.Point(311, 174); + this.metroLabel4.Name = "metroLabel4"; + this.metroLabel4.Size = new System.Drawing.Size(23, 19); + this.metroLabel4.TabIndex = 9; + this.metroLabel4.Text = "원"; // // Promotion // @@ -98,6 +154,9 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BorderStyle = MetroFramework.Forms.MetroFormBorderStyle.FixedSingle; this.ClientSize = new System.Drawing.Size(376, 294); + this.Controls.Add(this.metroLabel4); + this.Controls.Add(this.metroTextBox_Cost); + this.Controls.Add(this.metroLabel3); this.Controls.Add(this.metroDateTime_End); this.Controls.Add(this.metroDateTime_Start); this.Controls.Add(this.metroButton_Cancel); @@ -120,5 +179,8 @@ private MetroFramework.Controls.MetroButton metroButton_Cancel; private MetroFramework.Controls.MetroDateTime metroDateTime_Start; private MetroFramework.Controls.MetroDateTime metroDateTime_End; + private MetroFramework.Controls.MetroLabel metroLabel3; + private MetroFramework.Controls.MetroTextBox metroTextBox_Cost; + private MetroFramework.Controls.MetroLabel metroLabel4; } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs index 3b7c327..2716c64 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs @@ -1,5 +1,6 @@ using MetroFramework.Forms; using System; +using System.Diagnostics; using System.Windows.Forms; namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm @@ -8,12 +9,15 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm { public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } + public int TotalCost { get; set; } public Promotion() => InitializeComponent(); void metroButton_Promotion_Click(object sender, EventArgs e) { StartDate = metroDateTime_Start.Value; EndDate = metroDateTime_End.Value; + int.TryParse(metroTextBox_Cost.Text, out var tempCost); + TotalCost = tempCost; DialogResult = DialogResult.OK; } @@ -28,5 +32,27 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm metroDateTime_Start.Value = DateTime.Parse(year + "-01-01"); metroDateTime_End.Value = DateTime.Parse(year + "-12-31"); } + + private void metroDateTime_Start_ValueChanged(object sender, EventArgs e) + { + long cost = Global.GlobalSettings.UsageFee; + + var days = (metroDateTime_End.Value - metroDateTime_Start.Value).TotalDays; + if (days == 365) + { + metroTextBox_Cost.Text = cost.ToString(); + return; + } + + Debug.WriteLine((days)); + + + var doubleCost = cost / 365 * days; + doubleCost -= (doubleCost % 10); // 10의 자리 버림 + int totalCost = (int)doubleCost; + metroTextBox_Cost.Text = totalCost.ToString(); + + + } } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.Designer.cs index ddb3169..7469d6f 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.Designer.cs @@ -40,6 +40,9 @@ this.metroDateTime_Start = new MetroFramework.Controls.MetroDateTime(); this.metroLabel4 = new MetroFramework.Controls.MetroLabel(); this.metroLabel5 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel6 = new MetroFramework.Controls.MetroLabel(); + this.metroTextBox_Cost = new MetroFramework.Controls.MetroTextBox(); + this.metroLabel7 = new MetroFramework.Controls.MetroLabel(); this.SuspendLayout(); // // metroLabel1 @@ -84,7 +87,7 @@ // // this.metroTextBox_Count.CustomButton.Image = null; - this.metroTextBox_Count.CustomButton.Location = new System.Drawing.Point(53, 1); + this.metroTextBox_Count.CustomButton.Location = new System.Drawing.Point(98, 1); this.metroTextBox_Count.CustomButton.Name = ""; this.metroTextBox_Count.CustomButton.Size = new System.Drawing.Size(21, 21); this.metroTextBox_Count.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; @@ -111,9 +114,9 @@ // metroButton_Ok // this.metroButton_Ok.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_Ok.Location = new System.Drawing.Point(96, 273); + this.metroButton_Ok.Location = new System.Drawing.Point(96, 296); this.metroButton_Ok.Name = "metroButton_Ok"; - this.metroButton_Ok.Size = new System.Drawing.Size(144, 78); + this.metroButton_Ok.Size = new System.Drawing.Size(144, 55); this.metroButton_Ok.TabIndex = 5; this.metroButton_Ok.Text = "확인"; this.metroButton_Ok.UseSelectable = true; @@ -122,9 +125,9 @@ // metroButton_Cancel // this.metroButton_Cancel.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_Cancel.Location = new System.Drawing.Point(246, 273); + this.metroButton_Cancel.Location = new System.Drawing.Point(246, 296); this.metroButton_Cancel.Name = "metroButton_Cancel"; - this.metroButton_Cancel.Size = new System.Drawing.Size(144, 78); + this.metroButton_Cancel.Size = new System.Drawing.Size(144, 55); this.metroButton_Cancel.TabIndex = 6; this.metroButton_Cancel.Text = "취소"; this.metroButton_Cancel.UseSelectable = true; @@ -146,6 +149,7 @@ this.metroDateTime_End.Name = "metroDateTime_End"; this.metroDateTime_End.Size = new System.Drawing.Size(200, 29); this.metroDateTime_End.TabIndex = 11; + this.metroDateTime_End.ValueChanged += new System.EventHandler(this.metroDateTime_Start_ValueChanged); // // metroDateTime_Start // @@ -154,6 +158,7 @@ this.metroDateTime_Start.Name = "metroDateTime_Start"; this.metroDateTime_Start.Size = new System.Drawing.Size(200, 29); this.metroDateTime_Start.TabIndex = 10; + this.metroDateTime_Start.ValueChanged += new System.EventHandler(this.metroDateTime_Start_ValueChanged); // // metroLabel4 // @@ -173,12 +178,66 @@ this.metroLabel5.TabIndex = 9; this.metroLabel5.Text = "이용 시작일"; // + // metroLabel6 + // + this.metroLabel6.AutoSize = true; + this.metroLabel6.Location = new System.Drawing.Point(374, 259); + this.metroLabel6.Name = "metroLabel6"; + this.metroLabel6.Size = new System.Drawing.Size(23, 19); + this.metroLabel6.TabIndex = 14; + this.metroLabel6.Text = "원"; + // + // metroTextBox_Cost + // + // + // + // + this.metroTextBox_Cost.CustomButton.Image = null; + this.metroTextBox_Cost.CustomButton.Location = new System.Drawing.Point(158, 1); + this.metroTextBox_Cost.CustomButton.Name = ""; + this.metroTextBox_Cost.CustomButton.Size = new System.Drawing.Size(21, 21); + this.metroTextBox_Cost.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.metroTextBox_Cost.CustomButton.TabIndex = 1; + this.metroTextBox_Cost.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.metroTextBox_Cost.CustomButton.UseSelectable = true; + this.metroTextBox_Cost.CustomButton.Visible = false; + this.metroTextBox_Cost.Lines = new string[] { + "0"}; + this.metroTextBox_Cost.Location = new System.Drawing.Point(191, 255); + this.metroTextBox_Cost.MaxLength = 32767; + this.metroTextBox_Cost.Name = "metroTextBox_Cost"; + this.metroTextBox_Cost.PasswordChar = '\0'; + this.metroTextBox_Cost.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.metroTextBox_Cost.SelectedText = ""; + this.metroTextBox_Cost.SelectionLength = 0; + this.metroTextBox_Cost.SelectionStart = 0; + this.metroTextBox_Cost.ShortcutsEnabled = true; + this.metroTextBox_Cost.Size = new System.Drawing.Size(180, 23); + this.metroTextBox_Cost.TabIndex = 13; + this.metroTextBox_Cost.Text = "0"; + this.metroTextBox_Cost.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.metroTextBox_Cost.UseSelectable = true; + this.metroTextBox_Cost.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.metroTextBox_Cost.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // metroLabel7 + // + this.metroLabel7.AutoSize = true; + this.metroLabel7.Location = new System.Drawing.Point(98, 259); + this.metroLabel7.Name = "metroLabel7"; + this.metroLabel7.Size = new System.Drawing.Size(87, 19); + this.metroLabel7.TabIndex = 12; + this.metroLabel7.Text = "총 이용 금액"; + // // WaitingCount // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BorderStyle = MetroFramework.Forms.MetroFormBorderStyle.FixedSingle; this.ClientSize = new System.Drawing.Size(420, 370); + this.Controls.Add(this.metroLabel6); + this.Controls.Add(this.metroTextBox_Cost); + this.Controls.Add(this.metroLabel7); this.Controls.Add(this.metroDateTime_End); this.Controls.Add(this.metroDateTime_Start); this.Controls.Add(this.metroLabel4); @@ -213,5 +272,8 @@ private MetroFramework.Controls.MetroDateTime metroDateTime_Start; private MetroFramework.Controls.MetroLabel metroLabel4; private MetroFramework.Controls.MetroLabel metroLabel5; + private MetroFramework.Controls.MetroLabel metroLabel6; + private MetroFramework.Controls.MetroTextBox metroTextBox_Cost; + private MetroFramework.Controls.MetroLabel metroLabel7; } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.cs index a134d7f..5e48e36 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/WaitingCount.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; +using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; @@ -15,9 +16,11 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm public int ResultCount { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } - + public int TotalCost { get; set; } + private int _MaxCount = 0; // 대기자 전체 카운트 private int _WaitngCount = 0; // 순번이 있는 대기자 카운트 + public WaitingCount(int maxCount, int waitngCount) { InitializeComponent(); @@ -42,6 +45,8 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm ResultCount=count; StartDate = metroDateTime_Start.Value; EndDate = metroDateTime_End.Value; + int.TryParse(metroTextBox_Cost.Text, out var tempCost); + TotalCost = tempCost; DialogResult = DialogResult.OK; @@ -59,5 +64,25 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm metroDateTime_Start.Value = DateTime.Parse(year + "-01-01"); metroDateTime_End.Value = DateTime.Parse(year + "-12-31"); } + + private void metroDateTime_Start_ValueChanged(object sender, EventArgs e) + { + long cost = Global.GlobalSettings.UsageFee; + + var days = (metroDateTime_End.Value - metroDateTime_Start.Value).TotalDays; + if (days == 365) + { + metroTextBox_Cost.Text = cost.ToString(); + return; + } + + Debug.WriteLine((days)); + + + var doubleCost = cost / 365 * days; + doubleCost -= (doubleCost % 10); // 10의 자리 버림 + int totalCost = (int)doubleCost; + metroTextBox_Cost.Text = totalCost.ToString(); + } } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.Designer.cs index 295452d..db36b94 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.Designer.cs @@ -34,6 +34,7 @@ this.metroRadioButton_InspectionTrue = new MetroFramework.Controls.MetroRadioButton(); this.metroRadioButton_InspectionAll = new MetroFramework.Controls.MetroRadioButton(); this.metroPanel1 = new MetroFramework.Controls.MetroPanel(); + this.metroButton_ExportExcel = new MetroFramework.Controls.MetroButton(); this.metroButton_Delete = new MetroFramework.Controls.MetroButton(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); @@ -99,6 +100,7 @@ // // metroPanel1 // + this.metroPanel1.Controls.Add(this.metroButton_ExportExcel); this.metroPanel1.Controls.Add(this.metroButton_Delete); this.metroPanel1.Controls.Add(this.groupBox2); this.metroPanel1.Controls.Add(this.metroButton_InspectionFalse); @@ -119,6 +121,19 @@ this.metroPanel1.VerticalScrollbarHighlightOnWheel = false; this.metroPanel1.VerticalScrollbarSize = 10; // + // metroButton_ExportExcel + // + this.metroButton_ExportExcel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.metroButton_ExportExcel.BackgroundImage = global::HSUCO_Cargo_Garage_Operation_Program.Properties.Resources.file_type_excel_icon_130611; + this.metroButton_ExportExcel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.metroButton_ExportExcel.FontSize = MetroFramework.MetroButtonSize.Tall; + this.metroButton_ExportExcel.Location = new System.Drawing.Point(626, 322); + this.metroButton_ExportExcel.Name = "metroButton_ExportExcel"; + this.metroButton_ExportExcel.Size = new System.Drawing.Size(121, 115); + this.metroButton_ExportExcel.TabIndex = 10; + this.metroButton_ExportExcel.UseSelectable = true; + this.metroButton_ExportExcel.Click += new System.EventHandler(this.metroButton_ExportExcel_Click); + // // metroButton_Delete // this.metroButton_Delete.Anchor = System.Windows.Forms.AnchorStyles.Right; @@ -318,5 +333,6 @@ private MetroFramework.Controls.MetroLabel metroLabel2; private MetroFramework.Controls.MetroLabel metroLabel1; private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private MetroFramework.Controls.MetroButton metroButton_ExportExcel; } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs index 1cfb3c2..31f504e 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs @@ -222,10 +222,23 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl if (promotion.ShowDialog() == DialogResult.OK) { - Database.AddUserList(RegistrationNumberTruck, promotion.StartDate, promotion.EndDate); + Database.AddUserList(RegistrationNumberTruck, promotion.StartDate, promotion.EndDate, promotion.TotalCost); DataChange(); } } } + + private void metroButton_ExportExcel_Click(object sender, EventArgs e) + { + var excelWrapper = new ExcelWrapper(); + + var saveFileDialog = new SaveFileDialog(); + saveFileDialog.Filter = "XLSX files (*.xlsx)|*.xlsx"; + + if (saveFileDialog.ShowDialog() == DialogResult.OK) + { + var result = excelWrapper.WriteDataTableToExcel((DataTable)dataGridView_List.DataSource, "UserList", saveFileDialog.FileName, "이용자 리스트", Environment.MachineName, DateTime.Now); + } + } } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.Designer.cs new file mode 100644 index 0000000..1a71e59 --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.Designer.cs @@ -0,0 +1,37 @@ +namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl +{ + partial class ListCertificate + { + /// + /// 필수 디자이너 변수입니다. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 사용 중인 모든 리소스를 정리합니다. + /// + /// 관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 구성 요소 디자이너에서 생성한 코드 + + /// + /// 디자이너 지원에 필요한 메서드입니다. + /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.cs new file mode 100644 index 0000000..fe8fbd2 --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListCertificate.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl +{ + public partial class ListCertificate : UserControl + { + public ListCertificate() + { + InitializeComponent(); + } + } +} diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.Designer.cs new file mode 100644 index 0000000..484635a --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.Designer.cs @@ -0,0 +1,37 @@ +namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl +{ + partial class ListProceeds + { + /// + /// 필수 디자이너 변수입니다. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 사용 중인 모든 리소스를 정리합니다. + /// + /// 관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 구성 요소 디자이너에서 생성한 코드 + + /// + /// 디자이너 지원에 필요한 메서드입니다. + /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.cs new file mode 100644 index 0000000..63ef6dd --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ListProceeds.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl +{ + public partial class ListProceeds : UserControl + { + public ListProceeds() + { + InitializeComponent(); + } + } +} diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.Designer.cs new file mode 100644 index 0000000..bb29025 --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.Designer.cs @@ -0,0 +1,295 @@ +namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl +{ + partial class SettingControl + { + /// + /// 필수 디자이너 변수입니다. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 사용 중인 모든 리소스를 정리합니다. + /// + /// 관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 구성 요소 디자이너에서 생성한 코드 + + /// + /// 디자이너 지원에 필요한 메서드입니다. + /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. + /// + private void InitializeComponent() + { + this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel3 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel4 = new MetroFramework.Controls.MetroLabel(); + this.metroTextBox_UsageFee = new MetroFramework.Controls.MetroTextBox(); + this.metroTextBox_ExtendedFee = new MetroFramework.Controls.MetroTextBox(); + this.metroTextBox_CertificateFee = new MetroFramework.Controls.MetroTextBox(); + this.metroTextBox_ReCertificateFee = new MetroFramework.Controls.MetroTextBox(); + this.metroButton_Save = new MetroFramework.Controls.MetroButton(); + this.metroLabel5 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel6 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel7 = new MetroFramework.Controls.MetroLabel(); + this.metroLabel8 = new MetroFramework.Controls.MetroLabel(); + this.SuspendLayout(); + // + // 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(96, 19); + this.metroLabel1.TabIndex = 0; + this.metroLabel1.Text = "이용 금액(1년)"; + // + // 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(96, 19); + this.metroLabel2.TabIndex = 1; + this.metroLabel2.Text = "연장 금액(1년)"; + // + // metroLabel3 + // + this.metroLabel3.AutoSize = true; + this.metroLabel3.Location = new System.Drawing.Point(20, 80); + this.metroLabel3.Name = "metroLabel3"; + this.metroLabel3.Size = new System.Drawing.Size(115, 19); + this.metroLabel3.TabIndex = 2; + this.metroLabel3.Text = "증명서 발급 금액"; + // + // metroLabel4 + // + this.metroLabel4.AutoSize = true; + this.metroLabel4.Location = new System.Drawing.Point(20, 110); + this.metroLabel4.Name = "metroLabel4"; + this.metroLabel4.Size = new System.Drawing.Size(129, 19); + this.metroLabel4.TabIndex = 3; + this.metroLabel4.Text = "증명서 재발급 금액"; + // + // metroTextBox_UsageFee + // + // + // + // + this.metroTextBox_UsageFee.CustomButton.Image = null; + this.metroTextBox_UsageFee.CustomButton.Location = new System.Drawing.Point(78, 1); + this.metroTextBox_UsageFee.CustomButton.Name = ""; + this.metroTextBox_UsageFee.CustomButton.Size = new System.Drawing.Size(21, 21); + this.metroTextBox_UsageFee.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.metroTextBox_UsageFee.CustomButton.TabIndex = 1; + this.metroTextBox_UsageFee.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.metroTextBox_UsageFee.CustomButton.UseSelectable = true; + this.metroTextBox_UsageFee.CustomButton.Visible = false; + this.metroTextBox_UsageFee.Lines = new string[0]; + this.metroTextBox_UsageFee.Location = new System.Drawing.Point(150, 16); + this.metroTextBox_UsageFee.MaxLength = 32767; + this.metroTextBox_UsageFee.Name = "metroTextBox_UsageFee"; + this.metroTextBox_UsageFee.PasswordChar = '\0'; + this.metroTextBox_UsageFee.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.metroTextBox_UsageFee.SelectedText = ""; + this.metroTextBox_UsageFee.SelectionLength = 0; + this.metroTextBox_UsageFee.SelectionStart = 0; + this.metroTextBox_UsageFee.ShortcutsEnabled = true; + this.metroTextBox_UsageFee.Size = new System.Drawing.Size(100, 23); + this.metroTextBox_UsageFee.TabIndex = 4; + this.metroTextBox_UsageFee.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.metroTextBox_UsageFee.UseSelectable = true; + this.metroTextBox_UsageFee.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.metroTextBox_UsageFee.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // metroTextBox_ExtendedFee + // + // + // + // + this.metroTextBox_ExtendedFee.CustomButton.Image = null; + this.metroTextBox_ExtendedFee.CustomButton.Location = new System.Drawing.Point(78, 1); + this.metroTextBox_ExtendedFee.CustomButton.Name = ""; + this.metroTextBox_ExtendedFee.CustomButton.Size = new System.Drawing.Size(21, 21); + this.metroTextBox_ExtendedFee.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.metroTextBox_ExtendedFee.CustomButton.TabIndex = 1; + this.metroTextBox_ExtendedFee.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.metroTextBox_ExtendedFee.CustomButton.UseSelectable = true; + this.metroTextBox_ExtendedFee.CustomButton.Visible = false; + this.metroTextBox_ExtendedFee.Lines = new string[0]; + this.metroTextBox_ExtendedFee.Location = new System.Drawing.Point(150, 45); + this.metroTextBox_ExtendedFee.MaxLength = 32767; + this.metroTextBox_ExtendedFee.Name = "metroTextBox_ExtendedFee"; + this.metroTextBox_ExtendedFee.PasswordChar = '\0'; + this.metroTextBox_ExtendedFee.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.metroTextBox_ExtendedFee.SelectedText = ""; + this.metroTextBox_ExtendedFee.SelectionLength = 0; + this.metroTextBox_ExtendedFee.SelectionStart = 0; + this.metroTextBox_ExtendedFee.ShortcutsEnabled = true; + this.metroTextBox_ExtendedFee.Size = new System.Drawing.Size(100, 23); + this.metroTextBox_ExtendedFee.TabIndex = 5; + this.metroTextBox_ExtendedFee.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.metroTextBox_ExtendedFee.UseSelectable = true; + this.metroTextBox_ExtendedFee.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.metroTextBox_ExtendedFee.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // metroTextBox_CertificateFee + // + // + // + // + this.metroTextBox_CertificateFee.CustomButton.Image = null; + this.metroTextBox_CertificateFee.CustomButton.Location = new System.Drawing.Point(78, 1); + this.metroTextBox_CertificateFee.CustomButton.Name = ""; + this.metroTextBox_CertificateFee.CustomButton.Size = new System.Drawing.Size(21, 21); + this.metroTextBox_CertificateFee.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.metroTextBox_CertificateFee.CustomButton.TabIndex = 1; + this.metroTextBox_CertificateFee.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.metroTextBox_CertificateFee.CustomButton.UseSelectable = true; + this.metroTextBox_CertificateFee.CustomButton.Visible = false; + this.metroTextBox_CertificateFee.Lines = new string[0]; + this.metroTextBox_CertificateFee.Location = new System.Drawing.Point(150, 76); + this.metroTextBox_CertificateFee.MaxLength = 32767; + this.metroTextBox_CertificateFee.Name = "metroTextBox_CertificateFee"; + this.metroTextBox_CertificateFee.PasswordChar = '\0'; + this.metroTextBox_CertificateFee.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.metroTextBox_CertificateFee.SelectedText = ""; + this.metroTextBox_CertificateFee.SelectionLength = 0; + this.metroTextBox_CertificateFee.SelectionStart = 0; + this.metroTextBox_CertificateFee.ShortcutsEnabled = true; + this.metroTextBox_CertificateFee.Size = new System.Drawing.Size(100, 23); + this.metroTextBox_CertificateFee.TabIndex = 6; + this.metroTextBox_CertificateFee.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.metroTextBox_CertificateFee.UseSelectable = true; + this.metroTextBox_CertificateFee.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.metroTextBox_CertificateFee.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // metroTextBox_ReCertificateFee + // + // + // + // + this.metroTextBox_ReCertificateFee.CustomButton.Image = null; + this.metroTextBox_ReCertificateFee.CustomButton.Location = new System.Drawing.Point(78, 1); + this.metroTextBox_ReCertificateFee.CustomButton.Name = ""; + this.metroTextBox_ReCertificateFee.CustomButton.Size = new System.Drawing.Size(21, 21); + this.metroTextBox_ReCertificateFee.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.metroTextBox_ReCertificateFee.CustomButton.TabIndex = 1; + this.metroTextBox_ReCertificateFee.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.metroTextBox_ReCertificateFee.CustomButton.UseSelectable = true; + this.metroTextBox_ReCertificateFee.CustomButton.Visible = false; + this.metroTextBox_ReCertificateFee.Lines = new string[0]; + this.metroTextBox_ReCertificateFee.Location = new System.Drawing.Point(150, 106); + this.metroTextBox_ReCertificateFee.MaxLength = 32767; + this.metroTextBox_ReCertificateFee.Name = "metroTextBox_ReCertificateFee"; + this.metroTextBox_ReCertificateFee.PasswordChar = '\0'; + this.metroTextBox_ReCertificateFee.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.metroTextBox_ReCertificateFee.SelectedText = ""; + this.metroTextBox_ReCertificateFee.SelectionLength = 0; + this.metroTextBox_ReCertificateFee.SelectionStart = 0; + this.metroTextBox_ReCertificateFee.ShortcutsEnabled = true; + this.metroTextBox_ReCertificateFee.Size = new System.Drawing.Size(100, 23); + this.metroTextBox_ReCertificateFee.TabIndex = 7; + this.metroTextBox_ReCertificateFee.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.metroTextBox_ReCertificateFee.UseSelectable = true; + this.metroTextBox_ReCertificateFee.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.metroTextBox_ReCertificateFee.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // metroButton_Save + // + this.metroButton_Save.FontSize = MetroFramework.MetroButtonSize.Tall; + this.metroButton_Save.Location = new System.Drawing.Point(173, 140); + this.metroButton_Save.Name = "metroButton_Save"; + this.metroButton_Save.Size = new System.Drawing.Size(100, 40); + this.metroButton_Save.TabIndex = 8; + this.metroButton_Save.Text = "설정 저장"; + this.metroButton_Save.UseSelectable = true; + this.metroButton_Save.Click += new System.EventHandler(this.metroButton_Save_Click); + // + // metroLabel5 + // + this.metroLabel5.AutoSize = true; + this.metroLabel5.Location = new System.Drawing.Point(250, 20); + this.metroLabel5.Name = "metroLabel5"; + this.metroLabel5.Size = new System.Drawing.Size(23, 19); + this.metroLabel5.TabIndex = 9; + this.metroLabel5.Text = "원"; + // + // metroLabel6 + // + this.metroLabel6.AutoSize = true; + this.metroLabel6.Location = new System.Drawing.Point(250, 50); + this.metroLabel6.Name = "metroLabel6"; + this.metroLabel6.Size = new System.Drawing.Size(23, 19); + this.metroLabel6.TabIndex = 9; + this.metroLabel6.Text = "원"; + // + // metroLabel7 + // + this.metroLabel7.AutoSize = true; + this.metroLabel7.Location = new System.Drawing.Point(250, 80); + this.metroLabel7.Name = "metroLabel7"; + this.metroLabel7.Size = new System.Drawing.Size(23, 19); + this.metroLabel7.TabIndex = 9; + this.metroLabel7.Text = "원"; + // + // metroLabel8 + // + this.metroLabel8.AutoSize = true; + this.metroLabel8.Location = new System.Drawing.Point(250, 110); + this.metroLabel8.Name = "metroLabel8"; + this.metroLabel8.Size = new System.Drawing.Size(23, 19); + this.metroLabel8.TabIndex = 9; + this.metroLabel8.Text = "원"; + // + // SettingControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.Controls.Add(this.metroLabel8); + this.Controls.Add(this.metroLabel7); + this.Controls.Add(this.metroLabel6); + this.Controls.Add(this.metroLabel5); + this.Controls.Add(this.metroButton_Save); + this.Controls.Add(this.metroTextBox_ReCertificateFee); + this.Controls.Add(this.metroTextBox_CertificateFee); + this.Controls.Add(this.metroTextBox_ExtendedFee); + this.Controls.Add(this.metroTextBox_UsageFee); + this.Controls.Add(this.metroLabel4); + this.Controls.Add(this.metroLabel3); + this.Controls.Add(this.metroLabel2); + this.Controls.Add(this.metroLabel1); + this.Name = "SettingControl"; + this.Size = new System.Drawing.Size(300, 200); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.Settings_Paint); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private MetroFramework.Controls.MetroLabel metroLabel1; + private MetroFramework.Controls.MetroLabel metroLabel2; + private MetroFramework.Controls.MetroLabel metroLabel3; + private MetroFramework.Controls.MetroLabel metroLabel4; + private MetroFramework.Controls.MetroTextBox metroTextBox_UsageFee; + private MetroFramework.Controls.MetroTextBox metroTextBox_ExtendedFee; + private MetroFramework.Controls.MetroTextBox metroTextBox_CertificateFee; + private MetroFramework.Controls.MetroTextBox metroTextBox_ReCertificateFee; + private MetroFramework.Controls.MetroButton metroButton_Save; + private MetroFramework.Controls.MetroLabel metroLabel5; + private MetroFramework.Controls.MetroLabel metroLabel6; + private MetroFramework.Controls.MetroLabel metroLabel7; + private MetroFramework.Controls.MetroLabel metroLabel8; + } +} diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs new file mode 100644 index 0000000..bba5b1d --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs @@ -0,0 +1,61 @@ +using HSUCO_Cargo_Garage_Operation_Program.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Windows.Media; + +namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl +{ + public partial class SettingControl : UserControl + { + + public SettingControl() + { + InitializeComponent(); + } + + public void SettingReset() + { + + metroTextBox_UsageFee.Text = Global.GlobalSettings.UsageFee.ToString(); + metroTextBox_ExtendedFee.Text = Global.GlobalSettings.ExtendedFee.ToString(); + metroTextBox_CertificateFee.Text = Global.GlobalSettings.CertificateFee.ToString(); + metroTextBox_ReCertificateFee.Text = Global.GlobalSettings.ReCertificateFee.ToString(); + + } + + private void Settings_Paint(object sender, PaintEventArgs e) + { + SettingReset(); + + } + + private void metroButton_Save_Click(object sender, EventArgs e) + { + long value; + Settings settings = new Settings(); + + long.TryParse(metroTextBox_UsageFee.Text, out value); + settings.UsageFee = value; + + long.TryParse(metroTextBox_ExtendedFee.Text, out value); + settings.ExtendedFee = value; + + long.TryParse(metroTextBox_CertificateFee.Text, out value); + settings.CertificateFee = value; + long.TryParse(metroTextBox_ReCertificateFee.Text, out value); + settings.ReCertificateFee = value; + + Database.SaveSettings(settings); + + + } + } +} diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.resx b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.Designer.cs index b5a2b12..8152b4a 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.Designer.cs @@ -34,6 +34,7 @@ this.metroRadioButton_UseUser = new MetroFramework.Controls.MetroRadioButton(); this.metroRadioButton_InspectionAll = new MetroFramework.Controls.MetroRadioButton(); this.metroPanel1 = new MetroFramework.Controls.MetroPanel(); + this.metroButton_Certificate = new MetroFramework.Controls.MetroButton(); this.metroButton_ExportExcel = new MetroFramework.Controls.MetroButton(); this.metroButton_Refund = new MetroFramework.Controls.MetroButton(); this.metroButton_Extended = new MetroFramework.Controls.MetroButton(); @@ -98,6 +99,7 @@ // // metroPanel1 // + this.metroPanel1.Controls.Add(this.metroButton_Certificate); this.metroPanel1.Controls.Add(this.metroButton_ExportExcel); this.metroPanel1.Controls.Add(this.metroButton_Refund); this.metroPanel1.Controls.Add(this.metroButton_Extended); @@ -117,13 +119,25 @@ this.metroPanel1.VerticalScrollbarHighlightOnWheel = false; this.metroPanel1.VerticalScrollbarSize = 10; // + // metroButton_Certificate + // + this.metroButton_Certificate.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.metroButton_Certificate.FontSize = MetroFramework.MetroButtonSize.Tall; + this.metroButton_Certificate.Location = new System.Drawing.Point(626, 210); + this.metroButton_Certificate.Name = "metroButton_Certificate"; + this.metroButton_Certificate.Size = new System.Drawing.Size(121, 40); + this.metroButton_Certificate.TabIndex = 10; + this.metroButton_Certificate.Text = "증명서 발급"; + this.metroButton_Certificate.UseSelectable = true; + this.metroButton_Certificate.Click += new System.EventHandler(this.metroButton_Certificate_Click); + // // metroButton_ExportExcel // this.metroButton_ExportExcel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.metroButton_ExportExcel.BackgroundImage = global::HSUCO_Cargo_Garage_Operation_Program.Properties.Resources.file_type_excel_icon_130611; this.metroButton_ExportExcel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.metroButton_ExportExcel.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_ExportExcel.Location = new System.Drawing.Point(626, 212); + this.metroButton_ExportExcel.Location = new System.Drawing.Point(626, 256); this.metroButton_ExportExcel.Name = "metroButton_ExportExcel"; this.metroButton_ExportExcel.Size = new System.Drawing.Size(121, 115); this.metroButton_ExportExcel.TabIndex = 9; @@ -140,6 +154,7 @@ this.metroButton_Refund.TabIndex = 8; this.metroButton_Refund.Text = "환불"; this.metroButton_Refund.UseSelectable = true; + this.metroButton_Refund.Click += new System.EventHandler(this.metroButton_Refund_Click); // // metroButton_Extended // @@ -303,5 +318,6 @@ private MetroFramework.Controls.MetroButton metroButton_Refund; private MetroFramework.Controls.MetroButton metroButton_Extended; private MetroFramework.Controls.MetroButton metroButton_ExportExcel; + private MetroFramework.Controls.MetroButton metroButton_Certificate; } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs index 24fdcc4..273dc43 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs @@ -118,12 +118,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl if (saveFileDialog.ShowDialog() == DialogResult.OK) { - var result = excelWrapper.WriteDataTableToExcel((DataTable)dataGridView_List.DataSource, "UserList", saveFileDialog.FileName); - - if (!result) - { - Debug.Write("실패"); - } + var result = excelWrapper.WriteDataTableToExcel((DataTable)dataGridView_List.DataSource, "UserList", saveFileDialog.FileName, "이용자 리스트", Environment.MachineName, DateTime.Now); } } @@ -161,5 +156,21 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl DataChange(); } + + private void metroButton_Refund_Click(object sender, EventArgs e) + { + var allCount = dataGridView_List.SelectedRows.Count; + if (allCount == 0) return; + // TODO: 환불시 금액은 남은 이용일 일활 계산 + // 이 사람의 결제 금액 가져오기 -> 남은 일수 만큼 나누고 원단위 올림처리 연장 되었을경우 까지 처리 + } + + private void metroButton_Certificate_Click(object sender, EventArgs e) + { + var allCount = dataGridView_List.SelectedRows.Count; + if (allCount == 0) return; + // TODO: 증명서 인쇄 + // PRINT + } } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.Designer.cs index 0b9528d..7d635f5 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.Designer.cs @@ -34,6 +34,7 @@ this.metroRadioButton_InspectionTrue = new MetroFramework.Controls.MetroRadioButton(); this.metroRadioButton_InspectionAll = new MetroFramework.Controls.MetroRadioButton(); this.metroPanel1 = new MetroFramework.Controls.MetroPanel(); + this.metroButton_ExportExcel = new MetroFramework.Controls.MetroButton(); this.metroButton_Delete = new MetroFramework.Controls.MetroButton(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); @@ -99,6 +100,7 @@ // // metroPanel1 // + this.metroPanel1.Controls.Add(this.metroButton_ExportExcel); this.metroPanel1.Controls.Add(this.metroButton_Delete); this.metroPanel1.Controls.Add(this.groupBox2); this.metroPanel1.Controls.Add(this.metroButton_InspectionFalse); @@ -119,6 +121,19 @@ this.metroPanel1.VerticalScrollbarHighlightOnWheel = false; this.metroPanel1.VerticalScrollbarSize = 10; // + // metroButton_ExportExcel + // + this.metroButton_ExportExcel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.metroButton_ExportExcel.BackgroundImage = global::HSUCO_Cargo_Garage_Operation_Program.Properties.Resources.file_type_excel_icon_130611; + this.metroButton_ExportExcel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.metroButton_ExportExcel.FontSize = MetroFramework.MetroButtonSize.Tall; + this.metroButton_ExportExcel.Location = new System.Drawing.Point(626, 322); + this.metroButton_ExportExcel.Name = "metroButton_ExportExcel"; + this.metroButton_ExportExcel.Size = new System.Drawing.Size(121, 115); + this.metroButton_ExportExcel.TabIndex = 11; + this.metroButton_ExportExcel.UseSelectable = true; + this.metroButton_ExportExcel.Click += new System.EventHandler(this.metroButton_ExportExcel_Click); + // // metroButton_Delete // this.metroButton_Delete.Anchor = System.Windows.Forms.AnchorStyles.Right; @@ -318,5 +333,6 @@ private MetroFramework.Controls.MetroLabel metroLabel2; private MetroFramework.Controls.MetroLabel metroLabel1; private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private MetroFramework.Controls.MetroButton metroButton_ExportExcel; } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs index a8ebf40..87e54bd 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs @@ -220,9 +220,23 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl if (waitingCount.ShowDialog() == DialogResult.OK) { var list = RegistrationNumberTruck.GetRange(0, waitingCount.ResultCount); - Database.AddUserList(list, waitingCount.StartDate, waitingCount.EndDate); + TODO: //업데이트 필요함 + Database.AddUserList(list, waitingCount.StartDate, waitingCount.EndDate, waitingCount.TotalCost); DataChange(); } } + + private void metroButton_ExportExcel_Click(object sender, EventArgs e) + { + var excelWrapper = new ExcelWrapper(); + + var saveFileDialog = new SaveFileDialog(); + saveFileDialog.Filter = "XLSX files (*.xlsx)|*.xlsx"; + + if (saveFileDialog.ShowDialog() == DialogResult.OK) + { + var result = excelWrapper.WriteDataTableToExcel((DataTable)dataGridView_List.DataSource, "UserList", saveFileDialog.FileName, "이용자 리스트", Environment.MachineName, DateTime.Now); + } + } } } \ 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 a2235b9..4f5029c 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs @@ -33,4 +33,29 @@ namespace HSUCO_Cargo_Garage_Operation_Program public string RegistrationNumberTruck { get; set; } public DateTime DateEnd { get; set; } } + + public struct Settings + { + public long UsageFee {get; set;} + public long ExtendedFee { get; set; } + public long CertificateFee { get; set; } + public long ReCertificateFee { get; set; } + + // 현재 세팅값은 네임/밸류/Date 로 저장하게 되어있는데 이게 필요할까? 고정으로 바꾸는 방법이 더 좋지 않을까? + // 이용금액 Usage Fee + // 연장금액 Extended Fee + // 증명서발급 비용 Certificate Fee + // 재발급 비용 ReCertificate Fee + + } + + public enum ProceedsType + { + Fees, + Certificate, + ReCertificate, + Refunds + + } + } diff --git a/HSUCO_Cargo_Garage_Operation_Program/Database.cs b/HSUCO_Cargo_Garage_Operation_Program/Database.cs index a85a590..28211c5 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Database.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Database.cs @@ -1,28 +1,31 @@ -using HSUCO_Cargo_Garage_Operation_Program.CustomUserControl; -using System; +using System; using System.Collections.Generic; using System.Data.SQLite; using System.IO; namespace HSUCO_Cargo_Garage_Operation_Program { - public static class Database - { - static readonly string DBLocation = "database.sqlite"; - static SQLiteConnection _sqLiteConnection; + public static class Database + { + private static readonly string DBLocation = "database.sqlite"; + private static SQLiteConnection _sqLiteConnection; - static readonly string CONNECTION_STRING = $"Data Source={DBLocation}; Version=3; Integrated Security=true;"; + private static readonly string CONNECTION_STRING = + $"Data Source={DBLocation}; Version=3; Integrated Security=true;"; - static Database() => CreateDatabaseIfNotExist(); + static Database() + { + CreateDatabaseIfNotExist(); + } - static void CreateDatabaseIfNotExist() - { - if (!File.Exists(DBLocation)) - { - SQLiteConnection.CreateFile(DBLocation); - _sqLiteConnection = OpenConnection(); + private static void CreateDatabaseIfNotExist() + { + if (!File.Exists(DBLocation)) + { + SQLiteConnection.CreateFile(DBLocation); + _sqLiteConnection = OpenConnection(); - var createKeyTable = @" + var createKeyTable = @" CREATE TABLE ""ApplicantList"" ( ""ApplicantType"" INTEGER NOT NULL, ""RegistrationNumberTruck"" TEXT NOT NULL, @@ -83,290 +86,407 @@ namespace HSUCO_Cargo_Garage_Operation_Program PRIMARY KEY(""No"" AUTOINCREMENT) );"; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = createKeyTable; - command.ExecuteNonQuery(); - } - } - else - { - OpenConnection(); - } - } + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = createKeyTable; + command.ExecuteNonQuery(); + } + } + else + { + OpenConnection(); + } + } - static SQLiteConnection OpenConnection() - { - _sqLiteConnection = new SQLiteConnection(CONNECTION_STRING); - _sqLiteConnection.Open(); + private static SQLiteConnection OpenConnection() + { + _sqLiteConnection = new SQLiteConnection(CONNECTION_STRING); + _sqLiteConnection.Open(); - return _sqLiteConnection; - } + return _sqLiteConnection; + } - /// - /// 신청자 리스트에서 화물차 번호로 중복자 조회 - /// - /// 화물차 번호 - /// - public static bool ApplicantCheckAlready(string RegistrationNumberTruck) - { - var count = 0; - var query = string.Format("SELECT COUNT(*) From ApplicantList Where RegistrationNumberTruck = '{0}';", RegistrationNumberTruck.Trim()); + /// + /// 신청자 리스트에서 화물차 번호로 중복자 조회 + /// + /// 화물차 번호 + /// + public static bool ApplicantCheckAlready(string RegistrationNumberTruck) + { + var count = 0; + var query = string.Format("SELECT COUNT(*) From ApplicantList Where RegistrationNumberTruck = '{0}';", + RegistrationNumberTruck.Trim()); - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; - using (var reader = command.ExecuteReader()) - { - while (reader.Read()) - count = int.Parse(reader[0].ToString()); - } - } + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + count = int.Parse(reader[0].ToString()); + } + } - return count > 0; - } + return count > 0; + } - public static bool UserListCheckAlready(string RegistrationNumberTruck) - { - var count = 0; - var query = "SELECT COUNT(*) From UserList WHERE DateEnd >= \"" + DateTime.Now + "\" And RegistrationNumberTruck = \"" + RegistrationNumberTruck + "\""; + public static bool UserListCheckAlready(string RegistrationNumberTruck) + { + var count = 0; + var query = "SELECT COUNT(*) From UserList WHERE DateEnd >= \"" + DateTime.Now + + "\" And RegistrationNumberTruck = \"" + RegistrationNumberTruck + "\""; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; - using (var reader = command.ExecuteReader()) - { - while (reader.Read()) - count = int.Parse(reader[0].ToString()); - } - } + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + count = int.Parse(reader[0].ToString()); + } + } - return count > 0; - } + return count > 0; + } - public static bool ApplicantInsert(Applicant applicant) - { - var result = 0; + public static bool ApplicantInsert(Applicant applicant) + { + var result = 0; - var query = $"INSERT INTO ApplicantList VALUES('{applicant.ApplicantType.BoolToInt()}','{applicant.RegistrationNumberTruck}','{applicant.RegistrationNumberPassenger}','{applicant.Name}','{applicant.Phone}','{applicant.Address}','{applicant.DateOfApplication}','{applicant.Inspection.BoolToInt()}') "; + var query = + $"INSERT INTO ApplicantList VALUES('{applicant.ApplicantType.BoolToInt()}','{applicant.RegistrationNumberTruck}','{applicant.RegistrationNumberPassenger}','{applicant.Name}','{applicant.Phone}','{applicant.Address}','{applicant.DateOfApplication}','{applicant.Inspection.BoolToInt()}') "; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; - result = command.ExecuteNonQuery(); - } + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; + result = command.ExecuteNonQuery(); + } - return result > 0; - } + return result > 0; + } - public static List GetApplicant() - { - var applicants = new List(); - var query = $"SELECT * From ApplicantList Where ApplicantType=1"; + public static List GetApplicant() + { + var applicants = new List(); + var query = "SELECT * From ApplicantList Where ApplicantType=1"; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; - using (var reader = command.ExecuteReader()) - { - while (reader.Read()) - { - var applicant = new Applicant(); - applicant.ApplicantType = reader["ApplicantType"].ToString() == "1"; - applicant.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); - applicant.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); - applicant.Name = reader["Name"].ToString(); - applicant.Phone = reader["Phone"].ToString(); - applicant.Address = reader["Address"].ToString(); - applicant.DateOfApplication = DateTime.Parse(reader["DateOfApplicant"].ToString()); - applicant.Inspection = reader["Inspection"].ToString() == "1"; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + var applicant = new Applicant(); + applicant.ApplicantType = reader["ApplicantType"].ToString() == "1"; + applicant.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); + applicant.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); + applicant.Name = reader["Name"].ToString(); + applicant.Phone = reader["Phone"].ToString(); + applicant.Address = reader["Address"].ToString(); + applicant.DateOfApplication = DateTime.Parse(reader["DateOfApplicant"].ToString()); + applicant.Inspection = reader["Inspection"].ToString() == "1"; - applicants.Add(applicant); - } - } - } + applicants.Add(applicant); + } + } + } - return applicants; - } + return applicants; + } - public static List GetApplicantWiat() - { - var applicants = new List(); - var query = $"SELECT * From ApplicantList Where ApplicantType=0 Order By Inspection DESC, DateOfApplicant"; + public static List GetApplicantWiat() + { + var applicants = new List(); + var query = "SELECT * From ApplicantList Where ApplicantType=0 Order By Inspection DESC, DateOfApplicant"; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; - using (var reader = command.ExecuteReader()) - { - while (reader.Read()) - { - var applicant = new Applicant(); - applicant.ApplicantType = reader["ApplicantType"].ToString() == "1"; - applicant.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); - applicant.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); - applicant.Name = reader["Name"].ToString(); - applicant.Phone = reader["Phone"].ToString(); - applicant.Address = reader["Address"].ToString(); - applicant.DateOfApplication = DateTime.Parse(reader["DateOfApplicant"].ToString()); - applicant.Inspection = reader["Inspection"].ToString() == "1"; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + var applicant = new Applicant(); + applicant.ApplicantType = reader["ApplicantType"].ToString() == "1"; + applicant.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); + applicant.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); + applicant.Name = reader["Name"].ToString(); + applicant.Phone = reader["Phone"].ToString(); + applicant.Address = reader["Address"].ToString(); + applicant.DateOfApplication = DateTime.Parse(reader["DateOfApplicant"].ToString()); + applicant.Inspection = reader["Inspection"].ToString() == "1"; - applicants.Add(applicant); - } - } - } + applicants.Add(applicant); + } + } + } - return applicants; - } + return applicants; + } - public static List GetUserList() - { - var userList = new List(); - var query = $"SELECT * From UserList"; + public static List GetUserList() + { + var userList = new List(); + var query = "SELECT * From UserList"; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; - using (var reader = command.ExecuteReader()) - { - while (reader.Read()) - { - var user = new User(); - user.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); - user.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); - user.Name = reader["Name"].ToString(); - user.Phone = reader["Phone"].ToString(); - user.Address = reader["Address"].ToString(); - user.DateOfApplicant = DateTime.Parse(reader["DateOfApplicant"].ToString()); - user.DateStart = DateTime.Parse(reader["DateStart"].ToString()); - user.DateEnd = DateTime.Parse(reader["DateEnd"].ToString()); - user.Extended = reader["Extended"].ToString() == "1"; - user.RefundCheck = reader["RefundCheck"].ToString() == "1"; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + var user = new User(); + user.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); + user.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); + user.Name = reader["Name"].ToString(); + user.Phone = reader["Phone"].ToString(); + user.Address = reader["Address"].ToString(); + user.DateOfApplicant = DateTime.Parse(reader["DateOfApplicant"].ToString()); + user.DateStart = DateTime.Parse(reader["DateStart"].ToString()); + user.DateEnd = DateTime.Parse(reader["DateEnd"].ToString()); + user.Extended = reader["Extended"].ToString() == "1"; + user.RefundCheck = reader["RefundCheck"].ToString() == "1"; - userList.Add(user); - } - } - } + userList.Add(user); + } + } + } - return userList; - } + return userList; + } - public static void ChangeInspection(List RegistrationNumberTruck, bool result) - { - for (int i = 0; i < RegistrationNumberTruck.Count; i++) - { - var query = "UPDATE ApplicantList SET Inspection=" + result.BoolToInt() + ", DateOfApplicant=\"" + DateTime.Now + "\" Where RegistrationNumberTruck=\"" + RegistrationNumberTruck[i] + "\""; + public static void ChangeInspection(List RegistrationNumberTruck, bool result) + { + for (var i = 0; i < RegistrationNumberTruck.Count; i++) + { + var query = "UPDATE ApplicantList SET Inspection=" + result.BoolToInt() + ", DateOfApplicant=\"" + + DateTime.Now + "\" Where RegistrationNumberTruck=\"" + RegistrationNumberTruck[i] + "\""; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; - command.ExecuteNonQuery(); - } - } - } + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; + command.ExecuteNonQuery(); + } + } + } - public static void UpdateExtended(List extendeds) - { - for (int i =0; i < extendeds.Count; i++) - { - var query = "UPDATE UserList Set DateEnd=\"" + extendeds[i].DateEnd.AddYears(1) + "\" Extended=\"" + true.BoolToInt() + "\" Where RegistrationNumberTruck=\"" + extendeds[i].RegistrationNumberTruck + "\""; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; - command.ExecuteNonQuery(); - } - - } - } + public static void UpdateExtended(List extendeds) + { + for (var i = 0; i < extendeds.Count; i++) + { + var query = "UPDATE UserList Set DateEnd=\"" + extendeds[i].DateEnd.AddYears(1) + "\" Extended=\"" + + true.BoolToInt() + "\" Where RegistrationNumberTruck=\"" + + extendeds[i].RegistrationNumberTruck + "\""; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; + command.ExecuteNonQuery(); + } + } + } - public static List GetApplicantList(List RegistrationNumberTruck) - { - var applicants = new List(); + public static List GetApplicantList(List RegistrationNumberTruck) + { + var applicants = new List(); - for (int i = 0; i < RegistrationNumberTruck.Count; i++) - { - var query = $"SELECT * From ApplicantList Where RegistrationNumberTruck='{RegistrationNumberTruck[i]}'"; + for (var i = 0; i < RegistrationNumberTruck.Count; i++) + { + var query = $"SELECT * From ApplicantList Where RegistrationNumberTruck='{RegistrationNumberTruck[i]}'"; - using (var command = _sqLiteConnection.CreateCommand()) - { - command.CommandText = query; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; - using (var reader = command.ExecuteReader()) - { - while (reader.Read()) - { - var applicant = new Applicant(); - applicant.ApplicantType = reader["ApplicantType"].ToString() == "1"; - applicant.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); - applicant.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); - applicant.Name = reader["Name"].ToString(); - applicant.Phone = reader["Phone"].ToString(); - applicant.Address = reader["Address"].ToString(); - applicant.DateOfApplication = DateTime.Parse(reader["DateOfApplicant"].ToString()); - applicant.Inspection = reader["Inspection"].ToString() == "1"; - applicants.Add(applicant); - } - } - } - } + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + var applicant = new Applicant(); + applicant.ApplicantType = reader["ApplicantType"].ToString() == "1"; + applicant.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString(); + applicant.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString(); + applicant.Name = reader["Name"].ToString(); + applicant.Phone = reader["Phone"].ToString(); + applicant.Address = reader["Address"].ToString(); + applicant.DateOfApplication = DateTime.Parse(reader["DateOfApplicant"].ToString()); + applicant.Inspection = reader["Inspection"].ToString() == "1"; + applicants.Add(applicant); + } + } + } + } - return applicants; - } + return applicants; + } - public static void AddUserList(List RegistrationNumberTruck, DateTime start, DateTime end) - { - var applicants = GetApplicantList(RegistrationNumberTruck); + public static void AddUserList(List RegistrationNumberTruck, DateTime start, DateTime end, + int totalCost) + { + var applicants = GetApplicantList(RegistrationNumberTruck); - for (int i = 0; i < applicants.Count; i++) - { - var query = $"INSERT INTO UserList (RegistrationNumberTruck,RegistrationNumberPassenger,Name,Phone,Address,ResidentsType,DateOfApplicant,DateStart,DateEnd,Extended,RefundCheck) VALUES('{applicants[i].RegistrationNumberTruck}','{applicants[i].RegistrationNumberPassenger}','{applicants[i].Name}','{applicants[i].Phone}','{applicants[i].Address}','{applicants[i].DateOfApplication}','{start}','{end}','0','0') "; + for (var i = 0; i < applicants.Count; i++) + { + var query = + $"INSERT INTO UserList (RegistrationNumberTruck,RegistrationNumberPassenger,Name,Phone,Address,DateOfApplicant,DateStart,DateEnd,Extended,RefundCheck) VALUES('{applicants[i].RegistrationNumberTruck}','{applicants[i].RegistrationNumberPassenger}','{applicants[i].Name}','{applicants[i].Phone}','{applicants[i].Address}','{applicants[i].DateOfApplication}','{start}','{end}','0','0') "; + using (var insertCommand = _sqLiteConnection.CreateCommand()) + { + insertCommand.CommandText = query; + insertCommand.ExecuteNonQuery(); + } - using (var insertCommand = _sqLiteConnection.CreateCommand()) - { - insertCommand.CommandText = query; - insertCommand.ExecuteNonQuery(); - } - query = $"DELETE FROM ApplicantList Where RegistrationNumberTruck=\"{applicants[i].RegistrationNumberTruck}\""; + var no = _sqLiteConnection.LastInsertRowId; + query = + $"INSERT INTO LedgerProceeds(No, Type, Amount, Date) VALUES({no},{(int)ProceedsType.Fees},{totalCost},'{DateTime.Now}')"; + using (var insertCommand = _sqLiteConnection.CreateCommand()) + { + insertCommand.CommandText = query; + insertCommand.ExecuteNonQuery(); + } - using (var deleteCommand = _sqLiteConnection.CreateCommand()) - { - deleteCommand.CommandText = query; - deleteCommand.ExecuteNonQuery(); - } - } - } + query = + $"DELETE FROM ApplicantList Where RegistrationNumberTruck=\"{applicants[i].RegistrationNumberTruck}\""; - public static void DeleteInspection(List RegistrationNumberTruck, string DeleterName, string Reason) - { - var applicants = GetApplicantList(RegistrationNumberTruck); + using (var deleteCommand = _sqLiteConnection.CreateCommand()) + { + deleteCommand.CommandText = query; + deleteCommand.ExecuteNonQuery(); + } + } + } - for (int i = 0; i < applicants.Count; i++) - { - var query = $"INSERT INTO DeleteList VALUES('{applicants[i].ApplicantType.BoolToInt()}','{applicants[i].RegistrationNumberTruck}','{applicants[i].RegistrationNumberPassenger}','{applicants[i].Name}','{applicants[i].Phone}','{applicants[i].Address}','{applicants[i].DateOfApplication}','{applicants[i].Inspection.BoolToInt()}','{DateTime.Now.ToString()}','{DeleterName}','{Reason}') "; + public static void DeleteInspection(List RegistrationNumberTruck, string DeleterName, string Reason) + { + var applicants = GetApplicantList(RegistrationNumberTruck); - using (var insertCommand = _sqLiteConnection.CreateCommand()) - { - insertCommand.CommandText = query; - insertCommand.ExecuteNonQuery(); - } + for (var i = 0; i < applicants.Count; i++) + { + var query = + $"INSERT INTO DeleteList VALUES('{applicants[i].ApplicantType.BoolToInt()}','{applicants[i].RegistrationNumberTruck}','{applicants[i].RegistrationNumberPassenger}','{applicants[i].Name}','{applicants[i].Phone}','{applicants[i].Address}','{applicants[i].DateOfApplication}','{applicants[i].Inspection.BoolToInt()}','{DateTime.Now.ToString()}','{DeleterName}','{Reason}') "; - query = $"DELETE FROM ApplicantList Where RegistrationNumberTruck=\"{applicants[i].RegistrationNumberTruck}\""; + using (var insertCommand = _sqLiteConnection.CreateCommand()) + { + insertCommand.CommandText = query; + insertCommand.ExecuteNonQuery(); + } - using (var deleteCommand = _sqLiteConnection.CreateCommand()) - { - deleteCommand.CommandText = query; - deleteCommand.ExecuteNonQuery(); - } - } - } + query = + $"DELETE FROM ApplicantList Where RegistrationNumberTruck=\"{applicants[i].RegistrationNumberTruck}\""; - public static int BoolToInt(this bool value) => value ? 1 : 0; - } + using (var deleteCommand = _sqLiteConnection.CreateCommand()) + { + deleteCommand.CommandText = query; + deleteCommand.ExecuteNonQuery(); + } + } + } + + public static Settings LoadSettings() + { + var settings = new Settings(); + + var query = + "SELECT * FROM(SELECT * From Settings Where (SettingName, SettingDate) in (Select SettingName, MAX(SettingDate) as SettingDate From Settings Group by SettingName) Order by SettingDate desc) t Group By t.SettingName"; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; + + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + var name = reader["SettingName"].ToString(); + var value = reader["SettingValue"].ToString(); + var date = reader["SettingDate"].ToString(); + long longValue; + switch (name) + { + case "UsageFee": + long.TryParse(value, out longValue); + settings.UsageFee = longValue; + break; + case "ExtendedFee": + + long.TryParse(value, out longValue); + settings.ExtendedFee = longValue; + break; + case "CertificateFee": + long.TryParse(value, out longValue); + settings.CertificateFee = longValue; + break; + case "ReCertificateFee": + long.TryParse(value, out longValue); + settings.ReCertificateFee = longValue; + break; + } + } + } + } + + return settings; + // 셋팅 네임/ 세팅 벨류 셋팅 데이트 + } + + public static void SaveSettings(Settings settings) + { + var originalSettings = LoadSettings(); + + if (settings.UsageFee != originalSettings.UsageFee) + { + var query = + $"INSERT INTO Settings VALUES('UsageFee','{settings.UsageFee}','{DateTime.Now.ToString()}') "; + using (var insertCommand = _sqLiteConnection.CreateCommand()) + { + insertCommand.CommandText = query; + insertCommand.ExecuteNonQuery(); + } + } + + if (settings.ExtendedFee != originalSettings.ExtendedFee) + { + var query = + $"INSERT INTO Settings VALUES('ExtendedFee','{settings.ExtendedFee}','{DateTime.Now.ToString()}') "; + using (var insertCommand = _sqLiteConnection.CreateCommand()) + { + insertCommand.CommandText = query; + insertCommand.ExecuteNonQuery(); + } + } + + if (settings.CertificateFee != originalSettings.CertificateFee) + { + var query = + $"INSERT INTO Settings VALUES('CertificateFee','{settings.CertificateFee}','{DateTime.Now.ToString()}') "; + using (var insertCommand = _sqLiteConnection.CreateCommand()) + { + insertCommand.CommandText = query; + insertCommand.ExecuteNonQuery(); + } + } + + if (settings.ReCertificateFee != originalSettings.ReCertificateFee) + { + var query = + $"INSERT INTO Settings VALUES('ReCertificateFee','{settings.ReCertificateFee}','{DateTime.Now.ToString()}') "; + using (var insertCommand = _sqLiteConnection.CreateCommand()) + { + insertCommand.CommandText = query; + insertCommand.ExecuteNonQuery(); + } + } + } + + public static int BoolToInt(this bool value) + { + return value ? 1 : 0; + } + } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/ExcelWrapper.cs b/HSUCO_Cargo_Garage_Operation_Program/ExcelWrapper.cs index 1bbfc0d..f44c012 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/ExcelWrapper.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/ExcelWrapper.cs @@ -1,15 +1,17 @@ using Microsoft.Office.Interop.Excel; using System; using System.Data; +using System.Diagnostics; using System.Windows.Forms; + namespace HSUCO_Cargo_Garage_Operation_Program { internal class ExcelWrapper { - + public bool WriteDataTableToExcel - (System.Data.DataTable dataTable, string worksheetName, string saveAsLocation) + (System.Data.DataTable dataTable, string worksheetName, string saveAsLocation, string title, string writer, DateTime dateCreated) { Microsoft.Office.Interop.Excel.Application excel; Microsoft.Office.Interop.Excel.Workbook excelworkBook; @@ -30,18 +32,57 @@ namespace HSUCO_Cargo_Garage_Operation_Program excelSheet = (Microsoft.Office.Interop.Excel.Worksheet)excelworkBook.ActiveSheet; excelSheet.Name = worksheetName; + if (dataTable == null) + { + return false; + } var rowCount = 1; // 타이틀 + excelSheet.Cells[rowCount, 1] = title; + Range range = excelSheet.Range[excelSheet.Cells[rowCount, 1], excelSheet.Cells[rowCount, dataTable.Columns.Count]]; + range.Merge(); + range.Font.Size = 20; + range.Font.Bold = true; + range.HorizontalAlignment = XlHAlign.xlHAlignCenter; + range.Borders.LineStyle = XlLineStyle.xlDouble; + + rowCount += 2; + // 작성자 + range = excelSheet.Range[excelSheet.Cells[rowCount, dataTable.Columns.Count - 2], excelSheet.Cells[rowCount, dataTable.Columns.Count - 2]]; + range.Merge(); + range.Value = "작성자 : "; + range.HorizontalAlignment = 4; + range.Borders.LineStyle = XlLineStyle.xlContinuous; + + range = excelSheet.Range[excelSheet.Cells[rowCount, dataTable.Columns.Count - 1], excelSheet.Cells[rowCount, dataTable.Columns.Count]]; + range.Merge(); + range.Value = writer; + range.HorizontalAlignment = 1; + range.Borders.LineStyle = XlLineStyle.xlContinuous; + + // 데이트 + rowCount++; + + range = excelSheet.Range[excelSheet.Cells[rowCount, dataTable.Columns.Count - 2], excelSheet.Cells[rowCount, dataTable.Columns.Count - 2]]; + range.Merge(); + range.Value = "작성일 : "; + range.HorizontalAlignment = 4; + range.Borders.LineStyle = XlLineStyle.xlContinuous; + range = excelSheet.Range[excelSheet.Cells[rowCount, dataTable.Columns.Count - 1], excelSheet.Cells[rowCount, dataTable.Columns.Count]]; + range.Merge(); + range.Value = dateCreated.ToString("yyyy-MM-dd HH:mm:ss"); + range.HorizontalAlignment = 1; + range.Borders.LineStyle = XlLineStyle.xlContinuous; + + + rowCount += 2; + int startRow = rowCount; + + // 실제 데이터 삽입 for (int i = 0; i < dataTable.Columns.Count; i++) { excelSheet.Cells[rowCount, i + 1] = dataTable.Columns[i].ColumnName; } - excelCellrange = excelSheet.Range[excelSheet.Cells[1, 1], excelSheet.Cells[1, dataTable.Columns.Count]]; - excelCellrange.HorizontalAlignment = XlHAlign.xlHAlignCenter; - excelCellrange.Borders.LineStyle = XlLineStyle.xlContinuous; - - - foreach (DataRow datarow in dataTable.Rows) { @@ -52,9 +93,10 @@ namespace HSUCO_Cargo_Garage_Operation_Program excelSheet.Cells[rowCount, i] = datarow[i - 1].ToString(); } } - excelCellrange = excelSheet.Range[excelSheet.Cells[1, 1], excelSheet.Cells[rowCount, dataTable.Columns.Count]]; + excelCellrange = excelSheet.Range[excelSheet.Cells[startRow, 1], excelSheet.Cells[rowCount, dataTable.Columns.Count]]; excelCellrange.Columns.AutoFit(); - + excelCellrange.HorizontalAlignment = XlHAlign.xlHAlignCenter; + excelCellrange.Borders.LineStyle = XlLineStyle.xlContinuous; // now save the workbook and exit Excel excelworkBook.SaveAs(saveAsLocation); excelworkBook.Close(); @@ -73,5 +115,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program excelworkBook = null; } } + } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/Global.cs b/HSUCO_Cargo_Garage_Operation_Program/Global.cs new file mode 100644 index 0000000..672ec58 --- /dev/null +++ b/HSUCO_Cargo_Garage_Operation_Program/Global.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HSUCO_Cargo_Garage_Operation_Program +{ + public static class Global + { + public static Settings GlobalSettings { get; set; } + + } +} 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 dc3bc73..6a50906 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 @@ -59,6 +59,8 @@ ..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll True + + @@ -71,6 +73,7 @@ ..\packages\System.Data.SQLite.Linq.1.0.117.0\lib\net46\System.Data.SQLite.Linq.dll + @@ -80,6 +83,7 @@ + @@ -112,6 +116,24 @@ ApplicantControl.cs + + UserControl + + + ListCertificate.cs + + + UserControl + + + ListProceeds.cs + + + UserControl + + + SettingControl.cs + UserControl @@ -133,6 +155,7 @@ + Form @@ -156,6 +179,9 @@ ApplicantControl.cs + + SettingControl.cs + UserList.cs diff --git a/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs index 83c290b..4baec31 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs @@ -39,13 +39,11 @@ this.tabPage7 = new System.Windows.Forms.TabPage(); this.waitingList1 = new HSUCO_Cargo_Garage_Operation_Program.CustomUserControl.WaitingList(); this.tabPage8 = new System.Windows.Forms.TabPage(); - this.tabPage_Certificate = new System.Windows.Forms.TabPage(); - this.metroTabControl_Certificate = new MetroFramework.Controls.MetroTabControl(); - this.tabPage3 = new System.Windows.Forms.TabPage(); - this.tabPage4 = new System.Windows.Forms.TabPage(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.metroTabControl2 = new MetroFramework.Controls.MetroTabControl(); this.userList1 = new HSUCO_Cargo_Garage_Operation_Program.CustomUserControl.UserList(); + this.tabPage9 = new System.Windows.Forms.TabPage(); + this.tabPage10 = new System.Windows.Forms.TabPage(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.settings1 = new HSUCO_Cargo_Garage_Operation_Program.CustomUserControl.SettingControl(); this.metroTabControl_Main.SuspendLayout(); this.tabPage1.SuspendLayout(); this.metroTabControl_Applicant.SuspendLayout(); @@ -53,15 +51,12 @@ this.tabPage6.SuspendLayout(); this.tabPage7.SuspendLayout(); this.tabPage8.SuspendLayout(); - this.tabPage_Certificate.SuspendLayout(); - this.metroTabControl_Certificate.SuspendLayout(); this.tabPage2.SuspendLayout(); this.SuspendLayout(); // // metroTabControl_Main // this.metroTabControl_Main.Controls.Add(this.tabPage1); - this.metroTabControl_Main.Controls.Add(this.tabPage_Certificate); this.metroTabControl_Main.Controls.Add(this.tabPage2); this.metroTabControl_Main.Dock = System.Windows.Forms.DockStyle.Fill; this.metroTabControl_Main.Location = new System.Drawing.Point(20, 60); @@ -70,6 +65,7 @@ this.metroTabControl_Main.Size = new System.Drawing.Size(984, 688); this.metroTabControl_Main.TabIndex = 0; this.metroTabControl_Main.UseSelectable = true; + this.metroTabControl_Main.SelectedIndexChanged += new System.EventHandler(this.metroTabControl_Main_SelectedIndexChanged); // // tabPage1 // @@ -86,10 +82,12 @@ this.metroTabControl_Applicant.Controls.Add(this.tabPage6); this.metroTabControl_Applicant.Controls.Add(this.tabPage7); this.metroTabControl_Applicant.Controls.Add(this.tabPage8); + this.metroTabControl_Applicant.Controls.Add(this.tabPage9); + this.metroTabControl_Applicant.Controls.Add(this.tabPage10); this.metroTabControl_Applicant.Dock = System.Windows.Forms.DockStyle.Fill; this.metroTabControl_Applicant.Location = new System.Drawing.Point(0, 0); this.metroTabControl_Applicant.Name = "metroTabControl_Applicant"; - this.metroTabControl_Applicant.SelectedIndex = 1; + this.metroTabControl_Applicant.SelectedIndex = 0; this.metroTabControl_Applicant.Size = new System.Drawing.Size(976, 646); this.metroTabControl_Applicant.TabIndex = 0; this.metroTabControl_Applicant.UseSelectable = true; @@ -156,60 +154,6 @@ this.tabPage8.TabIndex = 3; this.tabPage8.Text = "이용자 리스트"; // - // tabPage_Certificate - // - this.tabPage_Certificate.Controls.Add(this.metroTabControl_Certificate); - this.tabPage_Certificate.Location = new System.Drawing.Point(4, 38); - this.tabPage_Certificate.Name = "tabPage_Certificate"; - this.tabPage_Certificate.Size = new System.Drawing.Size(976, 646); - this.tabPage_Certificate.TabIndex = 2; - this.tabPage_Certificate.Text = "증명서 관리"; - // - // metroTabControl_Certificate - // - this.metroTabControl_Certificate.Controls.Add(this.tabPage3); - this.metroTabControl_Certificate.Controls.Add(this.tabPage4); - this.metroTabControl_Certificate.Dock = System.Windows.Forms.DockStyle.Fill; - this.metroTabControl_Certificate.Location = new System.Drawing.Point(0, 0); - this.metroTabControl_Certificate.Name = "metroTabControl_Certificate"; - this.metroTabControl_Certificate.SelectedIndex = 0; - this.metroTabControl_Certificate.Size = new System.Drawing.Size(976, 646); - this.metroTabControl_Certificate.TabIndex = 1; - this.metroTabControl_Certificate.UseSelectable = true; - // - // tabPage3 - // - this.tabPage3.Location = new System.Drawing.Point(4, 38); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.Size = new System.Drawing.Size(968, 604); - this.tabPage3.TabIndex = 0; - this.tabPage3.Text = "증명서 발급"; - // - // tabPage4 - // - this.tabPage4.Location = new System.Drawing.Point(4, 38); - this.tabPage4.Name = "tabPage4"; - this.tabPage4.Size = new System.Drawing.Size(968, 604); - this.tabPage4.TabIndex = 1; - this.tabPage4.Text = "발급리스트"; - // - // tabPage2 - // - this.tabPage2.Controls.Add(this.metroTabControl2); - this.tabPage2.Location = new System.Drawing.Point(4, 38); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Size = new System.Drawing.Size(976, 646); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "설정"; - // - // metroTabControl2 - // - this.metroTabControl2.Location = new System.Drawing.Point(388, 273); - this.metroTabControl2.Name = "metroTabControl2"; - this.metroTabControl2.Size = new System.Drawing.Size(200, 100); - this.metroTabControl2.TabIndex = 1; - this.metroTabControl2.UseSelectable = true; - // // userList1 // this.userList1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -218,6 +162,39 @@ this.userList1.Size = new System.Drawing.Size(968, 604); this.userList1.TabIndex = 0; // + // tabPage9 + // + this.tabPage9.Location = new System.Drawing.Point(4, 38); + this.tabPage9.Name = "tabPage9"; + this.tabPage9.Size = new System.Drawing.Size(968, 604); + this.tabPage9.TabIndex = 4; + this.tabPage9.Text = "수익금 대장"; + // + // tabPage10 + // + this.tabPage10.Location = new System.Drawing.Point(4, 38); + this.tabPage10.Name = "tabPage10"; + this.tabPage10.Size = new System.Drawing.Size(968, 604); + this.tabPage10.TabIndex = 5; + this.tabPage10.Text = "증명서발급 대장"; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.settings1); + this.tabPage2.Location = new System.Drawing.Point(4, 38); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Size = new System.Drawing.Size(976, 646); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "설정"; + // + // settings1 + // + this.settings1.Dock = System.Windows.Forms.DockStyle.Fill; + this.settings1.Location = new System.Drawing.Point(0, 0); + this.settings1.Name = "settings1"; + this.settings1.Size = new System.Drawing.Size(976, 646); + this.settings1.TabIndex = 0; + // // Master // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -227,6 +204,7 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Master"; this.Text = "화성도시공사 화물차고지 운영 프로그램"; + this.Load += new System.EventHandler(this.Master_Load); this.metroTabControl_Main.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.metroTabControl_Applicant.ResumeLayout(false); @@ -234,8 +212,6 @@ this.tabPage6.ResumeLayout(false); this.tabPage7.ResumeLayout(false); this.tabPage8.ResumeLayout(false); - this.tabPage_Certificate.ResumeLayout(false); - this.metroTabControl_Certificate.ResumeLayout(false); this.tabPage2.ResumeLayout(false); this.ResumeLayout(false); @@ -246,12 +222,7 @@ private MetroFramework.Controls.MetroTabControl metroTabControl_Main; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.TabPage tabPage_Certificate; private MetroFramework.Controls.MetroTabControl metroTabControl_Applicant; - private MetroFramework.Controls.MetroTabControl metroTabControl2; - private MetroFramework.Controls.MetroTabControl metroTabControl_Certificate; - private System.Windows.Forms.TabPage tabPage3; - private System.Windows.Forms.TabPage tabPage4; private System.Windows.Forms.TabPage tabPage5; private System.Windows.Forms.TabPage tabPage6; private System.Windows.Forms.TabPage tabPage7; @@ -260,6 +231,10 @@ private CustomUserControl.ApplicantList applicantList1; private CustomUserControl.WaitingList waitingList1; private CustomUserControl.UserList userList1; + private MetroFramework.Controls.MetroButton metroButton1; + private System.Windows.Forms.TabPage tabPage9; + private System.Windows.Forms.TabPage tabPage10; + private CustomUserControl.SettingControl settings1; } } diff --git a/HSUCO_Cargo_Garage_Operation_Program/Master.cs b/HSUCO_Cargo_Garage_Operation_Program/Master.cs index 7034abf..88d89f2 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Master.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Master.cs @@ -4,7 +4,22 @@ namespace HSUCO_Cargo_Garage_Operation_Program { public partial class Master : MetroFramework.Forms.MetroForm { + public Master() => InitializeComponent(); + private void metroTabControl_Main_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + private void Master_Load(object sender, EventArgs e) + { + Global.GlobalSettings = Database.LoadSettings(); + settings1.SettingReset(); + + + } + + } } \ No newline at end of file diff --git a/database.sqlite b/database.sqlite deleted file mode 100644 index e69de29..0000000