증명서 증명일 추가
This commit is contained in:
@@ -92,6 +92,7 @@
|
||||
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);
|
||||
//
|
||||
// Promotion
|
||||
//
|
||||
|
@@ -8,10 +8,12 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
|
||||
{
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public Promotion(string title)
|
||||
public Promotion(string title, string startName, string endName)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = title;
|
||||
metroLabel1.Text = startName;
|
||||
metroLabel2.Text = endName;
|
||||
}
|
||||
|
||||
void metroButton_Promotion_Click(object sender, EventArgs e)
|
||||
|
@@ -138,7 +138,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||
private void metroButton_UpdateUser_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Promotion promotion = new Promotion("추첨자 이용기간");
|
||||
Promotion promotion = new Promotion("추첨자 이용기간", "이용 시작일" , "이용 종료일");
|
||||
DialogResult dialogResult = promotion.ShowDialog();
|
||||
if (dialogResult != DialogResult.OK)
|
||||
{
|
||||
|
@@ -495,7 +495,7 @@
|
||||
this.Controls.Add(this.metroButton_Save);
|
||||
this.Name = "SettingControl";
|
||||
this.Size = new System.Drawing.Size(346, 505);
|
||||
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Settings_Paint);
|
||||
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
|
@@ -28,12 +28,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||
|
||||
}
|
||||
|
||||
private void Settings_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
SettingReset();
|
||||
|
||||
}
|
||||
|
||||
private void metroButton_Save_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool reStart = false;
|
||||
|
@@ -7,6 +7,7 @@ using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||
{
|
||||
@@ -403,7 +404,22 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||
|
||||
string no = dataGridView_List.SelectedRows[0].Cells[0].Value.ToString();
|
||||
CertificateInformation certificateInformation = Database.GetUserCertificate(no);
|
||||
|
||||
Promotion promotion = new Promotion("증명서 인증 기간", "증명 시작일", "증명 종료일");
|
||||
DialogResult promotionDialogResult = promotion.ShowDialog();
|
||||
if (promotionDialogResult != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if( promotion.StartDate < certificateInformation.StartDate)
|
||||
{
|
||||
MetroMessageBox.Show(this, "인증 시작일이 이용일 보다 먼저 일수 없습니다.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
if( promotion.EndDate > certificateInformation.EndDate)
|
||||
{
|
||||
MetroMessageBox.Show(this, "인증 종료일이 이용일 보다 나중일수 없습니다.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
certificateInformation.IssueDate = nowDateTime;
|
||||
|
||||
int lastNo = Database.GetLastCertificate(nowDateTime.Year);
|
||||
@@ -414,27 +430,24 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||
setCertificateInformation.No = certificateInformation.IssueNumber;
|
||||
setCertificateInformation.UserNo = no;
|
||||
setCertificateInformation.IssueDate = certificateInformation.IssueDate;
|
||||
setCertificateInformation.StartDate = certificateInformation.StartDate;
|
||||
setCertificateInformation.EndDate = certificateInformation.EndDate;
|
||||
setCertificateInformation.StartDate = promotion.StartDate;
|
||||
setCertificateInformation.EndDate = promotion.EndDate;
|
||||
setCertificateInformation.Amount = certificateInformation.Amount;
|
||||
|
||||
|
||||
// 증명서 발급 요금 계산
|
||||
EVehicleType eVehicleType = Database.GetVehicleType(setCertificateInformation.UserNo);
|
||||
int payBase = eVehicleType == EVehicleType.Large ? Global.GlobalSettings.CargoLargeCertificateFee : Global.GlobalSettings.CargoOversizedCertificateFee;
|
||||
int month = Extends.GetProgressDays(promotion.StartDate, promotion.EndDate).Month;
|
||||
int pay = month * payBase;
|
||||
|
||||
SetProceedsInfo setProceedsInfo = new SetProceedsInfo();
|
||||
setProceedsInfo.No = setCertificateInformation.UserNo;
|
||||
setProceedsInfo.Date = nowDateTime;
|
||||
setProceedsInfo.Type = EProceedsType.Certificate;
|
||||
setProceedsInfo.Amount = pay;
|
||||
|
||||
EVehicleType eVehicleType = Database.GetVehicleType(setCertificateInformation.UserNo);
|
||||
switch (eVehicleType)
|
||||
{
|
||||
case EVehicleType.Large:
|
||||
setProceedsInfo.Amount = Global.GlobalSettings.CargoLargeCertificateFee;
|
||||
break;
|
||||
|
||||
case EVehicleType.Oversized:
|
||||
setProceedsInfo.Amount = Global.GlobalSettings.CargoOversizedFee;
|
||||
break;
|
||||
}
|
||||
string amount = string.Format("{0:N0} 원", setProceedsInfo.Amount);
|
||||
var dialogResult = MetroMessageBox.Show(this, $"증명서 발급요금이 {amount} 발생했습니다. 발급하시겠습니까?", "Question", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
|
||||
if (dialogResult == DialogResult.OK)
|
||||
|
@@ -144,7 +144,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||
var count = dataGridView_List.Rows.Count;
|
||||
if (count == 0) return;
|
||||
|
||||
Promotion promotion = new Promotion("대기자 이용기간");
|
||||
Promotion promotion = new Promotion("대기자 이용기간", "이용 시작일", "이용 종료일");
|
||||
DialogResult dialogResult = promotion.ShowDialog();
|
||||
if (dialogResult != DialogResult.OK)
|
||||
{
|
||||
|
Reference in New Issue
Block a user