Database 최종 업데이트

Database 에서 가져오는부분 전부 수정 완료
This commit is contained in:
2023-10-01 22:06:42 +09:00
parent 20a871354d
commit 2effd39bd8
11 changed files with 188 additions and 566 deletions

View File

@@ -32,14 +32,22 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
var year = DateTime.Now.Year + 1;
metroDateTime_Start.Value = DateTime.Parse(year + "-01-01");
metroDateTime_End.Value = DateTime.Parse(year + "-12-31");
metroDateTime_End.Enabled = false;
}
private void metroDateTime_Start_ValueChanged(object sender, EventArgs e)
{
if (metroDateTime_Start.Value.Year != metroDateTime_End.Value.Year)
if (metroDateTime_Start.Value.Day != 1)
{
metroDateTime_End.Value = DateTime.Parse(metroDateTime_Start.Value.Year + "-12-31");
metroDateTime_Start.Value = new DateTime(metroDateTime_Start.Value.Year, metroDateTime_Start.Value.Month, 1);
}
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));
}
int lastDay = DateTime.DaysInMonth(metroDateTime_End.Value.Year, metroDateTime_End.Value.Month);
if (metroDateTime_End.Value.Day != lastDay)
{
metroDateTime_End.Value = new DateTime(metroDateTime_End.Value.Year, metroDateTime_End.Value.Month, lastDay);
}
}

View File

