feat: 제품 시리얼 번호 입력 시 (실제)제조일자 저장

This commit is contained in:
kje97 2025-06-26 13:55:14 +09:00
parent 56f310d888
commit c273525ae7
2 changed files with 866 additions and 482 deletions

File diff suppressed because it is too large Load Diff

View File

@ -408,6 +408,11 @@ Public Class MainForm
ModeEnable()
DataSetting()
ComboBoxSetting()
txtManufactureDate.ReadOnly = True
txtManufactureDate.BackColor = Color.Lavender
UpdateDateTextBox()
For i = SaveList.Info To SaveList.MaxSave - 1
OptionLoad(i)
Next
@ -419,6 +424,50 @@ Public Class MainForm
txbPVSN.Focus()
End Sub
Private Sub ComboBoxSetting()
' 년도 콤보박스 (: 2020~2030)
For i As Integer = 2020 To 2030
cmbYear.Items.Add(i.ToString())
Next
' 콤보박스 (1~12)
For i As Integer = 1 To 12
cmbMonth.Items.Add(i.ToString("00"))
Next
' 콤보박스 (1~31)
For i As Integer = 1 To 31
cmbDay.Items.Add(i.ToString("00"))
Next
' 기본값 설정 (오늘 날짜)
cmbYear.Text = DateTime.Now.Year.ToString()
cmbMonth.Text = DateTime.Now.Month.ToString("00")
cmbDay.Text = DateTime.Now.Day.ToString("00")
End Sub
Private Sub UpdateDateTextBox()
If cmbYear.Text <> "" And cmbMonth.Text <> "" And cmbDay.Text <> "" Then
txtManufactureDate.Text = cmbYear.Text & "-" & cmbMonth.Text.PadLeft(2, "0"c) & "-" & cmbDay.Text.PadLeft(2, "0"c)
Else
txtManufactureDate.Text = ""
End If
End Sub
Private Sub cmbYear_SelectedIndexChanged() Handles cmbYear.SelectedIndexChanged
UpdateDateTextBox()
End Sub
Private Sub cmbMonth_SelectedIndexChanged() Handles cmbMonth.SelectedIndexChanged
UpdateDateTextBox()
End Sub
Private Sub cmbDay_SelectedIndexChanged() Handles cmbDay.SelectedIndexChanged
UpdateDateTextBox()
End Sub
Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If UserLogOut() Then
End
@ -1301,10 +1350,10 @@ FinishFunc:
If TDUseCompare = True Then
DBCheck = "UPDATE " & ApplyCartDB & " SET Product_SN = null WHERE PV_SN = '" & txbTDNum.Text & "'"
DBCmd = "UPDATE " & ApplyCartDB & " SET TestStep = '31', Product_SN = '" & SerialNum & "', Ct_Manufacture_Name='" & Factory & "', Ct_Manufacture_Year='" & Format(Now, "yy") & "', Ct_Manufacture_Month='" & Format(Now, "MM") & "', Ct_SN='" & ProdCode & "', Ct_Model='" & txbPDModel.Text & "', Ct_Type='" & txbPDType.Text & "', Ct_Abroad='" & Country & "', Ct_Agency='" & Agency & "',Ct_Max_ShotCnt = '" & ShotCount & "', Ct_Remain_ShotCnt = '" & ShotCount & "', P3_DateTime = '" & Format(Now, "yyyy-MM-dd HH:mm:ss") & "' WHERE PV_SN = '" & txbTDNum.Text & "'"
DBCmd = "UPDATE " & ApplyCartDB & " SET TestStep = '31', Product_SN = '" & SerialNum & "', Ct_Manufacture_Name='" & Factory & "', Ct_Manufacture_Year='" & Format(Now, "yy") & "', Ct_Manufacture_Month='" & Format(Now, "MM") & "', Ct_SN='" & ProdCode & "', Ct_Model='" & txbPDModel.Text & "', Ct_Type='" & txbPDType.Text & "', Ct_Abroad='" & Country & "', Ct_Agency='" & Agency & "',Ct_Max_ShotCnt = '" & ShotCount & "', Ct_Remain_ShotCnt = '" & ShotCount & "', P3_DateTime = '" & Format(Now, "yyyy-MM-dd HH:mm:ss") & "', Manufacture_Date ='" & txtManufactureDate.Text & "' WHERE PV_SN = '" & txbTDNum.Text & "'"
Else
DBCheck = "UPDATE " & ApplyNonTDDB & " SET Product_SN = null WHERE PV_SN = '" & txbTDNum.Text & "'"
DBCmd = "UPDATE " & ApplyNonTDDB & " SET TestStep = '31', Product_SN = '" & SerialNum & "', Ct_Manufacture_Name='" & Factory & "', Ct_Manufacture_Year='" & Format(Now, "yy") & "', Ct_Manufacture_Month='" & Format(Now, "MM") & "', Ct_SN='" & ProdCode & "', Ct_Model='" & txbPDModel.Text & "', Ct_Type='" & txbPDType.Text & "', Ct_Abroad='" & Country & "', Ct_Agency='" & Agency & "', P3_DateTime = '" & Format(Now, "yyyy-MM-dd HH:mm:ss") & "' WHERE PV_SN = '" & txbTDNum.Text & "'"
DBCmd = "UPDATE " & ApplyNonTDDB & " SET TestStep = '31', Product_SN = '" & SerialNum & "', Ct_Manufacture_Name='" & Factory & "', Ct_Manufacture_Year='" & Format(Now, "yy") & "', Ct_Manufacture_Month='" & Format(Now, "MM") & "', Ct_SN='" & ProdCode & "', Ct_Model='" & txbPDModel.Text & "', Ct_Type='" & txbPDType.Text & "', Ct_Abroad='" & Country & "', Ct_Agency='" & Agency & "', P3_DateTime = '" & Format(Now, "yyyy-MM-dd HH:mm:ss") & "', Manufacture_Date ='" & txtManufactureDate.Text & "' WHERE PV_SN = '" & txbTDNum.Text & "'"
End If
If DBCommand(DBCheck) Then
@ -3038,9 +3087,6 @@ FailLoad:
If BeforeTrayData(NowDate, NowTime) Then
TrayEndUpdate(NowDate, NowTime)
End If
End Sub
Private Function BeforeTrayData(NowYear As Int16, NowMonth As Int16) As Boolean