From 4e7228b7b22aacafddeeb9504894a2e7983c8c3b Mon Sep 17 00:00:00 2001 From: Crudelis Date: Thu, 26 Oct 2023 23:28:41 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B8=EC=A6=9D=EC=84=9C=20=EC=9D=BC?= =?UTF-8?q?=EC=9E=90=20=EC=84=A0=ED=83=9D=EC=8B=9C=20=EC=9D=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=8B=9C=EC=9E=91=EC=9D=BC,=20=EC=A2=85=EB=A3=8C=EC=9D=BC=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomForm/Promotion.cs | 29 +++++++++++++------ .../CustomUserControl/SettingControl.cs | 2 -- .../CustomUserControl/UserList.cs | 2 +- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs index 2300959..2122b49 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/Promotion.cs @@ -8,32 +8,44 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm { public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } + public Promotion(string title, string startName, string endName) { InitializeComponent(); this.Text = title; metroLabel1.Text = startName; metroLabel2.Text = endName; + var year = DateTime.Now.Year + 1; + metroDateTime_Start.Value = DateTime.Parse(year + "-01-01"); + metroDateTime_End.Value = DateTime.Parse(year + "-12-31"); } - void metroButton_Promotion_Click(object sender, EventArgs e) + public Promotion(string title, string startName, string endName, DateTime startDateTime, DateTime endDateTime) + { + InitializeComponent(); + this.Text = title; + metroLabel1.Text = startName; + metroLabel2.Text = endName; + metroDateTime_Start.Value = startDateTime; + metroDateTime_End.Value = endDateTime; + } + + private void metroButton_Promotion_Click(object sender, EventArgs e) { StartDate = metroDateTime_Start.Value; EndDate = metroDateTime_End.Value; - + DialogResult = DialogResult.OK; } - void metroButton_Cancel_Click(object sender, EventArgs e) + private void metroButton_Cancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; } - void Promotion_Load(object sender, EventArgs e) + private void Promotion_Load(object sender, EventArgs e) { - var year = DateTime.Now.Year + 1; - 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) @@ -42,7 +54,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm { metroDateTime_Start.Value = new DateTime(metroDateTime_Start.Value.Year, metroDateTime_Start.Value.Month, 1); } - if(metroDateTime_Start.Value.Year > metroDateTime_End.Value.Year) + if (metroDateTime_Start.Value.Year > metroDateTime_End.Value.Year) { metroDateTime_End.Value = new DateTime(metroDateTime_Start.Value.Year, metroDateTime_Start.Value.Month, DateTime.DaysInMonth(metroDateTime_Start.Value.Year, metroDateTime_Start.Value.Month)); } @@ -51,7 +63,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm { metroDateTime_End.Value = new DateTime(metroDateTime_End.Value.Year, metroDateTime_End.Value.Month, lastDay); } - } } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs index 443e969..a0e2b54 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs @@ -120,7 +120,5 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl } timer.Stop(); } - - } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs index 86233aa..dc2da30 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/UserList.cs @@ -432,7 +432,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl if (result == DialogResult.No) return; CertificateInformation certificateInformation = Database.GetUserCertificate(no); - Promotion promotion = new Promotion("증명서 인증 기간", "증명 시작일", "증명 종료일"); + Promotion promotion = new Promotion("증명서 인증 기간", "증명 시작일", "증명 종료일", certificateInformation.StartDate, certificateInformation.EndDate); DialogResult promotionDialogResult = promotion.ShowDialog(); if (promotionDialogResult != DialogResult.OK) {