From 7c8ad26642902f999276702ee680f06c70fdb79d Mon Sep 17 00:00:00 2001 From: Crudelis Date: Fri, 6 Oct 2023 15:16:36 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 접수시 차량 기본 선택 2. 추첨 결과시 오타 수정 3. 설정 저장시 메세지 출력 4. 신청자 수가 10이상 넘어가면 발생하는 버그 수정 5. 추첨시 데이터베이스 버그 수정 6. 추첨 완료시 남은 사람들 대기자 이동 버그 수정 --- .../CustomForm/InsertResult.cs | 2 +- .../CustomForm/LotsScreen.cs | 54 +++++++++---------- .../ApplicantControl.Designer.cs | 1 + .../CustomUserControl/ApplicantControl.cs | 5 ++ .../CustomUserControl/SettingControl.cs | 2 + .../Database.cs | 9 ++-- 6 files changed, 40 insertions(+), 33 deletions(-) diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/InsertResult.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/InsertResult.cs index 9ac5726..be4fceb 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/InsertResult.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/InsertResult.cs @@ -25,7 +25,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm dataTable.Columns.Add("이용자번호"); - dataTable.Columns.Add("접 수번호"); + dataTable.Columns.Add("접수번호"); for (int i = 0; i < _resultSetUserListInformation.Count; i++) diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/LotsScreen.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/LotsScreen.cs index cb23570..2fecd4a 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomForm/LotsScreen.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomForm/LotsScreen.cs @@ -25,25 +25,25 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm this.ClientSize = new Size(fullScrenn_bounds.Width, fullScrenn_bounds.Height); this.Location = new Point(fullScrenn_bounds.Left, fullScrenn_bounds.Top); //this.TopMost = true; - + int baseMargin = 5; // 내부 각테두리의 여백 사이즈 int controlWidth = 340 + 5; // Lot 컨트롤러 가로사이즈 + 여백 int controlHeight = 90 + 5; // Lot 컨트롤러 세로사이즈 + 여백 int tempSize = 0; // 임시 연상용 사이즈 int widthCount = 0; // 가로 최종 갯수 - while(true) + while (true) { widthCount++; tempSize = baseMargin + (controlWidth * (widthCount)); - if(tempSize > this.flowLayoutPanel_Lots.Size.Width) + if (tempSize > this.flowLayoutPanel_Lots.Size.Width) { widthCount--; break; } - + } - int heightCount=0; // 세로 최종 갯수 - while(true) + int heightCount = 0; // 세로 최종 갯수 + while (true) { heightCount++; tempSize = baseMargin + (controlHeight * (heightCount)); @@ -52,29 +52,29 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm heightCount--; break; } - + } pageMax = widthCount * heightCount; // 한페이지에 표시가능한 총 갯수 - if(pageMax < _resultSetUserLists.Count) + if (pageMax < _resultSetUserLists.Count) { totalPage = _resultSetUserLists.Count / pageMax; - if(_resultSetUserLists.Count % pageMax != 0) + if (_resultSetUserLists.Count % pageMax != 0) { totalPage++; } - + Timer timer = new Timer(); timer.Interval = 5000; //5초 timer.Tick += Timer_Tick; timer.Start(); - + } ViewChange(); - - - + + + } @@ -82,7 +82,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm { ViewChange(); - + } private void ViewChange() { @@ -92,43 +92,41 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomForm nowPage = 1; } label_Page.Text = $"{nowPage}/{totalPage}"; - if (totalPage ==1) + if (totalPage == 1) { for (int i = 0; i < _resultSetUserLists.Count; i++) - + { - List lots = new List(); CustomUserControl.Lot lot = new CustomUserControl.Lot(_resultSetUserLists[i].Area, _resultSetUserLists[i].ApplicantNo); - lots.Add(lot); - flowLayoutPanel_Lots.Controls.Add(lots[i]); + flowLayoutPanel_Lots.Controls.Add(lot); } } else { - + this.flowLayoutPanel_Lots.Controls.Clear(); int totalCount = _resultSetUserLists.Count; int limit = nowPage * (pageMax); - + if (limit > _resultSetUserLists.Count) { limit = _resultSetUserLists.Count; } int start = (nowPage - 1) * pageMax; - + for (int i = start; i < limit; i++) { - + CustomUserControl.Lot lot = new CustomUserControl.Lot(_resultSetUserLists[i].Area, _resultSetUserLists[i].ApplicantNo); - + flowLayoutPanel_Lots.Controls.Add(lot); } - + } - - + + } private void button_Close_Click(object sender, EventArgs e) { diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.Designer.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.Designer.cs index 0882316..f9bd994 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.Designer.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.Designer.cs @@ -453,6 +453,7 @@ this.Margin = new System.Windows.Forms.Padding(0); this.Name = "ApplicantControl"; this.Size = new System.Drawing.Size(480, 480); + this.Load += new System.EventHandler(this.ApplicantControl_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.ResumeLayout(false); diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.cs index e973f87..179e801 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/ApplicantControl.cs @@ -156,5 +156,10 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl metroTextBox_CargoVehicleNumber.Focus(); } + + private void ApplicantControl_Load(object sender, EventArgs e) + { + metroComboBox_VehicleType.SelectedIndex = 0; + } } } \ No newline at end of file diff --git a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs index 8f264a5..7e01711 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/CustomUserControl/SettingControl.cs @@ -1,4 +1,5 @@ using HSUCO_Cargo_Garage_Operation_Program.CustomForm; +using MetroFramework; using System; using System.Collections.Generic; using System.Windows.Forms; @@ -61,6 +62,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program.CustomUserControl private void metroButton_init_Click(object sender, EventArgs e) { SettingReset(); + MetroMessageBox.Show(this, "설정어 완료되었습니다.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void metroButton_Test_Click(object sender, EventArgs e) diff --git a/HSUCO_Cargo_Garage_Operation_Program/Database.cs b/HSUCO_Cargo_Garage_Operation_Program/Database.cs index 9089bdc..54fcd5e 100644 --- a/HSUCO_Cargo_Garage_Operation_Program/Database.cs +++ b/HSUCO_Cargo_Garage_Operation_Program/Database.cs @@ -765,7 +765,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program // 남은 사람 대기로 - query = $"UPDATE ApplicantList SET ApplicantType={(int)EApplicantType.LotsOut} Where ApplicantType={(int)EApplicantType.Lots}"; + query = $"UPDATE ApplicantList SET ApplicantType={(int)EApplicantType.LotsOut} Where ApplicantType={(int)EApplicantType.Lots} And RegistrationStatus={(int)ERegistrationStatus.Wait}"; using (var command = _sqLiteConnection.CreateCommand()) { command.CommandText = query; @@ -847,14 +847,14 @@ namespace HSUCO_Cargo_Garage_Operation_Program for (int i = 0; i < setUserListInformation.Count; i++) { string query = $"INSERT INTO UserList(No, Area, ApplicantNo, ApplicantDate, UID, Date, DateStart, DateEnd, ExtensionStatus, PaymentStatus) " + - $"VALUES('{noPrefix + lastNo}','{setUserListInformation[i].Area}','{setUserListInformation[i].ApplicantNo}','{setUserListInformation[i].Date}',{setUserListInformation[i].UID},'{startDate.DateOnly()}','{endDate.DateOnly()}',0,{(int)EPaymentStatus.StandBy})"; + $"VALUES('{noPrefix + lastNo}','{setUserListInformation[i].Area}','{setUserListInformation[i].ApplicantNo}','{setUserListInformation[i].Date.DateTimeDatabase()}',{setUserListInformation[i].UID},'{DateTime.Now.DateTimeDatabase()}','{startDate.DateOnly()}','{endDate.DateOnly()}',0,{(int)EPaymentStatus.StandBy})"; using (var command = _sqLiteConnection.CreateCommand()) { command.CommandText = query; command.ExecuteNonQuery(); } - query = $"UPDATE ApplicantList SET RegistrationStatus={(int)ERegistrationStatus.Registration} Where No={setUserListInformation[i].ApplicantNo}"; + query = $"UPDATE ApplicantList SET RegistrationStatus={(int)ERegistrationStatus.Registration} Where No='{setUserListInformation[i].ApplicantNo}'"; using (var command = _sqLiteConnection.CreateCommand()) { command.CommandText = query; @@ -1036,7 +1036,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program suffix = "C"; break; } - var query = $"SELECT No FROM {tableName} Where No Like '{year}-{suffix}%' Order By No DESC LIMIT 1"; + var query = $"SELECT No FROM {tableName} Where No Like '{year}-{suffix}%' Order By CAST(substr(No,7) as INTEGER) DESC LIMIT 1"; var lastNo = 0; using (var command = _sqLiteConnection.CreateCommand()) { @@ -1101,6 +1101,7 @@ namespace HSUCO_Cargo_Garage_Operation_Program public static LeftAreaInformation GetLeftArea(DateTime startDateTime, int large, int overSized) { LeftAreaInformation leftAreaInformation = new LeftAreaInformation(); + leftAreaInformation.StartDateTime = startDateTime; leftAreaInformation.Large = new List(); leftAreaInformation.OverSized = new List(); for (int i = 1; i < large + 1; i++)