인증서 일자 선택시 이용 시작일, 종료일 기능 추가

This commit is contained in:
2023-10-26 23:28:41 +09:00
parent c93c4043e3
commit 4e7228b7b2
3 changed files with 21 additions and 12 deletions

View File

@@ -8,15 +8,29 @@ 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;
@@ -24,16 +38,14 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
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)
@@ -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);
}
}
}
}

View File

@@ -120,7 +120,5 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
}
timer.Stop();
}
}
}

View File

@@ -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)
{