@@ -1,14 +1,6 @@
using MetroFramework;
using MetroFramework.Forms;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
@@ -16,6 +8,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
public partial class UpdateUserData : MetroForm
{
private UpdateUserInformation _updateUserInformation;
public UpdateUserData(UpdateUserInformation updateUserInformation)
{
InitializeComponent();
@@ -26,7 +19,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
public void UpdateControl()
{
if(_updateUserInformation.UserInformationType == EUserInformationType.ApplicantList)
if (_updateUserInformation.UserInformationType == EUserInformationType.ApplicantList)
{
metroComboBox_VehicleType.Enabled = true;
}
@@ -49,11 +42,11 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
private void metroButton_Update_Click(object sender, EventArgs e)
{
bool change = false;
if(_updateUserInformation.CargoVehicleNumber != metroTextBox_CargoVehicleNumber.Text.Trim())
if (_updateUserInformation.CargoVehicleNumber != metroTextBox_CargoVehicleNumber.Text.Trim())
{
change = true;
}
else if(_updateUserInformation.CargoVehicleName != metroTextBox_CargoVehicleName.Text.Trim())
else if (_updateUserInformation.CargoVehicleName != metroTextBox_CargoVehicleName.Text.Trim())
{
change = true;
}
@@ -73,7 +66,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
{
change = true;
}
else if (_updateUserInformation.PersonalNumber != metroTextBox_PersonalNumber.Text.Trim())
{
change = true;
@@ -87,7 +79,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
change = true;
}
if (!change)
{
MetroMessageBox.Show(this, "변경된 내용이 없습니다.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -104,8 +95,11 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
_updateUserInformation.Phone = maskedTextBox_Phone.Text.Trim();
_updateUserInformation.Address = metroTextBox_Address.Text.Trim();
Database.UpdateUserData(_updateUserInformation);
var result = Database.UpdateUserData(_updateUserInformation);
if (result)
{
MetroMessageBox.Show(this, "변경이 완료되었습니다..", "이용자 정보 수정", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
DialogResult = DialogResult.OK;
}

View File

@@ -1,279 +0,0 @@
namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
{
partial class WaitingCount
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.metroLabel1 = new MetroFramework.Controls.MetroLabel();
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
this.metroLabel_MaxCount = new MetroFramework.Controls.MetroLabel();
this.metroLabel_WaitingCount = new MetroFramework.Controls.MetroLabel();
this.metroTextBox_Count = new MetroFramework.Controls.MetroTextBox();
this.metroButton_Ok = new MetroFramework.Controls.MetroButton();
this.metroButton_Cancel = new MetroFramework.Controls.MetroButton();
this.metroLabel3 = new MetroFramework.Controls.MetroLabel();
this.metroDateTime_End = new MetroFramework.Controls.MetroDateTime();
this.metroDateTime_Start = new MetroFramework.Controls.MetroDateTime();
this.metroLabel4 = new MetroFramework.Controls.MetroLabel();
this.metroLabel5 = new MetroFramework.Controls.MetroLabel();
this.metroLabel6 = new MetroFramework.Controls.MetroLabel();
this.metroTextBox_Cost = new MetroFramework.Controls.MetroTextBox();
this.metroLabel7 = new MetroFramework.Controls.MetroLabel();
this.SuspendLayout();
//
// metroLabel1
//
this.metroLabel1.AutoSize = true;
this.metroLabel1.Location = new System.Drawing.Point(30, 100);
this.metroLabel1.Name = "metroLabel1";
this.metroLabel1.Size = new System.Drawing.Size(101, 19);
this.metroLabel1.TabIndex = 0;
this.metroLabel1.Text = "전체 대기자 수";
//
// metroLabel2
//
this.metroLabel2.AutoSize = true;
this.metroLabel2.Location = new System.Drawing.Point(30, 120);
this.metroLabel2.Name = "metroLabel2";
this.metroLabel2.Size = new System.Drawing.Size(133, 19);
this.metroLabel2.TabIndex = 1;
this.metroLabel2.Text = "순번 있는 대기자 수";
//
// metroLabel_MaxCount
//
this.metroLabel_MaxCount.AutoSize = true;
this.metroLabel_MaxCount.Location = new System.Drawing.Point(170, 100);
this.metroLabel_MaxCount.Name = "metroLabel_MaxCount";
this.metroLabel_MaxCount.Size = new System.Drawing.Size(30, 19);
this.metroLabel_MaxCount.TabIndex = 3;
this.metroLabel_MaxCount.Text = "0명";
//
// metroLabel_WaitingCount
//
this.metroLabel_WaitingCount.AutoSize = true;
this.metroLabel_WaitingCount.Location = new System.Drawing.Point(170, 120);
this.metroLabel_WaitingCount.Name = "metroLabel_WaitingCount";
this.metroLabel_WaitingCount.Size = new System.Drawing.Size(30, 19);
this.metroLabel_WaitingCount.TabIndex = 2;
this.metroLabel_WaitingCount.Text = "0명";
//
// metroTextBox_Count
//
//
//
//
this.metroTextBox_Count.CustomButton.Image = null;
this.metroTextBox_Count.CustomButton.Location = new System.Drawing.Point(98, 1);
this.metroTextBox_Count.CustomButton.Name = "";
this.metroTextBox_Count.CustomButton.Size = new System.Drawing.Size(21, 21);
this.metroTextBox_Count.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.metroTextBox_Count.CustomButton.TabIndex = 1;
this.metroTextBox_Count.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.metroTextBox_Count.CustomButton.UseSelectable = true;
this.metroTextBox_Count.CustomButton.Visible = false;
this.metroTextBox_Count.Lines = new string[0];
this.metroTextBox_Count.Location = new System.Drawing.Point(190, 146);
this.metroTextBox_Count.MaxLength = 32767;
this.metroTextBox_Count.Name = "metroTextBox_Count";
this.metroTextBox_Count.PasswordChar = '\0';
this.metroTextBox_Count.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.metroTextBox_Count.SelectedText = "";
this.metroTextBox_Count.SelectionLength = 0;
this.metroTextBox_Count.SelectionStart = 0;
this.metroTextBox_Count.ShortcutsEnabled = true;
this.metroTextBox_Count.Size = new System.Drawing.Size(120, 23);
this.metroTextBox_Count.TabIndex = 4;
this.metroTextBox_Count.UseSelectable = true;
this.metroTextBox_Count.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.metroTextBox_Count.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
//
// metroButton_Ok
//
this.metroButton_Ok.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton_Ok.Location = new System.Drawing.Point(96, 296);
this.metroButton_Ok.Name = "metroButton_Ok";
this.metroButton_Ok.Size = new System.Drawing.Size(144, 55);
this.metroButton_Ok.TabIndex = 5;
this.metroButton_Ok.Text = "확인";
this.metroButton_Ok.UseSelectable = true;
this.metroButton_Ok.Click += new System.EventHandler(this.metroButton_Ok_Click);
//
// metroButton_Cancel
//
this.metroButton_Cancel.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton_Cancel.Location = new System.Drawing.Point(246, 296);
this.metroButton_Cancel.Name = "metroButton_Cancel";
this.metroButton_Cancel.Size = new System.Drawing.Size(144, 55);
this.metroButton_Cancel.TabIndex = 6;
this.metroButton_Cancel.Text = "취소";
this.metroButton_Cancel.UseSelectable = true;
this.metroButton_Cancel.Click += new System.EventHandler(this.metroButton_Cancel_Click);
//
// metroLabel3
//
this.metroLabel3.AutoSize = true;
this.metroLabel3.Location = new System.Drawing.Point(70, 150);
this.metroLabel3.Name = "metroLabel3";
this.metroLabel3.Size = new System.Drawing.Size(115, 19);
this.metroLabel3.TabIndex = 7;
this.metroLabel3.Text = "등록할 대기자 수";
//
// metroDateTime_End
//
this.metroDateTime_End.Location = new System.Drawing.Point(190, 220);
this.metroDateTime_End.MinimumSize = new System.Drawing.Size(0, 29);
this.metroDateTime_End.Name = "metroDateTime_End";
this.metroDateTime_End.Size = new System.Drawing.Size(200, 29);
this.metroDateTime_End.TabIndex = 11;
this.metroDateTime_End.ValueChanged += new System.EventHandler(this.metroDateTime_Start_ValueChanged);
//
// metroDateTime_Start
//
this.metroDateTime_Start.Location = new System.Drawing.Point(190, 180);
this.metroDateTime_Start.MinimumSize = new System.Drawing.Size(0, 29);
this.metroDateTime_Start.Name = "metroDateTime_Start";
this.metroDateTime_Start.Size = new System.Drawing.Size(200, 29);
this.metroDateTime_Start.TabIndex = 10;
this.metroDateTime_Start.ValueChanged += new System.EventHandler(this.metroDateTime_Start_ValueChanged);
//
// metroLabel4
//
this.metroLabel4.AutoSize = true;
this.metroLabel4.Location = new System.Drawing.Point(101, 230);
this.metroLabel4.Name = "metroLabel4";
this.metroLabel4.Size = new System.Drawing.Size(83, 19);
this.metroLabel4.TabIndex = 8;
this.metroLabel4.Text = "이용 종료일";
//
// metroLabel5
//
this.metroLabel5.AutoSize = true;
this.metroLabel5.Location = new System.Drawing.Point(101, 190);
this.metroLabel5.Name = "metroLabel5";
this.metroLabel5.Size = new System.Drawing.Size(83, 19);
this.metroLabel5.TabIndex = 9;
this.metroLabel5.Text = "이용 시작일";
//
// metroLabel6
//
this.metroLabel6.AutoSize = true;
this.metroLabel6.Location = new System.Drawing.Point(374, 259);
this.metroLabel6.Name = "metroLabel6";
this.metroLabel6.Size = new System.Drawing.Size(23, 19);
this.metroLabel6.TabIndex = 14;
this.metroLabel6.Text = "원";
//
// metroTextBox_Cost
//
//
//
//
this.metroTextBox_Cost.CustomButton.Image = null;
this.metroTextBox_Cost.CustomButton.Location = new System.Drawing.Point(158, 1);
this.metroTextBox_Cost.CustomButton.Name = "";
this.metroTextBox_Cost.CustomButton.Size = new System.Drawing.Size(21, 21);
this.metroTextBox_Cost.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
this.metroTextBox_Cost.CustomButton.TabIndex = 1;
this.metroTextBox_Cost.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
this.metroTextBox_Cost.CustomButton.UseSelectable = true;
this.metroTextBox_Cost.CustomButton.Visible = false;
this.metroTextBox_Cost.Lines = new string[] {
"0"};
this.metroTextBox_Cost.Location = new System.Drawing.Point(191, 255);
this.metroTextBox_Cost.MaxLength = 32767;
this.metroTextBox_Cost.Name = "metroTextBox_Cost";
this.metroTextBox_Cost.PasswordChar = '\0';
this.metroTextBox_Cost.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.metroTextBox_Cost.SelectedText = "";
this.metroTextBox_Cost.SelectionLength = 0;
this.metroTextBox_Cost.SelectionStart = 0;
this.metroTextBox_Cost.ShortcutsEnabled = true;
this.metroTextBox_Cost.Size = new System.Drawing.Size(180, 23);
this.metroTextBox_Cost.TabIndex = 13;
this.metroTextBox_Cost.Text = "0";
this.metroTextBox_Cost.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.metroTextBox_Cost.UseSelectable = true;
this.metroTextBox_Cost.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
this.metroTextBox_Cost.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
//
// metroLabel7
//
this.metroLabel7.AutoSize = true;
this.metroLabel7.Location = new System.Drawing.Point(98, 259);
this.metroLabel7.Name = "metroLabel7";
this.metroLabel7.Size = new System.Drawing.Size(87, 19);
this.metroLabel7.TabIndex = 12;
this.metroLabel7.Text = "총 이용 금액";
//
// WaitingCount
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BorderStyle = MetroFramework.Forms.MetroFormBorderStyle.FixedSingle;
this.ClientSize = new System.Drawing.Size(420, 370);
this.Controls.Add(this.metroLabel6);
this.Controls.Add(this.metroTextBox_Cost);
this.Controls.Add(this.metroLabel7);
this.Controls.Add(this.metroDateTime_End);
this.Controls.Add(this.metroDateTime_Start);
this.Controls.Add(this.metroLabel4);
this.Controls.Add(this.metroLabel5);
this.Controls.Add(this.metroLabel3);
this.Controls.Add(this.metroButton_Cancel);
this.Controls.Add(this.metroButton_Ok);
this.Controls.Add(this.metroTextBox_Count);
this.Controls.Add(this.metroLabel_MaxCount);
this.Controls.Add(this.metroLabel_WaitingCount);
this.Controls.Add(this.metroLabel2);
this.Controls.Add(this.metroLabel1);
this.Name = "WaitingCount";
this.Text = "WaitingCount";
this.Load += new System.EventHandler(this.WaitingCount_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private MetroFramework.Controls.MetroLabel metroLabel1;
private MetroFramework.Controls.MetroLabel metroLabel2;
private MetroFramework.Controls.MetroLabel metroLabel_MaxCount;
private MetroFramework.Controls.MetroLabel metroLabel_WaitingCount;
private MetroFramework.Controls.MetroTextBox metroTextBox_Count;
private MetroFramework.Controls.MetroButton metroButton_Ok;
private MetroFramework.Controls.MetroButton metroButton_Cancel;
private MetroFramework.Controls.MetroLabel metroLabel3;
private MetroFramework.Controls.MetroDateTime metroDateTime_End;
private MetroFramework.Controls.MetroDateTime metroDateTime_Start;
private MetroFramework.Controls.MetroLabel metroLabel4;
private MetroFramework.Controls.MetroLabel metroLabel5;
private MetroFramework.Controls.MetroLabel metroLabel6;
private MetroFramework.Controls.MetroTextBox metroTextBox_Cost;
private MetroFramework.Controls.MetroLabel metroLabel7;
}
}

View File

@@ -1,84 +0,0 @@
using System;
using System.Windows.Forms;
namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm
{
public partial class WaitingCount : MetroFramework.Forms.MetroForm
{
public int ResultCount { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public int TotalCost { get; set; }
private int _MaxCount = 0; // 대기자 전체 카운트
private int _WaitngCount = 0; // 순번이 있는 대기자 카운트
public WaitingCount(int maxCount, int waitngCount)
{
InitializeComponent();
_MaxCount = maxCount;
_WaitngCount = waitngCount;
metroLabel_MaxCount.Text = _MaxCount + "명";
metroLabel_WaitingCount.Text = _WaitngCount + "명";
}
private void metroButton_Ok_Click(object sender, EventArgs e)
{
int count = int.Parse(metroLabel_WaitingCount.Text);
if (count < 1)
{
DialogResult = DialogResult.Cancel;
}
if (count > _MaxCount)
{
count = _MaxCount;
}
ResultCount = count;
StartDate = metroDateTime_Start.Value;
EndDate = metroDateTime_End.Value;
int.TryParse(metroTextBox_Cost.Text, out var tempCost);
TotalCost = tempCost;
DialogResult = DialogResult.OK;
}
private void metroButton_Cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void WaitingCount_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)
{
//TODO: 요금계산 부분 다시 작성 요망
/*
//long cost = Global.GlobalSettings.UsageFee;
var days = (metroDateTime_End.Value - metroDateTime_Start.Value).TotalDays;
if (days == 365)
{
metroTextBox_Cost.Text = cost.ToString();
return;
}
Debug.WriteLine((days));
var doubleCost = cost / 365 * days;
doubleCost -= (doubleCost % 10); // 10의 자리 버림
int totalCost = (int)doubleCost;
metroTextBox_Cost.Text = totalCost.ToString();
*/
}
}
}

View File

@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -34,6 +34,8 @@
this.metroRadioButton_UseUser = new MetroFramework.Controls.MetroRadioButton();
this.metroRadioButton_InspectionAll = new MetroFramework.Controls.MetroRadioButton();
this.metroPanel1 = new MetroFramework.Controls.MetroPanel();
this.metroButton2 = new MetroFramework.Controls.MetroButton();
this.metroButton1 = new MetroFramework.Controls.MetroButton();
this.metroButton_UpdateUserData = new MetroFramework.Controls.MetroButton();
this.metroButton_Certificate = new MetroFramework.Controls.MetroButton();
this.metroButton_ExportExcel = new MetroFramework.Controls.MetroButton();
@@ -47,12 +49,16 @@
this.metroComboBox_SearchType = new MetroFramework.Controls.MetroComboBox();
this.dataGridView_List = new System.Windows.Forms.DataGridView();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.metroButton1 = new MetroFramework.Controls.MetroButton();
this.metroButton2 = new MetroFramework.Controls.MetroButton();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.metroRadioButton_Use = new MetroFramework.Controls.MetroRadioButton();
this.metroRadioButton_StandBy = new MetroFramework.Controls.MetroRadioButton();
this.metroRadioButton_PayAll = new MetroFramework.Controls.MetroRadioButton();
this.metroRadioButton_Refund = new MetroFramework.Controls.MetroRadioButton();
this.groupBox1.SuspendLayout();
this.metroPanel1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_List)).BeginInit();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
@@ -102,6 +108,7 @@
//
// metroPanel1
//
this.metroPanel1.Controls.Add(this.groupBox3);
this.metroPanel1.Controls.Add(this.metroButton2);
this.metroPanel1.Controls.Add(this.metroButton1);
this.metroPanel1.Controls.Add(this.metroButton_UpdateUserData);
@@ -119,17 +126,39 @@
this.metroPanel1.Location = new System.Drawing.Point(0, 0);
this.metroPanel1.Margin = new System.Windows.Forms.Padding(0);
this.metroPanel1.Name = "metroPanel1";
this.metroPanel1.Size = new System.Drawing.Size(750, 600);
this.metroPanel1.Size = new System.Drawing.Size(900, 600);
this.metroPanel1.TabIndex = 0;
this.metroPanel1.VerticalScrollbarBarColor = true;
this.metroPanel1.VerticalScrollbarHighlightOnWheel = false;
this.metroPanel1.VerticalScrollbarSize = 10;
//
// metroButton2
//
this.metroButton2.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton2.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton2.Location = new System.Drawing.Point(776, 279);
this.metroButton2.Name = "metroButton2";
this.metroButton2.Size = new System.Drawing.Size(121, 40);
this.metroButton2.TabIndex = 15;
this.metroButton2.Text = "결재대기 삭제";
this.metroButton2.UseSelectable = true;
//
// metroButton1
//
this.metroButton1.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton1.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton1.Location = new System.Drawing.Point(776, 233);
this.metroButton1.Name = "metroButton1";
this.metroButton1.Size = new System.Drawing.Size(121, 40);
this.metroButton1.TabIndex = 14;
this.metroButton1.Text = "결재 확인";
this.metroButton1.UseSelectable = true;
//
// metroButton_UpdateUserData
//
this.metroButton_UpdateUserData.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton_UpdateUserData.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton_UpdateUserData.Location = new System.Drawing.Point(626, 166);
this.metroButton_UpdateUserData.Location = new System.Drawing.Point(776, 166);
this.metroButton_UpdateUserData.Name = "metroButton_UpdateUserData";
this.metroButton_UpdateUserData.Size = new System.Drawing.Size(121, 40);
this.metroButton_UpdateUserData.TabIndex = 13;
@@ -141,7 +170,7 @@
//
this.metroButton_Certificate.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton_Certificate.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton_Certificate.Location = new System.Drawing.Point(626, 120);
this.metroButton_Certificate.Location = new System.Drawing.Point(776, 120);
this.metroButton_Certificate.Name = "metroButton_Certificate";
this.metroButton_Certificate.Size = new System.Drawing.Size(121, 40);
this.metroButton_Certificate.TabIndex = 10;
@@ -155,7 +184,7 @@
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.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton_ExportExcel.Location = new System.Drawing.Point(626, 465);
this.metroButton_ExportExcel.Location = new System.Drawing.Point(776, 465);
this.metroButton_ExportExcel.Name = "metroButton_ExportExcel";
this.metroButton_ExportExcel.Size = new System.Drawing.Size(121, 115);
this.metroButton_ExportExcel.TabIndex = 9;
@@ -166,7 +195,7 @@
//
this.metroButton_Refund.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton_Refund.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton_Refund.Location = new System.Drawing.Point(626, 420);
this.metroButton_Refund.Location = new System.Drawing.Point(776, 420);
this.metroButton_Refund.Name = "metroButton_Refund";
this.metroButton_Refund.Size = new System.Drawing.Size(121, 40);
this.metroButton_Refund.TabIndex = 8;
@@ -178,7 +207,7 @@
//
this.metroButton_Extended.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton_Extended.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton_Extended.Location = new System.Drawing.Point(626, 374);
this.metroButton_Extended.Location = new System.Drawing.Point(776, 374);
this.metroButton_Extended.Name = "metroButton_Extended";
this.metroButton_Extended.Size = new System.Drawing.Size(121, 40);
this.metroButton_Extended.TabIndex = 8;
@@ -194,9 +223,9 @@
this.groupBox2.Controls.Add(this.metroButton_Search);
this.groupBox2.Controls.Add(this.metroTextBox_Search);
this.groupBox2.Controls.Add(this.metroComboBox_SearchType);
this.groupBox2.Location = new System.Drawing.Point(200, 20);
this.groupBox2.Location = new System.Drawing.Point(363, 20);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(530, 90);
this.groupBox2.Size = new System.Drawing.Size(518, 90);
this.groupBox2.TabIndex = 8;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "검색";
@@ -298,30 +327,64 @@
this.dataGridView_List.ReadOnly = true;
this.dataGridView_List.RowTemplate.Height = 23;
this.dataGridView_List.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView_List.Size = new System.Drawing.Size(600, 460);
this.dataGridView_List.Size = new System.Drawing.Size(750, 460);
this.dataGridView_List.TabIndex = 6;
//
// metroButton1
// groupBox3
//
this.metroButton1.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton1.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton1.Location = new System.Drawing.Point(626, 233);
this.metroButton1.Name = "metroButton1";
this.metroButton1.Size = new System.Drawing.Size(121, 40);
this.metroButton1.TabIndex = 14;
this.metroButton1.Text = "결재 확인";
this.metroButton1.UseSelectable = true;
this.groupBox3.BackColor = System.Drawing.Color.Transparent;
this.groupBox3.Controls.Add(this.metroRadioButton_Refund);
this.groupBox3.Controls.Add(this.metroRadioButton_Use);
this.groupBox3.Controls.Add(this.metroRadioButton_StandBy);
this.groupBox3.Controls.Add(this.metroRadioButton_PayAll);
this.groupBox3.Location = new System.Drawing.Point(176, 20);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(181, 90);
this.groupBox3.TabIndex = 5;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "결재 필터";
//
// metroButton2
// metroRadioButton_Use
//
this.metroButton2.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.metroButton2.FontSize = MetroFramework.MetroButtonSize.Tall;
this.metroButton2.Location = new System.Drawing.Point(626, 279);
this.metroButton2.Name = "metroButton2";
this.metroButton2.Size = new System.Drawing.Size(121, 40);
this.metroButton2.TabIndex = 15;
this.metroButton2.Text = "결재대기 삭제";
this.metroButton2.UseSelectable = true;
this.metroRadioButton_Use.AutoSize = true;
this.metroRadioButton_Use.Location = new System.Drawing.Point(106, 35);
this.metroRadioButton_Use.Name = "metroRadioButton_Use";
this.metroRadioButton_Use.Size = new System.Drawing.Size(71, 15);
this.metroRadioButton_Use.TabIndex = 2;
this.metroRadioButton_Use.Text = "결재완료";
this.metroRadioButton_Use.UseSelectable = true;
//
// metroRadioButton_StandBy
//
this.metroRadioButton_StandBy.AutoSize = true;
this.metroRadioButton_StandBy.Location = new System.Drawing.Point(41, 35);
this.metroRadioButton_StandBy.Name = "metroRadioButton_StandBy";
this.metroRadioButton_StandBy.Size = new System.Drawing.Size(59, 15);
this.metroRadioButton_StandBy.TabIndex = 1;
this.metroRadioButton_StandBy.Text = "미결재";
this.metroRadioButton_StandBy.UseSelectable = true;
//
// metroRadioButton_PayAll
//
this.metroRadioButton_PayAll.AutoSize = true;
this.metroRadioButton_PayAll.Checked = true;
this.metroRadioButton_PayAll.Location = new System.Drawing.Point(30, 15);
this.metroRadioButton_PayAll.Name = "metroRadioButton_PayAll";
this.metroRadioButton_PayAll.Size = new System.Drawing.Size(47, 15);
this.metroRadioButton_PayAll.TabIndex = 0;
this.metroRadioButton_PayAll.TabStop = true;
this.metroRadioButton_PayAll.Text = "전체";
this.metroRadioButton_PayAll.UseSelectable = true;
//
// metroRadioButton_Refund
//
this.metroRadioButton_Refund.AutoSize = true;
this.metroRadioButton_Refund.Location = new System.Drawing.Point(41, 56);
this.metroRadioButton_Refund.Name = "metroRadioButton_Refund";
this.metroRadioButton_Refund.Size = new System.Drawing.Size(47, 15);
this.metroRadioButton_Refund.TabIndex = 3;
this.metroRadioButton_Refund.Text = "환불";
this.metroRadioButton_Refund.UseSelectable = true;
//
// UserList
//
@@ -329,7 +392,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.metroPanel1);
this.Name = "UserList";
this.Size = new System.Drawing.Size(750, 600);
this.Size = new System.Drawing.Size(900, 600);
this.Load += new System.EventHandler(this.ApplicantList_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
@@ -337,6 +400,8 @@
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView_List)).EndInit();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
}
@@ -363,5 +428,10 @@
private MetroFramework.Controls.MetroButton metroButton_UpdateUserData;
private MetroFramework.Controls.MetroButton metroButton2;
private MetroFramework.Controls.MetroButton metroButton1;
private System.Windows.Forms.GroupBox groupBox3;
private MetroFramework.Controls.MetroRadioButton metroRadioButton_Use;
private MetroFramework.Controls.MetroRadioButton metroRadioButton_StandBy;
private MetroFramework.Controls.MetroRadioButton metroRadioButton_PayAll;
private MetroFramework.Controls.MetroRadioButton metroRadioButton_Refund;
}
}

