인증서 일자 선택시 이용 시작일, 종료일 기능 추가
This commit is contained in:
@@ -8,15 +8,29 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
|
|||||||
{
|
{
|
||||||
public DateTime StartDate { get; set; }
|
public DateTime StartDate { get; set; }
|
||||||
public DateTime EndDate { get; set; }
|
public DateTime EndDate { get; set; }
|
||||||
|
|
||||||
public Promotion(string title, string startName, string endName)
|
public Promotion(string title, string startName, string endName)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Text = title;
|
this.Text = title;
|
||||||
metroLabel1.Text = startName;
|
metroLabel1.Text = startName;
|
||||||
metroLabel2.Text = endName;
|
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;
|
StartDate = metroDateTime_Start.Value;
|
||||||
EndDate = metroDateTime_End.Value;
|
EndDate = metroDateTime_End.Value;
|
||||||
@@ -24,16 +38,14 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
|
|||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void metroButton_Cancel_Click(object sender, EventArgs e)
|
private void metroButton_Cancel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DialogResult = DialogResult.Cancel;
|
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)
|
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);
|
metroDateTime_End.Value = new DateTime(metroDateTime_End.Value.Year, metroDateTime_End.Value.Month, lastDay);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -120,7 +120,5 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
}
|
}
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -432,7 +432,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
if (result == DialogResult.No) return;
|
if (result == DialogResult.No) return;
|
||||||
|
|
||||||
CertificateInformation certificateInformation = Database.GetUserCertificate(no);
|
CertificateInformation certificateInformation = Database.GetUserCertificate(no);
|
||||||
Promotion promotion = new Promotion("증명서 인증 기간", "증명 시작일", "증명 종료일");
|
Promotion promotion = new Promotion("증명서 인증 기간", "증명 시작일", "증명 종료일", certificateInformation.StartDate, certificateInformation.EndDate);
|
||||||
DialogResult promotionDialogResult = promotion.ShowDialog();
|
DialogResult promotionDialogResult = promotion.ShowDialog();
|
||||||
if (promotionDialogResult != DialogResult.OK)
|
if (promotionDialogResult != DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user