인증서 부분 완료
인증서 부분 완료
This commit is contained in:
@@ -28,9 +28,8 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
this.dataGridView_List = new System.Windows.Forms.DataGridView();
|
this.dataGridView_List = new System.Windows.Forms.DataGridView();
|
||||||
this.metroButton_ReCertificate = new MetroFramework.Controls.MetroButton();
|
|
||||||
this.metroButton_ExportExcel = new MetroFramework.Controls.MetroButton();
|
this.metroButton_ExportExcel = new MetroFramework.Controls.MetroButton();
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
this.metroDateTime_EndDate = new MetroFramework.Controls.MetroDateTime();
|
this.metroDateTime_EndDate = new MetroFramework.Controls.MetroDateTime();
|
||||||
@@ -38,6 +37,7 @@
|
|||||||
this.metroButton_Search = new MetroFramework.Controls.MetroButton();
|
this.metroButton_Search = new MetroFramework.Controls.MetroButton();
|
||||||
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
|
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
|
||||||
this.metroLabel1 = new MetroFramework.Controls.MetroLabel();
|
this.metroLabel1 = new MetroFramework.Controls.MetroLabel();
|
||||||
|
this.metroButton_RePrint = new MetroFramework.Controls.MetroButton();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView_List)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView_List)).BeginInit();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@@ -49,14 +49,14 @@
|
|||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.dataGridView_List.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
this.dataGridView_List.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||||
this.dataGridView_List.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
this.dataGridView_List.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
|
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||||
dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||||
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
|
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||||
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||||
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||||
this.dataGridView_List.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
|
this.dataGridView_List.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||||
this.dataGridView_List.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.dataGridView_List.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dataGridView_List.Location = new System.Drawing.Point(20, 120);
|
this.dataGridView_List.Location = new System.Drawing.Point(20, 120);
|
||||||
this.dataGridView_List.Name = "dataGridView_List";
|
this.dataGridView_List.Name = "dataGridView_List";
|
||||||
@@ -66,25 +66,13 @@
|
|||||||
this.dataGridView_List.Size = new System.Drawing.Size(600, 330);
|
this.dataGridView_List.Size = new System.Drawing.Size(600, 330);
|
||||||
this.dataGridView_List.TabIndex = 11;
|
this.dataGridView_List.TabIndex = 11;
|
||||||
//
|
//
|
||||||
// metroButton_ReCertificate
|
|
||||||
//
|
|
||||||
this.metroButton_ReCertificate.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
|
||||||
this.metroButton_ReCertificate.FontSize = MetroFramework.MetroButtonSize.Tall;
|
|
||||||
this.metroButton_ReCertificate.Location = new System.Drawing.Point(626, 138);
|
|
||||||
this.metroButton_ReCertificate.Name = "metroButton_ReCertificate";
|
|
||||||
this.metroButton_ReCertificate.Size = new System.Drawing.Size(121, 40);
|
|
||||||
this.metroButton_ReCertificate.TabIndex = 12;
|
|
||||||
this.metroButton_ReCertificate.Text = "재 발급";
|
|
||||||
this.metroButton_ReCertificate.UseSelectable = true;
|
|
||||||
this.metroButton_ReCertificate.Click += new System.EventHandler(this.metroButton_ReCertificate_Click);
|
|
||||||
//
|
|
||||||
// metroButton_ExportExcel
|
// metroButton_ExportExcel
|
||||||
//
|
//
|
||||||
this.metroButton_ExportExcel.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
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.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.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||||
this.metroButton_ExportExcel.FontSize = MetroFramework.MetroButtonSize.Tall;
|
this.metroButton_ExportExcel.FontSize = MetroFramework.MetroButtonSize.Tall;
|
||||||
this.metroButton_ExportExcel.Location = new System.Drawing.Point(626, 184);
|
this.metroButton_ExportExcel.Location = new System.Drawing.Point(626, 228);
|
||||||
this.metroButton_ExportExcel.Name = "metroButton_ExportExcel";
|
this.metroButton_ExportExcel.Name = "metroButton_ExportExcel";
|
||||||
this.metroButton_ExportExcel.Size = new System.Drawing.Size(121, 115);
|
this.metroButton_ExportExcel.Size = new System.Drawing.Size(121, 115);
|
||||||
this.metroButton_ExportExcel.TabIndex = 13;
|
this.metroButton_ExportExcel.TabIndex = 13;
|
||||||
@@ -151,14 +139,26 @@
|
|||||||
this.metroLabel1.TabIndex = 0;
|
this.metroLabel1.TabIndex = 0;
|
||||||
this.metroLabel1.Text = "검색 시작일";
|
this.metroLabel1.Text = "검색 시작일";
|
||||||
//
|
//
|
||||||
|
// metroButton_RePrint
|
||||||
|
//
|
||||||
|
this.metroButton_RePrint.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
this.metroButton_RePrint.FontSize = MetroFramework.MetroButtonSize.Tall;
|
||||||
|
this.metroButton_RePrint.Location = new System.Drawing.Point(626, 136);
|
||||||
|
this.metroButton_RePrint.Name = "metroButton_RePrint";
|
||||||
|
this.metroButton_RePrint.Size = new System.Drawing.Size(121, 40);
|
||||||
|
this.metroButton_RePrint.TabIndex = 15;
|
||||||
|
this.metroButton_RePrint.Text = "재 인쇄";
|
||||||
|
this.metroButton_RePrint.UseSelectable = true;
|
||||||
|
this.metroButton_RePrint.Click += new System.EventHandler(this.metroButton_RePrint_Click);
|
||||||
|
//
|
||||||
// ListCertificate
|
// ListCertificate
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.BackColor = System.Drawing.Color.White;
|
this.BackColor = System.Drawing.Color.White;
|
||||||
|
this.Controls.Add(this.metroButton_RePrint);
|
||||||
this.Controls.Add(this.groupBox1);
|
this.Controls.Add(this.groupBox1);
|
||||||
this.Controls.Add(this.metroButton_ExportExcel);
|
this.Controls.Add(this.metroButton_ExportExcel);
|
||||||
this.Controls.Add(this.metroButton_ReCertificate);
|
|
||||||
this.Controls.Add(this.dataGridView_List);
|
this.Controls.Add(this.dataGridView_List);
|
||||||
this.Name = "ListCertificate";
|
this.Name = "ListCertificate";
|
||||||
this.Size = new System.Drawing.Size(750, 470);
|
this.Size = new System.Drawing.Size(750, 470);
|
||||||
@@ -171,7 +171,6 @@
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
private System.Windows.Forms.DataGridView dataGridView_List;
|
private System.Windows.Forms.DataGridView dataGridView_List;
|
||||||
private MetroFramework.Controls.MetroButton metroButton_ReCertificate;
|
|
||||||
private MetroFramework.Controls.MetroButton metroButton_ExportExcel;
|
private MetroFramework.Controls.MetroButton metroButton_ExportExcel;
|
||||||
private System.Windows.Forms.GroupBox groupBox1;
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
private MetroFramework.Controls.MetroDateTime metroDateTime_EndDate;
|
private MetroFramework.Controls.MetroDateTime metroDateTime_EndDate;
|
||||||
@@ -179,5 +178,6 @@
|
|||||||
private MetroFramework.Controls.MetroButton metroButton_Search;
|
private MetroFramework.Controls.MetroButton metroButton_Search;
|
||||||
private MetroFramework.Controls.MetroLabel metroLabel2;
|
private MetroFramework.Controls.MetroLabel metroLabel2;
|
||||||
private MetroFramework.Controls.MetroLabel metroLabel1;
|
private MetroFramework.Controls.MetroLabel metroLabel1;
|
||||||
|
private MetroFramework.Controls.MetroButton metroButton_RePrint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,15 @@
|
|||||||
using System;
|
using MetroFramework;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Drawing.Printing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using HSUCO_Cargo_Garage_Operation_Program.Properties;
|
||||||
|
|
||||||
namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||||
{
|
{
|
||||||
@@ -44,23 +47,31 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
List<CertificateData> certificateDatas = Database.GetLedgerCertificate(metroDateTime_StartDate.Value, metroDateTime_EndDate.Value);
|
List<CertificateData> certificateDatas = Database.GetLedgerCertificate(metroDateTime_StartDate.Value, metroDateTime_EndDate.Value);
|
||||||
|
|
||||||
var dataTable = new DataTable();
|
var dataTable = new DataTable();
|
||||||
|
dataTable.Columns.Add("발급번호");
|
||||||
|
dataTable.Columns.Add("발급일자");
|
||||||
dataTable.Columns.Add("차량번호(화물)");
|
dataTable.Columns.Add("차량번호(화물)");
|
||||||
dataTable.Columns.Add("차량번호(승용)");
|
dataTable.Columns.Add("차량번호(승용)");
|
||||||
dataTable.Columns.Add("이름");
|
dataTable.Columns.Add("이름");
|
||||||
dataTable.Columns.Add("발급번호");
|
|
||||||
dataTable.Columns.Add("발급일자");
|
|
||||||
|
dataTable.Columns.Add("증명일자 시작일");
|
||||||
|
dataTable.Columns.Add("발급일자 종료일");
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < certificateDatas.Count; i++)
|
for (int i = 0; i < certificateDatas.Count; i++)
|
||||||
{
|
{
|
||||||
dataTable.Rows
|
dataTable.Rows
|
||||||
.Add(
|
.Add(
|
||||||
|
|
||||||
|
certificateDatas[i].IssueNumber,
|
||||||
|
certificateDatas[i].IssueDate,
|
||||||
certificateDatas[i].RegistrationNumberTruck,
|
certificateDatas[i].RegistrationNumberTruck,
|
||||||
certificateDatas[i].RegistrationNumberPassenger,
|
certificateDatas[i].RegistrationNumberPassenger,
|
||||||
certificateDatas[i].Name,
|
certificateDatas[i].Name,
|
||||||
certificateDatas[i].IssueNumber,
|
|
||||||
certificateDatas[i].Date
|
|
||||||
|
certificateDatas[i].StartDate,
|
||||||
|
certificateDatas[i].EndDate
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -77,5 +88,31 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
dataGridView_List.Columns[2].MinimumWidth = 60;
|
dataGridView_List.Columns[2].MinimumWidth = 60;
|
||||||
dataGridView_List.Columns[2].FillWeight = 60;
|
dataGridView_List.Columns[2].FillWeight = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void metroButton_RePrint_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int count = dataGridView_List.SelectedRows.Count;
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
MetroMessageBox.Show(this, "선택된 이용자가 없습니다.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string issueNumber = dataGridView_List.SelectedRows[0].Cells[0].Value.ToString();
|
||||||
|
CertificateData certificateData = Database.GetCertificate(issueNumber);
|
||||||
|
|
||||||
|
var print = new PrintCertificate(new List<CertificateData>(){certificateData});
|
||||||
|
var printDocument = new PrintDocument();
|
||||||
|
printDocument.DocumentName = "차고지 이용 증명서";
|
||||||
|
|
||||||
|
printDocument.PrintPage += print.PrintPage;
|
||||||
|
|
||||||
|
var printPreviewDialog = new PrintPreviewDialog();
|
||||||
|
printPreviewDialog.Icon = Resources.free_icon_trucks_8552082;
|
||||||
|
printPreviewDialog.WindowState = FormWindowState.Maximized;
|
||||||
|
printPreviewDialog.Document = printDocument;
|
||||||
|
printPreviewDialog.ShowDialog();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
|
|
||||||
private void metroButton_Search_Click(object sender, EventArgs e)
|
private void metroButton_Search_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
List<ProceedsData> proceedsDatas = Database.GetLedgerProceeds(metroDateTime_StartDate.Value, metroDateTime_EndDate.Value);
|
List<ProceedsData> proceedsDatas = Database.GetLedgerProceeds(metroDateTime_StartDate.Value, metroDateTime_EndDate.Value);
|
||||||
|
|
||||||
var dataTable = new DataTable();
|
var dataTable = new DataTable();
|
||||||
|
@@ -39,18 +39,18 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
|
|
||||||
private void metroButton_Save_Click(object sender, EventArgs e)
|
private void metroButton_Save_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
long value;
|
int value;
|
||||||
Settings settings = new Settings();
|
Settings settings = new Settings();
|
||||||
|
|
||||||
long.TryParse(metroTextBox_UsageFee.Text, out value);
|
int.TryParse(metroTextBox_UsageFee.Text, out value);
|
||||||
settings.UsageFee = value;
|
settings.UsageFee = value;
|
||||||
|
|
||||||
long.TryParse(metroTextBox_ExtendedFee.Text, out value);
|
int.TryParse(metroTextBox_ExtendedFee.Text, out value);
|
||||||
settings.ExtendedFee = value;
|
settings.ExtendedFee = value;
|
||||||
|
|
||||||
long.TryParse(metroTextBox_CertificateFee.Text, out value);
|
int.TryParse(metroTextBox_CertificateFee.Text, out value);
|
||||||
settings.CertificateFee = value;
|
settings.CertificateFee = value;
|
||||||
long.TryParse(metroTextBox_ReCertificateFee.Text, out value);
|
int.TryParse(metroTextBox_ReCertificateFee.Text, out value);
|
||||||
settings.ReCertificateFee = value;
|
settings.ReCertificateFee = value;
|
||||||
|
|
||||||
Database.SaveSettings(settings);
|
Database.SaveSettings(settings);
|
||||||
|
@@ -1,60 +1,56 @@
|
|||||||
using MetroFramework;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Printing;
|
using System.Drawing.Printing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using HSUCO_Cargo_Garage_Operation_Program.Properties;
|
using HSUCO_Cargo_Garage_Operation_Program.Properties;
|
||||||
|
using MetroFramework;
|
||||||
|
|
||||||
namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
||||||
{
|
{
|
||||||
public partial class UserList : UserControl
|
public partial class UserList : UserControl
|
||||||
{
|
{
|
||||||
public UserList() => InitializeComponent();
|
public UserList()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
void ApplicantList_Load(object sender, EventArgs e)
|
private void ApplicantList_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
metroComboBox_SearchType.SelectedIndex = 0;
|
metroComboBox_SearchType.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<User> UserType()
|
private List<User> UserType()
|
||||||
{
|
{
|
||||||
// 순위?
|
|
||||||
var userList = Database.GetUserList();
|
var userList = Database.GetUserList();
|
||||||
List<User> nowUserList;
|
List<User> nowUserList;
|
||||||
|
|
||||||
if (metroRadioButton_UseUser.Checked)
|
if (metroRadioButton_UseUser.Checked)
|
||||||
{
|
|
||||||
nowUserList = userList.Where(x => x.DateEnd >= DateTime.Now && !x.RefundCheck).ToList();
|
nowUserList = userList.Where(x => x.DateEnd >= DateTime.Now && !x.RefundCheck).ToList();
|
||||||
}
|
|
||||||
else if (metroRadioButton_EndUser.Checked)
|
else if (metroRadioButton_EndUser.Checked)
|
||||||
{
|
|
||||||
nowUserList = userList.Where(x => x.DateEnd <= DateTime.Now || x.RefundCheck).ToList();
|
nowUserList = userList.Where(x => x.DateEnd <= DateTime.Now || x.RefundCheck).ToList();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
nowUserList = userList;
|
nowUserList = userList;
|
||||||
}
|
|
||||||
|
|
||||||
return nowUserList;
|
return nowUserList;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataChange()
|
private void DataChange()
|
||||||
{
|
{
|
||||||
var nowUserList = UserType();
|
var nowUserList = UserType();
|
||||||
|
|
||||||
switch (metroComboBox_SearchType.SelectedIndex)
|
switch (metroComboBox_SearchType.SelectedIndex)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
nowUserList = nowUserList.Where(x => x.RegistrationNumberTruck.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
nowUserList = nowUserList
|
||||||
|
.Where(x => x.RegistrationNumberTruck.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
nowUserList = nowUserList.Where(x => x.RegistrationNumberPassenger.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
nowUserList = nowUserList
|
||||||
|
.Where(x => x.RegistrationNumberPassenger.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
nowUserList = nowUserList.Where(x => x.Name.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
nowUserList = nowUserList.Where(x => x.Name.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
||||||
@@ -65,11 +61,10 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
case 4:
|
case 4:
|
||||||
nowUserList = nowUserList.Where(x => x.Address.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
nowUserList = nowUserList.Where(x => x.Address.Contains(metroTextBox_Search.Text.Trim())).ToList();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var dataTable = new DataTable();
|
var dataTable = new DataTable();
|
||||||
|
dataTable.Columns.Add("No");
|
||||||
dataTable.Columns.Add("차량번호(화물)");
|
dataTable.Columns.Add("차량번호(화물)");
|
||||||
dataTable.Columns.Add("차량번호(승용)");
|
dataTable.Columns.Add("차량번호(승용)");
|
||||||
dataTable.Columns.Add("이름");
|
dataTable.Columns.Add("이름");
|
||||||
@@ -81,29 +76,26 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
dataTable.Columns.Add("연장여부");
|
dataTable.Columns.Add("연장여부");
|
||||||
dataTable.Columns.Add("환불령부");
|
dataTable.Columns.Add("환불령부");
|
||||||
|
|
||||||
for (int i = 0; i < nowUserList.Count; i++)
|
for (var i = 0; i < nowUserList.Count; i++)
|
||||||
{
|
|
||||||
dataTable.Rows
|
dataTable.Rows
|
||||||
.Add(
|
.Add(
|
||||||
|
nowUserList[i].No,
|
||||||
nowUserList[i].RegistrationNumberTruck,
|
nowUserList[i].RegistrationNumberTruck,
|
||||||
nowUserList[i].RegistrationNumberPassenger,
|
nowUserList[i].RegistrationNumberPassenger,
|
||||||
nowUserList[i].Name,
|
nowUserList[i].Name,
|
||||||
nowUserList[i].Phone,
|
nowUserList[i].Phone,
|
||||||
nowUserList[i].Address,
|
nowUserList[i].Address,
|
||||||
nowUserList[i].DateOfApplicant,
|
nowUserList[i].DateOfApplicant,
|
||||||
nowUserList[i].DateStart,
|
nowUserList[i].DateStart,
|
||||||
nowUserList[i].DateEnd,
|
nowUserList[i].DateEnd,
|
||||||
nowUserList[i].Extended ? "Y" : "N",
|
nowUserList[i].Extended ? "Y" : "N",
|
||||||
nowUserList[i].RefundCheck ? "Y" : "N"
|
nowUserList[i].RefundCheck ? "Y" : "N"
|
||||||
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
dataGridView_List.DataSource = dataTable;
|
dataGridView_List.DataSource = dataTable;
|
||||||
dataGridView_List.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
dataGridView_List.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
dataGridView_List.Columns[0].MinimumWidth = 100;
|
dataGridView_List.Columns[0].MinimumWidth = 20;
|
||||||
dataGridView_List.Columns[0].FillWeight = 100;
|
dataGridView_List.Columns[0].FillWeight = 20;
|
||||||
|
|
||||||
dataGridView_List.Columns[1].MinimumWidth = 100;
|
dataGridView_List.Columns[1].MinimumWidth = 100;
|
||||||
dataGridView_List.Columns[1].FillWeight = 100;
|
dataGridView_List.Columns[1].FillWeight = 100;
|
||||||
@@ -111,9 +103,12 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
dataGridView_List.Columns[2].FillWeight = 60;
|
dataGridView_List.Columns[2].FillWeight = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
void metroButton_Search_Click(object sender, EventArgs e) => DataChange();
|
private void metroButton_Search_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DataChange();
|
||||||
|
}
|
||||||
|
|
||||||
void metroButton_ExportExcel_Click(object sender, EventArgs e)
|
private void metroButton_ExportExcel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var excelWrapper = new ExcelWrapper();
|
var excelWrapper = new ExcelWrapper();
|
||||||
|
|
||||||
@@ -122,11 +117,12 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
|
|
||||||
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
var result = excelWrapper.WriteDataTableToExcel((DataTable)dataGridView_List.DataSource, "UserList", saveFileDialog.FileName, "이용자 리스트", Environment.MachineName, DateTime.Now);
|
var result = excelWrapper.WriteDataTableToExcel((DataTable)dataGridView_List.DataSource, "UserList",
|
||||||
|
saveFileDialog.FileName, "이용자 리스트", Environment.MachineName, DateTime.Now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void metroButton_Extended_Click(object sender, EventArgs e)
|
private void metroButton_Extended_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (dataGridView_List.SelectedRows.Count == 0) return;
|
if (dataGridView_List.SelectedRows.Count == 0) return;
|
||||||
var allCount = dataGridView_List.SelectedRows.Count;
|
var allCount = dataGridView_List.SelectedRows.Count;
|
||||||
@@ -134,8 +130,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
|
|
||||||
var extendeds = new List<Extended>();
|
var extendeds = new List<Extended>();
|
||||||
|
|
||||||
for (int i = 0; i < dataGridView_List.SelectedRows.Count; i++)
|
for (var i = 0; i < dataGridView_List.SelectedRows.Count; i++)
|
||||||
{
|
|
||||||
if (dataGridView_List.SelectedRows[i].Cells[8].Value.ToString() == "N")
|
if (dataGridView_List.SelectedRows[i].Cells[8].Value.ToString() == "N")
|
||||||
{
|
{
|
||||||
var extended = new Extended();
|
var extended = new Extended();
|
||||||
@@ -143,20 +138,18 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
extended.DateEnd = DateTime.Parse(dataGridView_List.SelectedRows[i].Cells[7].Value.ToString());
|
extended.DateEnd = DateTime.Parse(dataGridView_List.SelectedRows[i].Cells[7].Value.ToString());
|
||||||
extendeds.Add(extended);
|
extendeds.Add(extended);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (extendeds.Count == 0)
|
if (extendeds.Count == 0)
|
||||||
{
|
{
|
||||||
MetroMessageBox.Show(this, "선택하신 건수 중에 연장할수 있는 건수가 없습니다.", "서류 완료 전환", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MetroMessageBox.Show(this, "선택하신 건수 중에 연장할수 있는 건수가 없습니다.", "서류 완료 전환", MessageBoxButtons.OK,
|
||||||
|
MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var message = "선태하신 전체 건수(" + allCount + ")중 미연장 이였던 건수(" + extendeds.Count + ")를 1년 연장 처리합니다 .";
|
var message = "선태하신 전체 건수(" + allCount + ")중 미연장 이였던 건수(" + extendeds.Count + ")를 1년 연장 처리합니다 .";
|
||||||
|
|
||||||
if (MetroMessageBox.Show(this, message, "1년 연장", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
|
if (MetroMessageBox.Show(this, message, "1년 연장", MessageBoxButtons.OKCancel,
|
||||||
{
|
MessageBoxIcon.Information) == DialogResult.OK) Database.UpdateExtended(extendeds);
|
||||||
Database.UpdateExtended(extendeds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DataChange();
|
DataChange();
|
||||||
@@ -172,21 +165,67 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
|
|||||||
|
|
||||||
private void metroButton_Certificate_Click(object sender, EventArgs e)
|
private void metroButton_Certificate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//var allCount = dataGridView_List.SelectedRows.Count;
|
|
||||||
//if (allCount == 0) return;
|
|
||||||
// TODO: 증명서 인쇄
|
// TODO: 증명서 인쇄
|
||||||
// PRINT
|
DateTime nowDateTime = DateTime.Now;
|
||||||
List<PrintCertificateData> all = new List<PrintCertificateData>();
|
var count = dataGridView_List.SelectedRows.Count;
|
||||||
all.Add(new PrintCertificateData());
|
if (count == 0)
|
||||||
all.Add(new PrintCertificateData());
|
{
|
||||||
all.Add(new PrintCertificateData());
|
MetroMessageBox.Show(this, "선택된 이용자가 없습니다.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
PrintCertificate print = new PrintCertificate(all);
|
return;
|
||||||
PrintDocument printDocument = new PrintDocument();
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var result = MetroMessageBox.Show(this, "발급 하시겠습니까?", "증명서 발급", MessageBoxButtons.YesNo,
|
||||||
|
MessageBoxIcon.Question);
|
||||||
|
if (result == DialogResult.No) return;
|
||||||
|
|
||||||
|
// 사용자 정보 가져와야함
|
||||||
|
int code = int.Parse(dataGridView_List.SelectedRows[0].Cells[0].Value.ToString());
|
||||||
|
|
||||||
|
CertificateData certificateData = new CertificateData();
|
||||||
|
certificateData.RegistrationNumberTruck =
|
||||||
|
dataGridView_List.SelectedRows[0].Cells[1].Value.ToString();
|
||||||
|
certificateData.RegistrationNumberPassenger = dataGridView_List.SelectedRows[0].Cells[2].Value.ToString();
|
||||||
|
|
||||||
|
certificateData.Name = dataGridView_List.SelectedRows[0].Cells[3].Value.ToString();
|
||||||
|
certificateData.StartDate =
|
||||||
|
DateTime.Parse(dataGridView_List.SelectedRows[0].Cells[7].Value.ToString());
|
||||||
|
certificateData.EndDate= DateTime.Parse(dataGridView_List.SelectedRows[0].Cells[8].Value.ToString());
|
||||||
|
certificateData.IssueDate = nowDateTime;
|
||||||
|
|
||||||
|
int lastNo = Database.GetLastCertificate(nowDateTime.Year);
|
||||||
|
lastNo++;
|
||||||
|
certificateData.IssueNumber = nowDateTime.Year.ToString() + "-" + lastNo.ToString("D4");
|
||||||
|
|
||||||
|
|
||||||
|
Certificate certificate = new Certificate();
|
||||||
|
certificate.No = int.Parse(dataGridView_List.SelectedRows[0].Cells[0].Value.ToString());
|
||||||
|
certificate.IssueNumber = certificateData.IssueNumber;
|
||||||
|
certificate.IssueDate = certificateData.IssueDate;
|
||||||
|
certificate.StartDate = certificateData.StartDate;
|
||||||
|
certificate.EndDate = certificateData.EndDate;
|
||||||
|
bool dbResult = Database.SetCertificate(certificate);
|
||||||
|
|
||||||
|
// 요금 상계
|
||||||
|
SetProceedsInfo setProceedsInfo = new SetProceedsInfo();
|
||||||
|
setProceedsInfo.No = certificate.No;
|
||||||
|
setProceedsInfo.Date = nowDateTime;
|
||||||
|
setProceedsInfo.Type = ProceedsType.Certificate;
|
||||||
|
setProceedsInfo.Amount = Global.GlobalSettings.CertificateFee;
|
||||||
|
|
||||||
|
dbResult = Database.SetProceeds(setProceedsInfo);
|
||||||
|
// 요금 ?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var print = new PrintCertificate(new List<CertificateData>() { certificateData });
|
||||||
|
var printDocument = new PrintDocument();
|
||||||
printDocument.DocumentName = "차고지 이용 증명서";
|
printDocument.DocumentName = "차고지 이용 증명서";
|
||||||
|
|
||||||
printDocument.PrintPage += print.PrintPage;
|
printDocument.PrintPage += print.PrintPage;
|
||||||
|
|
||||||
PrintPreviewDialog printPreviewDialog = new PrintPreviewDialog();
|
var printPreviewDialog = new PrintPreviewDialog();
|
||||||
printPreviewDialog.Icon = Resources.free_icon_trucks_8552082;
|
printPreviewDialog.Icon = Resources.free_icon_trucks_8552082;
|
||||||
printPreviewDialog.WindowState = FormWindowState.Maximized;
|
printPreviewDialog.WindowState = FormWindowState.Maximized;
|
||||||
printPreviewDialog.Document = printDocument;
|
printPreviewDialog.Document = printDocument;
|
||||||
|
@@ -16,6 +16,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
|
|
||||||
public struct User
|
public struct User
|
||||||
{
|
{
|
||||||
|
public int No;
|
||||||
public string RegistrationNumberTruck { get; set; }
|
public string RegistrationNumberTruck { get; set; }
|
||||||
public string RegistrationNumberPassenger { get; set; }
|
public string RegistrationNumberPassenger { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
@@ -44,21 +45,40 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
public DateTime Date { get; set; }
|
public DateTime Date { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct SetProceedsInfo
|
||||||
|
{
|
||||||
|
public int No { get; set; }
|
||||||
|
public ProceedsType Type { get; set; }
|
||||||
|
public int Amount { get; set; }
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
}
|
||||||
|
public struct Certificate
|
||||||
|
{
|
||||||
|
public int No { get; set; }
|
||||||
|
public string IssueNumber { get; set; }
|
||||||
|
public DateTime IssueDate { get; set; }
|
||||||
|
public DateTime StartDate { get; set; }
|
||||||
|
public DateTime EndDate { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public struct CertificateData
|
public struct CertificateData
|
||||||
{
|
{
|
||||||
public string RegistrationNumberTruck { get; set; }
|
public string RegistrationNumberTruck { get; set; }
|
||||||
public string RegistrationNumberPassenger { get; set; }
|
public string RegistrationNumberPassenger { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string IssueNumber { get; set; }
|
public string IssueNumber { get; set; }
|
||||||
public int Amount { get; set; }
|
public DateTime IssueDate { get; set; }
|
||||||
public DateTime Date { get; set; }
|
public DateTime StartDate { get; set; }
|
||||||
|
public DateTime EndDate { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
public struct Settings
|
public struct Settings
|
||||||
{
|
{
|
||||||
public long UsageFee { get; set; }
|
public int UsageFee { get; set; }
|
||||||
public long ExtendedFee { get; set; }
|
public int ExtendedFee { get; set; }
|
||||||
public long CertificateFee { get; set; }
|
public int CertificateFee { get; set; }
|
||||||
public long ReCertificateFee { get; set; }
|
public int ReCertificateFee { get; set; }
|
||||||
|
|
||||||
// 현재 세팅값은 네임/밸류/Date 로 저장하게 되어있는데 이게 필요할까? 고정으로 바꾸는 방법이 더 좋지 않을까?
|
// 현재 세팅값은 네임/밸류/Date 로 저장하게 되어있는데 이게 필요할까? 고정으로 바꾸는 방법이 더 좋지 않을까?
|
||||||
// 이용금액 Usage Fee
|
// 이용금액 Usage Fee
|
||||||
|
@@ -37,13 +37,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
""Inspection"" INTEGER NOT NULL
|
""Inspection"" INTEGER NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE ""Certificate"" (
|
|
||||||
""No"" INTEGER NOT NULL UNIQUE,
|
|
||||||
""Date"" INTEGER NOT NULL,
|
|
||||||
""UserNo"" INTEGER NOT NULL,
|
|
||||||
PRIMARY KEY(""No"" AUTOINCREMENT)
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE ""DeleteList"" (
|
CREATE TABLE ""DeleteList"" (
|
||||||
""ApplicantType"" INTEGER NOT NULL,
|
""ApplicantType"" INTEGER NOT NULL,
|
||||||
""RegistrationNumberTruck"" TEXT NOT NULL,
|
""RegistrationNumberTruck"" TEXT NOT NULL,
|
||||||
@@ -61,7 +54,9 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
CREATE TABLE ""LedgerCertificate"" (
|
CREATE TABLE ""LedgerCertificate"" (
|
||||||
""No"" INTEGER NOT NULL,
|
""No"" INTEGER NOT NULL,
|
||||||
""IssueNumber"" TEXT NOT NULL,
|
""IssueNumber"" TEXT NOT NULL,
|
||||||
""Date"" TEXT NOT NULL
|
""IssueDate"" TEXT NOT NULL,
|
||||||
|
""StartDate"" TEXT NOT NULL,
|
||||||
|
""EndDate"" TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE ""LedgerProceeds"" (
|
CREATE TABLE ""LedgerProceeds"" (
|
||||||
@@ -169,7 +164,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
var result = 0;
|
var result = 0;
|
||||||
|
|
||||||
var query =
|
var query =
|
||||||
$"INSERT INTO ApplicantList VALUES('{applicant.ApplicantType.BoolToInt()}','{applicant.RegistrationNumberTruck}','{applicant.RegistrationNumberPassenger}','{applicant.Name}','{applicant.Phone}','{applicant.Address}','{applicant.DateOfApplication}','{applicant.Inspection.BoolToInt()}') ";
|
$"INSERT INTO ApplicantList VALUES('{applicant.ApplicantType.BoolToInt()}','{applicant.RegistrationNumberTruck}','{applicant.RegistrationNumberPassenger}','{applicant.Name}','{applicant.Phone}','{applicant.Address}','{applicant.DateOfApplication.DateTimeDatabase()}','{applicant.Inspection.BoolToInt()}') ";
|
||||||
|
|
||||||
using (var command = _sqLiteConnection.CreateCommand())
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -283,7 +278,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
for (var i = 0; i < RegistrationNumberTruck.Count; i++)
|
for (var i = 0; i < RegistrationNumberTruck.Count; i++)
|
||||||
{
|
{
|
||||||
var query = "UPDATE ApplicantList SET Inspection=" + result.BoolToInt() + ", DateOfApplicant=\"" +
|
var query = "UPDATE ApplicantList SET Inspection=" + result.BoolToInt() + ", DateOfApplicant=\"" +
|
||||||
DateTime.Now + "\" Where RegistrationNumberTruck=\"" + RegistrationNumberTruck[i] + "\"";
|
DateTime.Now.DateTimeDatabase() + "\" Where RegistrationNumberTruck=\"" + RegistrationNumberTruck[i] + "\"";
|
||||||
|
|
||||||
using (var command = _sqLiteConnection.CreateCommand())
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -297,7 +292,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
{
|
{
|
||||||
for (var i = 0; i < extendeds.Count; i++)
|
for (var i = 0; i < extendeds.Count; i++)
|
||||||
{
|
{
|
||||||
var query = "UPDATE UserList Set DateEnd=\"" + extendeds[i].DateEnd.AddYears(1) + "\" Extended=\"" +
|
var query = "UPDATE UserList Set DateEnd=\"" + extendeds[i].DateEnd.AddYears(1).EndDateTime() + "\" Extended=\"" +
|
||||||
true.BoolToInt() + "\" Where RegistrationNumberTruck=\"" +
|
true.BoolToInt() + "\" Where RegistrationNumberTruck=\"" +
|
||||||
extendeds[i].RegistrationNumberTruck + "\"";
|
extendeds[i].RegistrationNumberTruck + "\"";
|
||||||
using (var command = _sqLiteConnection.CreateCommand())
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
@@ -342,15 +337,15 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
return applicants;
|
return applicants;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddUserList(List<string> RegistrationNumberTruck, DateTime start, DateTime end,
|
public static void AddUserList(List<string> registrationNumberTruck, DateTime start, DateTime end,
|
||||||
int totalCost)
|
int totalCost)
|
||||||
{
|
{
|
||||||
var applicants = GetApplicantList(RegistrationNumberTruck);
|
var applicants = GetApplicantList(registrationNumberTruck);
|
||||||
|
|
||||||
for (var i = 0; i < applicants.Count; i++)
|
for (var i = 0; i < applicants.Count; i++)
|
||||||
{
|
{
|
||||||
var query =
|
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') ";
|
$"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.DateTimeDatabase()}','{start.StartDateTime()}','{end.EndDateTime()}','0','0') ";
|
||||||
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
insertCommand.CommandText = query;
|
insertCommand.CommandText = query;
|
||||||
@@ -359,7 +354,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
|
|
||||||
var no = _sqLiteConnection.LastInsertRowId;
|
var no = _sqLiteConnection.LastInsertRowId;
|
||||||
query =
|
query =
|
||||||
$"INSERT INTO LedgerProceeds(No, Type, Amount, Date) VALUES({no},{(int)ProceedsType.Fees},{totalCost},'{DateTime.Now}')";
|
$"INSERT INTO LedgerProceeds(No, Type, Amount, Date) VALUES({no},{(int)ProceedsType.Fees},{totalCost},'{DateTime.Now.DateTimeDatabase()}')";
|
||||||
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
insertCommand.CommandText = query;
|
insertCommand.CommandText = query;
|
||||||
@@ -384,7 +379,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
for (var i = 0; i < applicants.Count; i++)
|
for (var i = 0; i < applicants.Count; i++)
|
||||||
{
|
{
|
||||||
var query =
|
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}') ";
|
$"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.DateTimeDatabase()}','{applicants[i].Inspection.BoolToInt()}','{DateTime.Now.DateTimeDatabase()}','{DeleterName}','{Reason}') ";
|
||||||
|
|
||||||
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -408,7 +403,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
var proceedsDatas = new List<ProceedsData>();
|
var proceedsDatas = new List<ProceedsData>();
|
||||||
|
|
||||||
var query =
|
var query =
|
||||||
$"SELECT UserList.RegistrationNumberTruck, UserList.RegistrationNumberPassenger, UserList.Name, LedgerProceeds.Type, LedgerProceeds.Amount, LedgerProceeds.Date From LedgerProceeds INNER JOIN UserList ON LedgerProceeds.No = UserList.No Where LedgerProceeds.Date >='{startDateTime}' And LedgerProceeds.Date <='{endDateTime}'";
|
$"SELECT UserList.RegistrationNumberTruck, UserList.RegistrationNumberPassenger, UserList.Name, LedgerProceeds.Type, LedgerProceeds.Amount, LedgerProceeds.Date From LedgerProceeds INNER JOIN UserList ON LedgerProceeds.No = UserList.No Where LedgerProceeds.Date >='{startDateTime.StartDateTime()}' And LedgerProceeds.Date <='{endDateTime.EndDateTime()}'";
|
||||||
|
|
||||||
using (var command = _sqLiteConnection.CreateCommand())
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -437,7 +432,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
{
|
{
|
||||||
var certificateDatas = new List<CertificateData>();
|
var certificateDatas = new List<CertificateData>();
|
||||||
var query =
|
var query =
|
||||||
$"SELECT UserList.RegistrationNumberTruck, UserList.RegistrationNumberPassenger, UserList.Name, LedgerCertificate.Date From LedgerCertificate INNER JOIN UserList ON LedgerCertificate.No = UserList.No Where LedgerCertificate.Date >='{startDateTime}' And LedgerCertificate.Date <='{endDateTime}'";
|
$"SELECT UserList.RegistrationNumberTruck, UserList.RegistrationNumberPassenger, UserList.Name, LedgerCertificate.IssueNumber, LedgerCertificate.IssueDate, LedgerCertificate.StartDate, LedgerCertificate.EndDate From LedgerCertificate INNER JOIN UserList ON LedgerCertificate.No = UserList.No Where LedgerCertificate.IssueDate >='{startDateTime.StartDateTime()}' And LedgerCertificate.IssueDate <='{endDateTime.EndDateTime()}'";
|
||||||
|
|
||||||
using (var command = _sqLiteConnection.CreateCommand())
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -463,10 +458,83 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
return certificateDatas;
|
return certificateDatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CertificateData GetCertificate(string issueNumber)
|
||||||
|
{
|
||||||
|
var certificateData = new CertificateData();
|
||||||
|
var query = $"SELECT UserList.RegistrationNumberTruck, UserList.RegistrationNumberPassenger, UserList.Name, LedgerCertificate.IssueNumber, LedgerCertificate.IssueDate, LedgerCertificate.StartDate, LedgerCertificate.EndDate From LedgerCertificate INNER JOIN UserList ON LedgerCertificate.No = UserList.No Where IssueNumber='{issueNumber}'";
|
||||||
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
|
{
|
||||||
|
command.CommandText = query;
|
||||||
|
|
||||||
|
using (var reader = command.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
certificateData.RegistrationNumberTruck = reader["RegistrationNumberTruck"].ToString();
|
||||||
|
certificateData.RegistrationNumberPassenger = reader["RegistrationNumberPassenger"].ToString();
|
||||||
|
certificateData.Name = reader["Name"].ToString();
|
||||||
|
certificateData.IssueNumber = reader["IssueNumber"].ToString();
|
||||||
|
certificateData.IssueDate = DateTime.Parse(reader["IssueDate"].ToString());
|
||||||
|
certificateData.StartDate = DateTime.Parse(reader["StartDate"].ToString());
|
||||||
|
certificateData.EndDate = DateTime.Parse(reader["EndDate"].ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return certificateData;
|
||||||
|
|
||||||
|
}
|
||||||
|
public static int GetLastCertificate(int year)
|
||||||
|
{
|
||||||
|
var certificateDatas = new List<CertificateData>();
|
||||||
|
var query =
|
||||||
|
$"SELECT IssueNumber FROM LedgerCertificate Where IssueNumber Like '{year}%' Order By IssueNumber DESC LIMIT 1";
|
||||||
|
var lastNo = 0;
|
||||||
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
|
{
|
||||||
|
command.CommandText = query;
|
||||||
|
|
||||||
|
using (var reader = command.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
var issueNumber = reader["IssueNumber"].ToString();
|
||||||
|
issueNumber = issueNumber.Substring(5, issueNumber.Length - 5);
|
||||||
|
lastNo = int.Parse(issueNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lastNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool SetCertificate(Certificate certificate)
|
||||||
|
{
|
||||||
|
var query =
|
||||||
|
$"INSERT INTO LedgerCertificate VALUES('{certificate.No}','{certificate.IssueNumber}','{certificate.IssueDate.DateTimeDatabase()}','{certificate.StartDate.StartDateTime()}','{certificate.EndDate.EndDateTime()}') ";
|
||||||
|
|
||||||
|
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
||||||
|
{
|
||||||
|
insertCommand.CommandText = query;
|
||||||
|
return insertCommand.ExecuteNonQuery() > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool SetProceeds(SetProceedsInfo setProceedsInfo)
|
||||||
|
{
|
||||||
|
var query =
|
||||||
|
$"INSERT INTO LedgerProceeds VALUES('{setProceedsInfo.No}','{(int)setProceedsInfo.Type}','{setProceedsInfo.Amount}','{setProceedsInfo.Date.DateTimeDatabase()}') ";
|
||||||
|
|
||||||
|
using (var insertCommand = _sqLiteConnection.CreateCommand())
|
||||||
|
{
|
||||||
|
insertCommand.CommandText = query;
|
||||||
|
return insertCommand.ExecuteNonQuery() > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Settings LoadSettings()
|
public static Settings LoadSettings()
|
||||||
{
|
{
|
||||||
var settings = new Settings();
|
var settings = new Settings();
|
||||||
|
|
||||||
var query =
|
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";
|
"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())
|
using (var command = _sqLiteConnection.CreateCommand())
|
||||||
@@ -480,28 +548,28 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
var name = reader["SettingName"].ToString();
|
var name = reader["SettingName"].ToString();
|
||||||
var value = reader["SettingValue"].ToString();
|
var value = reader["SettingValue"].ToString();
|
||||||
var date = reader["SettingDate"].ToString();
|
var date = reader["SettingDate"].ToString();
|
||||||
long longValue;
|
int intValue;
|
||||||
switch (name)
|
switch (name)
|
||||||
{
|
{
|
||||||
case "UsageFee":
|
case "UsageFee":
|
||||||
long.TryParse(value, out longValue);
|
int.TryParse(value, out intValue);
|
||||||
settings.UsageFee = longValue;
|
settings.UsageFee = intValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "ExtendedFee":
|
case "ExtendedFee":
|
||||||
|
|
||||||
long.TryParse(value, out longValue);
|
int.TryParse(value, out intValue);
|
||||||
settings.ExtendedFee = longValue;
|
settings.ExtendedFee = intValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "CertificateFee":
|
case "CertificateFee":
|
||||||
long.TryParse(value, out longValue);
|
int.TryParse(value, out intValue);
|
||||||
settings.CertificateFee = longValue;
|
settings.CertificateFee = intValue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "ReCertificateFee":
|
case "ReCertificateFee":
|
||||||
long.TryParse(value, out longValue);
|
int.TryParse(value, out intValue);
|
||||||
settings.ReCertificateFee = longValue;
|
settings.ReCertificateFee = intValue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
33
HSUCO_Cargo_Garage_Operation_Program/Extends.cs
Normal file
33
HSUCO_Cargo_Garage_Operation_Program/Extends.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace HSUCO_Cargo_Garage_Operation_Program
|
||||||
|
{
|
||||||
|
public static class Extends
|
||||||
|
{
|
||||||
|
public static string DateTimeDatabase(this DateTime dateTime)
|
||||||
|
{
|
||||||
|
return dateTime.ToString("yyyy-MM-dd hh:mm:ss");
|
||||||
|
}
|
||||||
|
public static string DateOnly(this DateTime date)
|
||||||
|
{
|
||||||
|
return date.ToString("yyyy-MM-dd 00:00:00");
|
||||||
|
}
|
||||||
|
public static string StartDateTime(this DateTime date)
|
||||||
|
{
|
||||||
|
return $"{date.Year:D4}-{date.Month:D2}-{date.Day:D2} 00:00:00";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string EndDateTime(this DateTime date)
|
||||||
|
{
|
||||||
|
return $"{date.Year:D4}-{date.Month:D2}-{date.Day:D2} 23:59:59";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -155,6 +155,7 @@
|
|||||||
<Compile Include="Database.cs" />
|
<Compile Include="Database.cs" />
|
||||||
<Compile Include="DataModel.cs" />
|
<Compile Include="DataModel.cs" />
|
||||||
<Compile Include="ExcelWrapper.cs" />
|
<Compile Include="ExcelWrapper.cs" />
|
||||||
|
<Compile Include="Extends.cs" />
|
||||||
<Compile Include="Global.cs" />
|
<Compile Include="Global.cs" />
|
||||||
<Compile Include="Master.cs">
|
<Compile Include="Master.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
|
@@ -10,25 +10,15 @@ using Font = System.Drawing.Font;
|
|||||||
|
|
||||||
namespace HSUCO_Cargo_Garage_Operation_Program
|
namespace HSUCO_Cargo_Garage_Operation_Program
|
||||||
{
|
{
|
||||||
struct PrintCertificateData
|
|
||||||
{
|
|
||||||
public string IssueNumber;
|
|
||||||
public string Name;
|
|
||||||
public string RegistrationNumberTruck;
|
|
||||||
public string RegistrationNumberPassenger;
|
|
||||||
public DateTime StartDate;
|
|
||||||
public DateTime EndDate;
|
|
||||||
public DateTime IssueDate;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class PrintCertificate
|
internal class PrintCertificate
|
||||||
{
|
{
|
||||||
private List<PrintCertificateData> _printCertificateDatas;
|
private List<CertificateData> _certificateDatas;
|
||||||
private int _count;
|
private int _count;
|
||||||
public PrintCertificate(List<PrintCertificateData> printCertificateDatas)
|
public PrintCertificate(List<CertificateData> certificateDatas)
|
||||||
{
|
{
|
||||||
_printCertificateDatas = printCertificateDatas;
|
_certificateDatas = certificateDatas;
|
||||||
_count = 0;
|
_count = 0;
|
||||||
}
|
}
|
||||||
public void PrintPage(object sender, PrintPageEventArgs e)
|
public void PrintPage(object sender, PrintPageEventArgs e)
|
||||||
@@ -43,22 +33,22 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
int totalHeight = (int)e.PageBounds.Height;
|
int totalHeight = (int)e.PageBounds.Height;
|
||||||
|
|
||||||
|
|
||||||
e.Graphics.DrawString($"제 {_printCertificateDatas[_count].IssueNumber}호", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 10, e.MarginBounds.Top + 10);
|
e.Graphics.DrawString($"제 {_certificateDatas[_count].IssueNumber}호", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 10, e.MarginBounds.Top + 10);
|
||||||
|
|
||||||
SizeF textSize = e.Graphics.MeasureString(text, font);
|
SizeF textSize = e.Graphics.MeasureString(text, font);
|
||||||
float textX = (totalWidth - textSize.Width) / 2;
|
float textX = (totalWidth - textSize.Width) / 2;
|
||||||
|
|
||||||
e.Graphics.DrawString(text, font, Brushes.Black, textX, e.MarginBounds.Top + 150);
|
e.Graphics.DrawString(text, font, Brushes.Black, textX, e.MarginBounds.Top + 150);
|
||||||
|
|
||||||
e.Graphics.DrawString($"사용자 성명 : {_printCertificateDatas[_count].Name}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 300);
|
e.Graphics.DrawString($"사용자 성명 : {_certificateDatas[_count].Name}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 300);
|
||||||
e.Graphics.DrawString($"주소 : {_printCertificateDatas[_count].Name}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 350);
|
e.Graphics.DrawString($"주소 : {_certificateDatas[_count].Name}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 350);
|
||||||
e.Graphics.DrawString($"차량번호(화물) : {_printCertificateDatas[_count].RegistrationNumberTruck}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 400);
|
e.Graphics.DrawString($"차량번호(화물) : {_certificateDatas[_count].RegistrationNumberTruck}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 400);
|
||||||
e.Graphics.DrawString($"차량번호(승용) : {_printCertificateDatas[_count].RegistrationNumberPassenger}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 450);
|
e.Graphics.DrawString($"차량번호(승용) : {_certificateDatas[_count].RegistrationNumberPassenger}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 450);
|
||||||
e.Graphics.DrawString($"사용기한 : {_printCertificateDatas[_count].StartDate.ToString("yyyy-mm-dd")} ~ {_printCertificateDatas[_count].EndDate.ToString("yyyy-mm-dd")}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 500);
|
e.Graphics.DrawString($"사용기한 : {_certificateDatas[_count].StartDate.ToString("yyyy-MM-dd")} ~ {_certificateDatas[_count].EndDate.ToString("yyyy-MM-dd")}", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 500);
|
||||||
|
|
||||||
e.Graphics.DrawString("상기 차량은 위 사용기한에 차고지 사용을 승인합니다.", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 600);
|
e.Graphics.DrawString("상기 차량은 위 사용기한에 차고지 사용을 승인합니다.", new Font("맑은 고딕", 12), Brushes.Black, e.MarginBounds.Left + 50, e.MarginBounds.Top + 600);
|
||||||
|
|
||||||
text = $"{_printCertificateDatas[_count].IssueDate.ToString("yyyy년 mm월 dd일")}";
|
text = $"{_certificateDatas[_count].IssueDate.ToString("yyyy년 MM월 dd일")}";
|
||||||
font = new Font("맑은 고딕", 15);
|
font = new Font("맑은 고딕", 15);
|
||||||
textSize = e.Graphics.MeasureString(text, font);
|
textSize = e.Graphics.MeasureString(text, font);
|
||||||
textX = (totalWidth - textSize.Width) / 2;
|
textX = (totalWidth - textSize.Width) / 2;
|
||||||
@@ -70,7 +60,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
|
|||||||
textX = (totalWidth - textSize.Width) / 2;
|
textX = (totalWidth - textSize.Width) / 2;
|
||||||
e.Graphics.DrawString(text, font, Brushes.Black, textX, e.MarginBounds.Top + 800);
|
e.Graphics.DrawString(text, font, Brushes.Black, textX, e.MarginBounds.Top + 800);
|
||||||
_count++;
|
_count++;
|
||||||
e.HasMorePages = _printCertificateDatas.Count > _count;
|
e.HasMorePages = _certificateDatas.Count > _count;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user