View File

@@ -4,6 +4,7 @@ using MetroFramework;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Text;
using System.Windows.Forms;
@@ -28,19 +29,39 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl
List<UserInformation> nowUserList;
if (metroRadioButton_UseUser.Checked)
nowUserList = userList.Where(x => x.DateEnd >= DateTime.Now && !x.RefundStatus).ToList();
nowUserList = userList.Where(x => x.DateEnd >= DateTime.Now && x.PaymentStatus != EPaymentStatus.Refund ).ToList();
else if (metroRadioButton_EndUser.Checked)
nowUserList = userList.Where(x => x.DateEnd <= DateTime.Now || x.RefundStatus).ToList();
nowUserList = userList.Where(x => x.DateEnd <= DateTime.Now || x.PaymentStatus == EPaymentStatus.Refund).ToList();
else
nowUserList = userList;
return nowUserList;
}
private List<UserInformation> PaymentType(List<UserInformation> beforUserInfromation)
{
List<UserInformation> userList = beforUserInfromation;
if(metroRadioButton_StandBy.Checked)
{
userList = beforUserInfromation.Where(x=> x.PaymentStatus == EPaymentStatus.StandBy).ToList();
}
else if (metroRadioButton_Use.Checked)
{
userList = beforUserInfromation.Where(x => x.PaymentStatus == EPaymentStatus.Use).ToList();
}
else if (metroRadioButton_Refund.Checked)
{
userList = beforUserInfromation.Where(x => x.PaymentStatus == EPaymentStatus.Refund).ToList();
}
return userList;
}
private void DataChange()
{
var nowUserList = UserType();
nowUserList = PaymentType(nowUserList);
switch (metroComboBox_SearchType.SelectedIndex)
{
case 0:

View File

@@ -39,7 +39,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
public DateTime DateEnd { get; set; } // 종료일
public bool ExtensionStatus { get; set; } // 연장여부
public DateTime ExtensionStart { get; set; } // 연장시 시작일
public bool RefundStatus { get; set; } // 환불여부
public EPaymentStatus PaymentStatus { get; set; } // 결재 데이터
public List<HistoryInformation> HistoryInformations { get; set; } // 과거내역정보
}
@@ -192,10 +192,10 @@ namespace HSUCO_Cargo_Garage_Operation_Program
LotsOut,
Wait
}
public enum EStatus
public enum EPaymentStatus
{
StandBy, // 대기
Use, // 사용중
Delete // 삭제됨
Refund // 삭제됨
}
}

