diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs index a24ca2a..1caf96b 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantList.cs @@ -158,7 +158,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl return; } DateTime startDate = promotion.StartDate; - LeftAreaInformation leftAreaInformation = Database.GetLeftArea(startDate, Global.GlobalSettings.CargoLargeMaxCount, Global.GlobalSettings.CargoOversizedMaxCount); + LeftAreaInformation leftAreaInformation = Database.GetLeftArea(startDate); if (leftAreaInformation.Large.Count + leftAreaInformation.OverSized.Count == 0) { MetroMessageBox.Show(this, "남은 자리가 없습니다", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.Designer.cs index 2896385..942b713 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.Designer.cs @@ -54,13 +54,16 @@ // // metroListView_Area // + this.metroListView_Area.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.metroListView_Area.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader_No, this.columnHeader_Area, this.columnHeader_Type}); this.metroListView_Area.Font = new System.Drawing.Font("Segoe UI", 12F); this.metroListView_Area.FullRowSelect = true; + this.metroListView_Area.GridLines = true; this.metroListView_Area.Location = new System.Drawing.Point(50, 50); + this.metroListView_Area.MultiSelect = false; this.metroListView_Area.Name = "metroListView_Area"; this.metroListView_Area.OwnerDraw = true; this.metroListView_Area.Size = new System.Drawing.Size(340, 560); @@ -79,6 +82,7 @@ // columnHeader_Area // this.columnHeader_Area.Text = "구역 이름"; + this.columnHeader_Area.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.columnHeader_Area.Width = 100; // // columnHeader_Type diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.cs index a4fe496..b544faa 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/AreaSettingControl.cs @@ -25,7 +25,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl typeString = "이용 불가"; break; - case EAreaType.Big: + case EAreaType.Large: typeString = "대형"; break; diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.Designer.cs index 0635211..90e4a73 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.Designer.cs @@ -32,13 +32,6 @@ this.metroLabel9 = new MetroFramework.Controls.MetroLabel(); this.metroTextBox_GarageName = new MetroFramework.Controls.MetroTextBox(); this.metroLabel13 = new MetroFramework.Controls.MetroLabel(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.metroLabel4 = new MetroFramework.Controls.MetroLabel(); - this.metroLabel15 = new MetroFramework.Controls.MetroLabel(); - this.metroTextBox_CargoOversizedMaxCount = new MetroFramework.Controls.MetroTextBox(); - this.metroTextBox_CargoLargeMaxCount = new MetroFramework.Controls.MetroTextBox(); - this.metroLabel16 = new MetroFramework.Controls.MetroLabel(); - this.metroLabel17 = new MetroFramework.Controls.MetroLabel(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); @@ -55,7 +48,6 @@ this.metroLabel21 = new MetroFramework.Controls.MetroLabel(); this.metroButton_init = new MetroFramework.Controls.MetroButton(); this.metroButton_Test = new MetroFramework.Controls.MetroButton(); - this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); this.SuspendLayout(); @@ -63,7 +55,7 @@ // metroButton_Save // this.metroButton_Save.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_Save.Location = new System.Drawing.Point(20, 420); + this.metroButton_Save.Location = new System.Drawing.Point(20, 407); this.metroButton_Save.Name = "metroButton_Save"; this.metroButton_Save.Size = new System.Drawing.Size(140, 40); this.metroButton_Save.TabIndex = 8; @@ -119,119 +111,6 @@ this.metroLabel13.Size = new System.Drawing.Size(0, 0); this.metroLabel13.TabIndex = 12; // - // groupBox1 - // - this.groupBox1.Controls.Add(this.metroLabel4); - this.groupBox1.Controls.Add(this.metroLabel15); - this.groupBox1.Controls.Add(this.metroTextBox_CargoOversizedMaxCount); - this.groupBox1.Controls.Add(this.metroTextBox_CargoLargeMaxCount); - this.groupBox1.Controls.Add(this.metroLabel16); - this.groupBox1.Controls.Add(this.metroLabel17); - this.groupBox1.Location = new System.Drawing.Point(20, 60); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(304, 100); - this.groupBox1.TabIndex = 19; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "이용 가능 대수"; - // - // metroLabel4 - // - this.metroLabel4.AutoSize = true; - this.metroLabel4.Location = new System.Drawing.Point(226, 64); - this.metroLabel4.Name = "metroLabel4"; - this.metroLabel4.Size = new System.Drawing.Size(23, 19); - this.metroLabel4.TabIndex = 14; - this.metroLabel4.Text = "대"; - // - // metroLabel15 - // - this.metroLabel15.AutoSize = true; - this.metroLabel15.Location = new System.Drawing.Point(226, 34); - this.metroLabel15.Name = "metroLabel15"; - this.metroLabel15.Size = new System.Drawing.Size(23, 19); - this.metroLabel15.TabIndex = 15; - this.metroLabel15.Text = "대"; - // - // metroTextBox_CargoOversizedMaxCount - // - // - // - // - this.metroTextBox_CargoOversizedMaxCount.CustomButton.Image = null; - this.metroTextBox_CargoOversizedMaxCount.CustomButton.Location = new System.Drawing.Point(78, 1); - this.metroTextBox_CargoOversizedMaxCount.CustomButton.Name = ""; - this.metroTextBox_CargoOversizedMaxCount.CustomButton.Size = new System.Drawing.Size(21, 21); - this.metroTextBox_CargoOversizedMaxCount.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; - this.metroTextBox_CargoOversizedMaxCount.CustomButton.TabIndex = 1; - this.metroTextBox_CargoOversizedMaxCount.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; - this.metroTextBox_CargoOversizedMaxCount.CustomButton.UseSelectable = true; - this.metroTextBox_CargoOversizedMaxCount.CustomButton.Visible = false; - this.metroTextBox_CargoOversizedMaxCount.Lines = new string[0]; - this.metroTextBox_CargoOversizedMaxCount.Location = new System.Drawing.Point(120, 60); - this.metroTextBox_CargoOversizedMaxCount.MaxLength = 32767; - this.metroTextBox_CargoOversizedMaxCount.Name = "metroTextBox_CargoOversizedMaxCount"; - this.metroTextBox_CargoOversizedMaxCount.PasswordChar = '\0'; - this.metroTextBox_CargoOversizedMaxCount.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.metroTextBox_CargoOversizedMaxCount.SelectedText = ""; - this.metroTextBox_CargoOversizedMaxCount.SelectionLength = 0; - this.metroTextBox_CargoOversizedMaxCount.SelectionStart = 0; - this.metroTextBox_CargoOversizedMaxCount.ShortcutsEnabled = true; - this.metroTextBox_CargoOversizedMaxCount.Size = new System.Drawing.Size(100, 23); - this.metroTextBox_CargoOversizedMaxCount.TabIndex = 13; - this.metroTextBox_CargoOversizedMaxCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.metroTextBox_CargoOversizedMaxCount.UseSelectable = true; - this.metroTextBox_CargoOversizedMaxCount.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); - this.metroTextBox_CargoOversizedMaxCount.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); - // - // metroTextBox_CargoLargeMaxCount - // - // - // - // - this.metroTextBox_CargoLargeMaxCount.CustomButton.Image = null; - this.metroTextBox_CargoLargeMaxCount.CustomButton.Location = new System.Drawing.Point(78, 1); - this.metroTextBox_CargoLargeMaxCount.CustomButton.Name = ""; - this.metroTextBox_CargoLargeMaxCount.CustomButton.Size = new System.Drawing.Size(21, 21); - this.metroTextBox_CargoLargeMaxCount.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; - this.metroTextBox_CargoLargeMaxCount.CustomButton.TabIndex = 1; - this.metroTextBox_CargoLargeMaxCount.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; - this.metroTextBox_CargoLargeMaxCount.CustomButton.UseSelectable = true; - this.metroTextBox_CargoLargeMaxCount.CustomButton.Visible = false; - this.metroTextBox_CargoLargeMaxCount.Lines = new string[0]; - this.metroTextBox_CargoLargeMaxCount.Location = new System.Drawing.Point(120, 30); - this.metroTextBox_CargoLargeMaxCount.MaxLength = 32767; - this.metroTextBox_CargoLargeMaxCount.Name = "metroTextBox_CargoLargeMaxCount"; - this.metroTextBox_CargoLargeMaxCount.PasswordChar = '\0'; - this.metroTextBox_CargoLargeMaxCount.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.metroTextBox_CargoLargeMaxCount.SelectedText = ""; - this.metroTextBox_CargoLargeMaxCount.SelectionLength = 0; - this.metroTextBox_CargoLargeMaxCount.SelectionStart = 0; - this.metroTextBox_CargoLargeMaxCount.ShortcutsEnabled = true; - this.metroTextBox_CargoLargeMaxCount.Size = new System.Drawing.Size(100, 23); - this.metroTextBox_CargoLargeMaxCount.TabIndex = 12; - this.metroTextBox_CargoLargeMaxCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.metroTextBox_CargoLargeMaxCount.UseSelectable = true; - this.metroTextBox_CargoLargeMaxCount.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); - this.metroTextBox_CargoLargeMaxCount.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); - // - // metroLabel16 - // - this.metroLabel16.AutoSize = true; - this.metroLabel16.Location = new System.Drawing.Point(30, 60); - this.metroLabel16.Name = "metroLabel16"; - this.metroLabel16.Size = new System.Drawing.Size(51, 19); - this.metroLabel16.TabIndex = 11; - this.metroLabel16.Text = "특대형"; - // - // metroLabel17 - // - this.metroLabel17.AutoSize = true; - this.metroLabel17.Location = new System.Drawing.Point(30, 30); - this.metroLabel17.Name = "metroLabel17"; - this.metroLabel17.Size = new System.Drawing.Size(51, 19); - this.metroLabel17.TabIndex = 10; - this.metroLabel17.Text = "대 형"; - // // groupBox2 // this.groupBox2.Controls.Add(this.metroLabel1); @@ -240,7 +119,7 @@ this.groupBox2.Controls.Add(this.metroTextBox_CargoLargeFee); this.groupBox2.Controls.Add(this.metroLabel5); this.groupBox2.Controls.Add(this.metroLabel6); - this.groupBox2.Location = new System.Drawing.Point(20, 180); + this.groupBox2.Location = new System.Drawing.Point(20, 167); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(302, 100); this.groupBox2.TabIndex = 20; @@ -353,7 +232,7 @@ this.groupBox3.Controls.Add(this.metroTextBox_CargoLargeCertificateFee); this.groupBox3.Controls.Add(this.metroLabel20); this.groupBox3.Controls.Add(this.metroLabel21); - this.groupBox3.Location = new System.Drawing.Point(20, 310); + this.groupBox3.Location = new System.Drawing.Point(20, 297); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(304, 100); this.groupBox3.TabIndex = 21; @@ -461,7 +340,7 @@ // metroButton_init // this.metroButton_init.FontSize = MetroFramework.MetroButtonSize.Tall; - this.metroButton_init.Location = new System.Drawing.Point(184, 420); + this.metroButton_init.Location = new System.Drawing.Point(184, 407); this.metroButton_init.Name = "metroButton_init"; this.metroButton_init.Size = new System.Drawing.Size(140, 40); this.metroButton_init.TabIndex = 22; @@ -471,7 +350,7 @@ // // metroButton_Test // - this.metroButton_Test.Location = new System.Drawing.Point(184, 466); + this.metroButton_Test.Location = new System.Drawing.Point(184, 453); this.metroButton_Test.Name = "metroButton_Test"; this.metroButton_Test.Size = new System.Drawing.Size(140, 23); this.metroButton_Test.TabIndex = 23; @@ -488,15 +367,12 @@ this.Controls.Add(this.metroButton_init); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); this.Controls.Add(this.metroLabel13); this.Controls.Add(this.metroTextBox_GarageName); this.Controls.Add(this.metroLabel9); this.Controls.Add(this.metroButton_Save); this.Name = "SettingControl"; this.Size = new System.Drawing.Size(346, 505); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.groupBox3.ResumeLayout(false); @@ -511,13 +387,6 @@ private MetroFramework.Controls.MetroLabel metroLabel9; private MetroFramework.Controls.MetroTextBox metroTextBox_GarageName; private MetroFramework.Controls.MetroLabel metroLabel13; - private System.Windows.Forms.GroupBox groupBox1; - private MetroFramework.Controls.MetroLabel metroLabel4; - private MetroFramework.Controls.MetroLabel metroLabel15; - private MetroFramework.Controls.MetroTextBox metroTextBox_CargoOversizedMaxCount; - private MetroFramework.Controls.MetroTextBox metroTextBox_CargoLargeMaxCount; - private MetroFramework.Controls.MetroLabel metroLabel16; - private MetroFramework.Controls.MetroLabel metroLabel17; private System.Windows.Forms.GroupBox groupBox2; private MetroFramework.Controls.MetroLabel metroLabel1; private MetroFramework.Controls.MetroLabel metroLabel2; diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs index 3724ac1..3b86843 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs @@ -17,8 +17,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl public void SettingReset() { metroTextBox_GarageName.Text = Global.GlobalSettings.GarageName.ToString(); - metroTextBox_CargoLargeMaxCount.Text = Global.GlobalSettings.CargoLargeMaxCount.ToString(); - metroTextBox_CargoOversizedMaxCount.Text = Global.GlobalSettings.CargoOversizedMaxCount.ToString(); metroTextBox_CargoLargeFee.Text = Global.GlobalSettings.CargoLargeFee.ToString(); metroTextBox_CargoOversizedFee.Text = Global.GlobalSettings.CargoOversizedFee.ToString(); @@ -39,11 +37,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl { reStart = true; } - int.TryParse(metroTextBox_CargoLargeMaxCount.Text, out value); - settings.CargoLargeMaxCount = value; - - int.TryParse(metroTextBox_CargoOversizedMaxCount.Text, out value); - settings.CargoOversizedMaxCount = value; int.TryParse(metroTextBox_CargoLargeFee.Text, out value); settings.CargoLargeFee = value; diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs index 99deed1..336f1ca 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/WaitingList.cs @@ -166,7 +166,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl return; } DateTime startDate = promotion.StartDate; - LeftAreaInformation leftAreaInformation = Database.GetLeftArea(startDate, Global.GlobalSettings.CargoLargeMaxCount, Global.GlobalSettings.CargoOversizedMaxCount); + LeftAreaInformation leftAreaInformation = Database.GetLeftArea(startDate); if (leftAreaInformation.Large.Count + leftAreaInformation.OverSized.Count == 0) { MetroMessageBox.Show(this, "남은 자리가 없습니다", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -257,7 +257,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl } DateTime startDate = promotion.StartDate; EVehicleType eVehicleType = Database.GetApplicantVehicleType(no); - LeftAreaInformation leftAreaInformation = Database.GetLeftArea(startDate, Global.GlobalSettings.CargoLargeMaxCount, Global.GlobalSettings.CargoOversizedMaxCount); + LeftAreaInformation leftAreaInformation = Database.GetLeftArea(startDate); List leftArea = eVehicleType == EVehicleType.Large_Up || eVehicleType == EVehicleType.Large_Down ? leftAreaInformation.Large : leftAreaInformation.OverSized; if (leftArea.Count == 0) { diff --git a/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs b/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs index 2b6d17b..5c6ed82 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/DataModel.cs @@ -188,8 +188,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program public struct Settings { public string GarageName { get; set; } - public int CargoLargeMaxCount { get; set; } - public int CargoOversizedMaxCount { get; set; } public int CargoLargeFee { get; set; } public int CargoOversizedFee { get; set; } public int CargoLargeCertificateFee { get; set; } @@ -205,7 +203,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program public enum EAreaType { None, // 이용 불가 - Big, // 대형 + Large, // 대형 OverSized // 특대형 } public enum EProceedsType diff --git a/HSUCO_Cargo_Garage_Operation_Program/Database.cs b/HSUCO_Cargo_Garage_Operation_Program/Database.cs index d8eb138..6f3f353 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Database.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Database.cs @@ -474,6 +474,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program public static List GetUserList() { + // Area 데이터를 가지고 있는다 var users = new List(); string query = "SELECT * From ViewUserList"; @@ -488,7 +489,8 @@ namespace HSUCO_Cargo_Garage_Operation_Program var user = new UserInformation(); user.No = (reader["No"].ToString()); - user.Area = reader["Area"].ToString(); + int areaNo = Convert.ToInt32(reader["Area"].ToString()); + user.Area = GetAreaName(areaNo); user.ApplicantNo = reader["ApplicantNo"].ToString(); user.ApplicantDate = DateTime.Parse(reader["ApplicantDate"].ToString(), new CultureInfo("ko-KR")); user.Owner = (EOwner)int.Parse(reader["Owner"].ToString()); @@ -513,6 +515,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program } } } + for (int i = 0; i < users.Count; i++) { query = $"SELECT * From UserListHistory Where UserNo='{users[i].No}' Order By HistoryCode,HistoryDate ASC"; @@ -1105,6 +1108,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program public static CertificateInformation GetUserCertificate(string no) { + List areaSettings = GetAreaSettings(); CertificateInformation certificateInformation = new CertificateInformation(); var query = $"SELECT * FROM ViewUserList Where No='{no}'"; @@ -1120,7 +1124,8 @@ namespace HSUCO_Cargo_Garage_Operation_Program certificateInformation.PersonalNumber = reader["PersonalNumber"].ToString(); certificateInformation.Address = reader["Address"].ToString(); certificateInformation.CargoVehicleNumber = reader["CargoVehicleNumber"].ToString(); - certificateInformation.Area = reader["Area"].ToString(); + int areaNo = Convert.ToInt32(reader["Area"].ToString()); + certificateInformation.Area = GetAreaName(areaNo); certificateInformation.StartDate = DateTime.Parse(reader["DateStart"].ToString()); certificateInformation.EndDate = DateTime.Parse(reader["DateEnd"].ToString()); } @@ -1330,20 +1335,14 @@ namespace HSUCO_Cargo_Garage_Operation_Program return (EVehicleType)type; } - public static LeftAreaInformation GetLeftArea(DateTime startDateTime, int large, int overSized) + public static LeftAreaInformation GetLeftArea(DateTime startDateTime) { LeftAreaInformation leftAreaInformation = new LeftAreaInformation(); leftAreaInformation.StartDateTime = startDateTime; leftAreaInformation.Large = new List(); leftAreaInformation.OverSized = new List(); - for (int i = 1; i < large + 1; i++) - { - leftAreaInformation.Large.Add(i); - } - for (int i = 1; i < overSized + 1; i++) - { - leftAreaInformation.OverSized.Add(i); - } + List areaSettings = GetAreaSettings(); + var query = $"SELECT Area FROM UserList Where DateEnd > '{startDateTime.Date.DateTimeDatabase()}' And PaymentStatus < {(int)EPaymentStatus.Refund}"; using (var command = _sqLiteConnection.CreateCommand()) @@ -1354,25 +1353,31 @@ namespace HSUCO_Cargo_Garage_Operation_Program { while (reader.Read()) { - string tempString = reader["Area"].ToString(); - // 대형, 특대형 - 를 기준으로 자름 - int index = tempString.IndexOf('-'); - string tempType = tempString.Substring(0, index); - string tempArea = tempString.Substring(index + 1, tempString.Length - index - 1); - switch (tempType) + int area = Convert.ToInt32(reader["Area"].ToString()); + for (int i = 0; i < areaSettings.Count; i++) { - case "대형": - leftAreaInformation.Large.Remove(int.Parse(tempArea)); - - break; - - case "특대형": - leftAreaInformation.OverSized.Remove(int.Parse(tempArea)); + if (areaSettings[i].No == area) + { + areaSettings.RemoveAt(i); break; + } } } } } + foreach (var areaSetting in areaSettings) + { + switch(areaSetting.AreaType) + { + case EAreaType.Large: + leftAreaInformation.Large.Add(areaSetting.No); + break; + + case EAreaType.OverSized: + leftAreaInformation.OverSized.Add(areaSetting.No); + break; + } + } return leftAreaInformation; } @@ -1454,16 +1459,6 @@ namespace HSUCO_Cargo_Garage_Operation_Program settings.GarageName = value; break; - case "CargoLargeMaxCount": - int.TryParse(value, out intValue); - settings.CargoLargeMaxCount = intValue; - break; - - case "CargoOversizedMaxCount": - int.TryParse(value, out intValue); - settings.CargoOversizedMaxCount = intValue; - break; - case "CargoLargeFee": int.TryParse(value, out intValue); settings.CargoLargeFee = intValue; @@ -1499,7 +1494,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program if (settings.GarageName != originalSettings.GarageName) { var query = - $"INSERT INTO Settings VALUES('GarageName','{settings.GarageName}','{DateTime.Now.ToString()}') "; + $"INSERT INTO Settings VALUES('GarageName','{settings.GarageName}','{DateTime.Now.DateTimeDatabase()}') "; using (var insertCommand = _sqLiteConnection.CreateCommand()) { insertCommand.CommandText = query; @@ -1507,31 +1502,10 @@ namespace HSUCO_Cargo_Garage_Operation_Program } } - if (settings.CargoLargeMaxCount != originalSettings.CargoLargeMaxCount) - { - var query = - $"INSERT INTO Settings VALUES('CargoLargeMaxCount','{settings.CargoLargeMaxCount}','{DateTime.Now.ToString()}') "; - using (var insertCommand = _sqLiteConnection.CreateCommand()) - { - insertCommand.CommandText = query; - insertCommand.ExecuteNonQuery(); - } - } - - if (settings.CargoOversizedMaxCount != originalSettings.CargoOversizedMaxCount) - { - var query = - $"INSERT INTO Settings VALUES('CargoOversizedMaxCount','{settings.CargoOversizedMaxCount}','{DateTime.Now.ToString()}') "; - using (var insertCommand = _sqLiteConnection.CreateCommand()) - { - insertCommand.CommandText = query; - insertCommand.ExecuteNonQuery(); - } - } if (settings.CargoLargeFee != originalSettings.CargoLargeFee) { var query = - $"INSERT INTO Settings VALUES('CargoLargeFee','{settings.CargoLargeFee}','{DateTime.Now.ToString()}') "; + $"INSERT INTO Settings VALUES('CargoLargeFee','{settings.CargoLargeFee}','{DateTime.Now.DateTimeDatabase()}') "; using (var insertCommand = _sqLiteConnection.CreateCommand()) { insertCommand.CommandText = query; @@ -1541,7 +1515,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program if (settings.CargoOversizedFee != originalSettings.CargoOversizedFee) { var query = - $"INSERT INTO Settings VALUES('CargoOversizedFee','{settings.CargoOversizedFee}','{DateTime.Now.ToString()}') "; + $"INSERT INTO Settings VALUES('CargoOversizedFee','{settings.CargoOversizedFee}','{DateTime.Now.DateTimeDatabase()}') "; using (var insertCommand = _sqLiteConnection.CreateCommand()) { insertCommand.CommandText = query; @@ -1552,7 +1526,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program if (settings.CargoLargeCertificateFee != originalSettings.CargoLargeCertificateFee) { var query = - $"INSERT INTO Settings VALUES('CargoLargeCertificateFee','{settings.CargoLargeCertificateFee}','{DateTime.Now.ToString()}') "; + $"INSERT INTO Settings VALUES('CargoLargeCertificateFee','{settings.CargoLargeCertificateFee}','{DateTime.Now.DateTimeDatabase()}') "; using (var insertCommand = _sqLiteConnection.CreateCommand()) { insertCommand.CommandText = query; @@ -1563,7 +1537,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program if (settings.CargoOversizedCertificateFee != originalSettings.CargoOversizedCertificateFee) { var query = - $"INSERT INTO Settings VALUES('CargoOversizedCertificateFee','{settings.CargoOversizedCertificateFee}','{DateTime.Now.ToString()}') "; + $"INSERT INTO Settings VALUES('CargoOversizedCertificateFee','{settings.CargoOversizedCertificateFee}','{DateTime.Now.DateTimeDatabase()}') "; using (var insertCommand = _sqLiteConnection.CreateCommand()) { insertCommand.CommandText = query; @@ -1646,6 +1620,24 @@ namespace HSUCO_Cargo_Garage_Operation_Program } return areaSettings; } + public static string GetAreaName(int no) + { + string areaName = string.Empty; + var query = "SELECT AreaName FROM AreaSetting WHERE No=@no"; + using (var command = _sqLiteConnection.CreateCommand()) + { + command.CommandText = query; + command.Parameters.AddWithValue("@no", no); + using (var reader = command.ExecuteReader()) + { + while(reader.Read()) + { + areaName = reader["AreaName"].ToString(); + } + } + } + return areaName; + } #endregion AreaSetting } diff --git a/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs index bcb5f6a..b12c811 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Master.Designer.cs @@ -74,7 +74,7 @@ this.metroTabControl_Main.Dock = System.Windows.Forms.DockStyle.Fill; this.metroTabControl_Main.Location = new System.Drawing.Point(20, 60); this.metroTabControl_Main.Name = "metroTabControl_Main"; - this.metroTabControl_Main.SelectedIndex = 0; + this.metroTabControl_Main.SelectedIndex = 1; this.metroTabControl_Main.Size = new System.Drawing.Size(984, 688); this.metroTabControl_Main.TabIndex = 0; this.metroTabControl_Main.UseSelectable = true; @@ -121,7 +121,7 @@ this.metroTabControl_Applicant.Dock = System.Windows.Forms.DockStyle.Fill; this.metroTabControl_Applicant.Location = new System.Drawing.Point(0, 0); this.metroTabControl_Applicant.Name = "metroTabControl_Applicant"; - this.metroTabControl_Applicant.SelectedIndex = 0; + this.metroTabControl_Applicant.SelectedIndex = 3; this.metroTabControl_Applicant.Size = new System.Drawing.Size(976, 646); this.metroTabControl_Applicant.TabIndex = 0; this.metroTabControl_Applicant.UseSelectable = true; @@ -261,6 +261,7 @@ // // areaSettingControl1 // + this.areaSettingControl1.BackColor = System.Drawing.Color.White; this.areaSettingControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.areaSettingControl1.Location = new System.Drawing.Point(0, 0); this.areaSettingControl1.Name = "areaSettingControl1";