View File

@@ -225,16 +225,29 @@ namespace HSUCO_Cargo_Garage_Operation_Program
lastNo++;
string no = $"{year}-{suffix}{lastNo}";
var query =
//TODO : Insert 수정 해야됨
$"INSERT INTO ApplicantList VALUES('{no}', '{applicant.ApplicantType.BoolToInt()}','{applicant.CargoVehicleNumber}','{applicant.CargoVehicleName}','{applicant.PassengerVehicleNumber}','{applicant.PassengerVehicleName}','{(int)applicant.VehicleType}','{applicant.Name}','{applicant.PersonalNumber}','{applicant.Phone}','{applicant.Address}','{applicant.DateOfApplication.DateTimeDatabase()}', 0)";
var query = $"INSERT INTO UserInformation(CargoVehicleNumber, CargoVehicleName, PassengerVehicleNumber, PassengerVehicleName, VehicleType, Name, PersonalNumber, Phone, Address) " +
$"VALUES('{applicant.CargoVehicleNumber}','{applicant.CargoVehicleName}','{applicant.PassengerVehicleNumber}','{applicant.PassengerVehicleName}','{(int)applicant.VehicleType}','{applicant.Name}','{applicant.PersonalNumber}','{applicant.Phone}','{applicant.Address}');" +
$"select last_insert_rowid();";
int lastId = 0;
int insertResult;
using (var command = _sqLiteConnection.CreateCommand())
{
command.CommandText = query;
lastId = int.Parse(command.ExecuteScalar().ToString());
}
if(lastId < 1)
{
return string.Empty;
}
query = $"INSERT INTO ApplicantList(No, ApplicantType, UID, DateOfApplicant, Status) VALUES('{no}', '{applicant.ApplicantType.BoolToInt()}',{lastId},'{applicant.DateOfApplication.DateTimeDatabase()}', 0)";
using (var command = _sqLiteConnection.CreateCommand())
{
command.CommandText = query;
insertResult = command.ExecuteNonQuery();
}
if (insertResult > 0)
{
return no;
@@ -359,8 +372,14 @@ namespace HSUCO_Cargo_Garage_Operation_Program
public static bool UpdateUserData(UpdateUserInformation updateUserInformation)
{
//TODO: 업데이트 필요
var query = $"UPDATE {updateUserInformation.UserInformationType.ToString()} Set CargoVehicleNumber='{updateUserInformation.CargoVehicleNumber}', CargoVehicleName='{updateUserInformation.CargoVehicleName}', PassengerVehicleNumber='{updateUserInformation.PassengerVehicleNumber}', PassengerVehicleName='{updateUserInformation.PassengerVehicleName}', VehicleType={(int)updateUserInformation.VehicleType}, Name='{updateUserInformation.Name}', PersonalNumber='{updateUserInformation.PersonalNumber}', Phone='{updateUserInformation.Phone}', Address='{updateUserInformation.Address}' Where No='{updateUserInformation.No}'";
var query = $"SELECT UID From {updateUserInformation.UserInformationType.ToString()} Where No='{updateUserInformation.No}'";
int id;
using (var command = _sqLiteConnection.CreateCommand())
{
command.CommandText = query;
id = int.Parse(command.ExecuteScalar().ToString());
}
query = $"UPDATE UserInformation Set CargoVehicleNumber='{updateUserInformation.CargoVehicleNumber}', CargoVehicleName='{updateUserInformation.CargoVehicleName}', PassengerVehicleNumber='{updateUserInformation.PassengerVehicleNumber}', PassengerVehicleName='{updateUserInformation.PassengerVehicleName}', VehicleType={(int)updateUserInformation.VehicleType}, Name='{updateUserInformation.Name}', PersonalNumber='{updateUserInformation.PersonalNumber}', Phone='{updateUserInformation.Phone}', Address='{updateUserInformation.Address}' Where UID={id}";
using (var updateCommand = _sqLiteConnection.CreateCommand())
{
updateCommand.CommandText = query;
@@ -401,7 +420,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program
user.DateEnd = DateTime.Parse(reader["DateEnd"].ToString(), new CultureInfo("ko-KR"));
user.ExtensionStatus = reader["ExtensionStatus"].ToString() == "1";
user.ExtensionStart = reader["ExtensionStatus"].ToString() == "1" ? DateTime.Parse(reader["ExtensionStart"].ToString(), new CultureInfo("ko-KR")) : DateTime.MinValue;
user.PaymentStatus = (EPaymentStatus)int.Parse(reader["PaymentStatus"].ToString());
user.HistoryInformations = new List<HistoryInformation>();
users.Add(user);
@@ -531,7 +550,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program
public static GetRefundInformation GetRefundData(string no)
{
GetRefundInformation getRefundInformation = new GetRefundInformation();
// RefundStatus DateStart DateEnd ExtensionStatus ExtensionStart BaseFee ExtensionFee
var query = $"SELECT RefundStatus, DateStart, DateEnd, ExtensionStatus, ExtensionStart From UserList Where No='{no}'";
using (var command = _sqLiteConnection.CreateCommand())
{
@@ -652,7 +670,9 @@ namespace HSUCO_Cargo_Garage_Operation_Program
var applicants = GetApplicantList(CargoVehicleNumber);
for (var i = 0; i < applicants.Count; i++)
{//TODO: 수정사ㅏㅎㅇ
{
//TODO: 사용자 User 업데이트 부분 Status 1 로 변경
//UID? 를 가져와야 하나? 아니면 여기서 처리
var query =
$"INSERT INTO UserList VALUES('{applicants[i].CargoVehicleNumber}','{applicants[i].PassengerVehicleNumber}','{applicants[i].Name}','{applicants[i].Phone}','{applicants[i].Address}','{applicants[i].DateOfApplication.DateTimeDatabase()}','{start.StartDateTime()}','{end.EndDateTime()}','0','0') ";
using (var insertCommand = _sqLiteConnection.CreateCommand())

View File

@@ -104,12 +104,6 @@
<Compile Include="CustomForm\UpdateUserData.Designer.cs">
<DependentUpon>UpdateUserData.cs</DependentUpon>
</Compile>
<Compile Include="CustomForm\WaitingCount.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CustomForm\WaitingCount.Designer.cs">
<DependentUpon>WaitingCount.cs</DependentUpon>
</Compile>
<Compile Include="CustomUserControl\ApplicantControl.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -176,9 +170,6 @@
<EmbeddedResource Include="CustomForm\UpdateUserData.resx">
<DependentUpon>UpdateUserData.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CustomForm\WaitingCount.resx">
<DependentUpon>WaitingCount.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CustomUserControl\ApplicantControl.resx">
<DependentUpon>ApplicantControl.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@@ -1,4 +1,5 @@
using System;
using HSUCO_Cargo_Garage_Operation_Program.CustomForm;
using System;
using System.Collections.Generic;
using System.Windows.Forms;