feat: 제품 시리얼 번호 입력 시 (실제)제조일자 저장/확인
This commit is contained in:
parent
ac98691c8b
commit
1b5ff3cb49
2446
MainForm.Designer.vb
generated
2446
MainForm.Designer.vb
generated
File diff suppressed because it is too large
Load Diff
171
MainForm.vb
171
MainForm.vb
@ -111,6 +111,10 @@ Public Class MainForm
|
||||
Public gpbIQCInfo(DS_TYPE.MAX_DS_TYPE_NUM) As GroupBox
|
||||
|
||||
|
||||
Public cmbInfo_Year(DS_TYPE.MAX_DS_TYPE_NUM) As ComboBox
|
||||
Public cmbInfo_Month(DS_TYPE.MAX_DS_TYPE_NUM) As ComboBox
|
||||
Public cmbInfo_Day(DS_TYPE.MAX_DS_TYPE_NUM) As ComboBox
|
||||
|
||||
Public txbProductCntPro(4) As TextBox
|
||||
Public txbProductCntLux(4) As TextBox
|
||||
|
||||
@ -223,6 +227,89 @@ Public Class MainForm
|
||||
TH_print.IsBackground = True
|
||||
active_onoff = True
|
||||
End Sub
|
||||
|
||||
Private Sub DateComboBox_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Try
|
||||
Dim combo As ComboBox = DirectCast(sender, ComboBox)
|
||||
|
||||
' 년도나 월이 변경되면 일 콤보박스 업데이트
|
||||
For i As Integer = DS_TYPE.DS_DEV To DS_TYPE.DS_BODY
|
||||
If combo Is cmbInfo_Year(i) Or combo Is cmbInfo_Month(i) Then
|
||||
UpdateDayComboBox(i)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
Console.WriteLine("DateComboBox_SelectedIndexChanged Error: " & ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
' 일 콤보박스를 년월에 맞게 업데이트하는 메서드
|
||||
Private Sub UpdateDayComboBox(deviceType As Integer)
|
||||
Try
|
||||
If cmbInfo_Year(deviceType) Is Nothing Or cmbInfo_Month(deviceType) Is Nothing Or cmbInfo_Day(deviceType) Is Nothing Then
|
||||
Return
|
||||
End If
|
||||
|
||||
If cmbInfo_Year(deviceType).SelectedItem Is Nothing Or cmbInfo_Month(deviceType).SelectedItem Is Nothing Then
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim selectedYear As Integer = CInt(cmbInfo_Year(deviceType).SelectedItem.ToString())
|
||||
Dim selectedMonth As Integer = CInt(cmbInfo_Month(deviceType).SelectedItem.ToString())
|
||||
|
||||
' 현재 선택된 일자 저장
|
||||
Dim currentSelectedDay As String = ""
|
||||
If cmbInfo_Day(deviceType).SelectedItem IsNot Nothing Then
|
||||
currentSelectedDay = cmbInfo_Day(deviceType).SelectedItem.ToString()
|
||||
End If
|
||||
|
||||
' 해당 년월의 마지막 날짜 계산
|
||||
Dim daysInMonth As Integer = DateTime.DaysInMonth(selectedYear, selectedMonth)
|
||||
|
||||
' 일 콤보박스 다시 설정
|
||||
cmbInfo_Day(deviceType).Items.Clear()
|
||||
For day As Integer = 1 To daysInMonth
|
||||
cmbInfo_Day(deviceType).Items.Add(day.ToString("00"))
|
||||
Next
|
||||
|
||||
' 이전에 선택된 일자가 유효하면 다시 선택, 아니면 현재 날짜 또는 1일로 설정
|
||||
If Not String.IsNullOrEmpty(currentSelectedDay) AndAlso CInt(currentSelectedDay) <= daysInMonth Then
|
||||
cmbInfo_Day(deviceType).SelectedItem = currentSelectedDay
|
||||
ElseIf DateTime.Now.Year = selectedYear AndAlso DateTime.Now.Month = selectedMonth Then
|
||||
cmbInfo_Day(deviceType).SelectedItem = DateTime.Now.Day.ToString("00")
|
||||
Else
|
||||
cmbInfo_Day(deviceType).SelectedIndex = 0 ' 첫 번째 항목 선택
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
Console.WriteLine("UpdateDayComboBox Error: " & ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Function GetSelectedDate(deviceType As Integer) As String
|
||||
Try
|
||||
If cmbInfo_Year(deviceType) IsNot Nothing AndAlso cmbInfo_Year(deviceType).SelectedItem IsNot Nothing AndAlso
|
||||
cmbInfo_Month(deviceType) IsNot Nothing AndAlso cmbInfo_Month(deviceType).SelectedItem IsNot Nothing AndAlso
|
||||
cmbInfo_Day(deviceType) IsNot Nothing AndAlso cmbInfo_Day(deviceType).SelectedItem IsNot Nothing Then
|
||||
|
||||
' 2자리 년도를 4자리로 변환 (25 -> 2025)
|
||||
Dim twoDigitYear As String = cmbInfo_Year(deviceType).SelectedItem.ToString()
|
||||
Dim fourDigitYear As String = "20" & twoDigitYear
|
||||
|
||||
Return fourDigitYear & "-" &
|
||||
cmbInfo_Month(deviceType).SelectedItem.ToString().PadLeft(2, "0"c) & "-" &
|
||||
cmbInfo_Day(deviceType).SelectedItem.ToString().PadLeft(2, "0"c)
|
||||
End If
|
||||
Return ""
|
||||
Catch ex As Exception
|
||||
Console.WriteLine("GetSelectedDate Error: " & ex.Message)
|
||||
Return ""
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub SetFormLoad(Type As FORM_TYPE)
|
||||
Me.Hide()
|
||||
Me.Text = PROGRAM_TITLE_NAME
|
||||
@ -413,6 +500,43 @@ Public Class MainForm
|
||||
|
||||
pnlCart(i).Visible = False
|
||||
pnlDate(i).Visible = False
|
||||
|
||||
If cmbInfo_Year(i) IsNot Nothing Then
|
||||
cmbInfo_Year(i).Items.Clear()
|
||||
Dim currentYear As Integer = DateTime.Now.Year
|
||||
For year As Integer = currentYear - 5 To currentYear + 5
|
||||
' 2자리 년도로 표시 (2025 -> 25)
|
||||
cmbInfo_Year(i).Items.Add(year.ToString().Substring(2, 2))
|
||||
Next
|
||||
' 현재 년도를 2자리로 선택
|
||||
cmbInfo_Year(i).SelectedItem = currentYear.ToString().Substring(2, 2)
|
||||
End If
|
||||
|
||||
' 월 콤보박스 초기화 (1~12월)
|
||||
If cmbInfo_Month(i) IsNot Nothing Then
|
||||
cmbInfo_Month(i).Items.Clear()
|
||||
For month As Integer = 1 To 12
|
||||
cmbInfo_Month(i).Items.Add(month.ToString("00"))
|
||||
Next
|
||||
cmbInfo_Month(i).SelectedItem = DateTime.Now.Month.ToString("00")
|
||||
End If
|
||||
|
||||
' 일 콤보박스 초기화 (현재 선택된 년월에 맞는 일수로 동적 설정)
|
||||
If cmbInfo_Day(i) IsNot Nothing Then
|
||||
UpdateDayComboBox(i)
|
||||
End If
|
||||
|
||||
''=== 콤보박스 이벤트 핸들러 연결 ===
|
||||
If cmbInfo_Year(i) IsNot Nothing Then
|
||||
AddHandler cmbInfo_Year(i).SelectedIndexChanged, AddressOf DateComboBox_SelectedIndexChanged
|
||||
End If
|
||||
If cmbInfo_Month(i) IsNot Nothing Then
|
||||
AddHandler cmbInfo_Month(i).SelectedIndexChanged, AddressOf DateComboBox_SelectedIndexChanged
|
||||
End If
|
||||
If cmbInfo_Day(i) IsNot Nothing Then
|
||||
AddHandler cmbInfo_Day(i).SelectedIndexChanged, AddressOf DateComboBox_SelectedIndexChanged
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
pnlDevTDSN.Visible = False
|
||||
@ -614,6 +738,9 @@ Public Class MainForm
|
||||
pnlFW(DS_TYPE.DS_DEV).Visible = True
|
||||
pnlRshot(DS_TYPE.DS_DEV).Visible = False
|
||||
pnlTshot(DS_TYPE.DS_DEV).Visible = False
|
||||
PanelFaceDate.Visible = False
|
||||
PanelDevDate.Visible = False
|
||||
PanelEyeDate.Visible = False
|
||||
|
||||
''생산수량카운터창
|
||||
gpbOKCnt.Visible = False
|
||||
@ -1038,6 +1165,23 @@ Public Class MainForm
|
||||
txbInfo_IQCCap(DS_TYPE.DS_FACE) = txbInfo_FaceIQCCap
|
||||
txbInfo_IQCCap(DS_TYPE.DS_EYE) = txbInfo_EyeIQCCap
|
||||
txbInfo_IQCCap(DS_TYPE.DS_BODY) = txbInfo_FaceIQCCap
|
||||
|
||||
''=== 년월일 콤보박스 바인딩 ===
|
||||
cmbInfo_Year(DS_TYPE.DS_DEV) = cmbInfo_DevYear
|
||||
cmbInfo_Year(DS_TYPE.DS_FACE) = cmbInfo_FaceYear
|
||||
cmbInfo_Year(DS_TYPE.DS_EYE) = cmbInfo_EyeYear
|
||||
cmbInfo_Year(DS_TYPE.DS_BODY) = cmbInfo_FaceYear
|
||||
|
||||
cmbInfo_Month(DS_TYPE.DS_DEV) = cmbInfo_DevMonth
|
||||
cmbInfo_Month(DS_TYPE.DS_FACE) = cmbInfo_FaceMonth
|
||||
cmbInfo_Month(DS_TYPE.DS_EYE) = cmbInfo_EyeMonth
|
||||
cmbInfo_Month(DS_TYPE.DS_BODY) = cmbInfo_FaceMonth
|
||||
|
||||
cmbInfo_Day(DS_TYPE.DS_DEV) = cmbInfo_DevDay
|
||||
cmbInfo_Day(DS_TYPE.DS_FACE) = cmbInfo_FaceDay
|
||||
cmbInfo_Day(DS_TYPE.DS_EYE) = cmbInfo_EyeDay
|
||||
cmbInfo_Day(DS_TYPE.DS_BODY) = cmbInfo_FaceDay
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RunProcess_Click(sender As Object, e As EventArgs) Handles btnCmdStart.Click, btnCmdInput.Click
|
||||
@ -1271,7 +1415,7 @@ Public Class MainForm
|
||||
|
||||
Try
|
||||
StrCmd = "select Model,Type,Manufacture_Name,Abroad,Manufacture_Year,Manufacture_Month," &
|
||||
"Agency,SN,DateTime,FW_VER"
|
||||
"Agency,SN,Manufacture_Date,FW_VER"
|
||||
|
||||
StrCmd = StrCmd & " from jomtDeviceTbl where " & "Product_SN='" & strDate & "';"
|
||||
|
||||
@ -1303,9 +1447,9 @@ Public Class MainForm
|
||||
|
||||
Try
|
||||
StrCmd = "select Ct_Model,Ct_Type,Ct_Manufacture_Name,Ct_Abroad,Ct_Manufacture_Year,Ct_Manufacture_Month," &
|
||||
"Ct_Agency,Ct_SN,Ct_Remain_ShotCnt,P3_DateTime,Ct_Max_ShotCnt," &
|
||||
"Ct_Agency,Ct_SN,Ct_Remain_ShotCnt,Manufacture_Date,Ct_Max_ShotCnt," &
|
||||
"P1_Date,P1_Frequency," &
|
||||
"QC_Date,QC_Grade,PV_SN,QC_Capacitor"
|
||||
"QC_Date,QC_Grade,PV_SN,QC_Capacito"
|
||||
|
||||
StrCmd = StrCmd & " from jomtCartridgeTbl where " & "Product_SN='" & strDate & "';"
|
||||
|
||||
@ -1837,11 +1981,11 @@ Public Class MainForm
|
||||
End Try
|
||||
End Function
|
||||
Public Function Upload_CartInfo(chNum As Integer) As String
|
||||
Dim UploadVar(12) As String
|
||||
Dim UploadVal(12) As String
|
||||
Dim UploadVar(13) As String
|
||||
Dim UploadVal(13) As String
|
||||
Dim TypeStr As String = ""
|
||||
Dim CheckFlag As Boolean = True
|
||||
Dim LastCnt As Integer = 11
|
||||
Dim LastCnt As Integer = 12
|
||||
Dim strTDSN As String = txbInfo_TDSN(chNum).Text.ToUpper
|
||||
Dim strCTSN As String = txbInfo_Barcord(chNum).Text.ToUpper
|
||||
Dim tmpTDSN, tmpCTSN As String
|
||||
@ -1886,6 +2030,7 @@ Public Class MainForm
|
||||
UploadVar(9) = "Ct_Agency"
|
||||
UploadVar(10) = "Ct_Max_ShotCnt"
|
||||
UploadVar(11) = "Ct_Remain_ShotCnt"
|
||||
UploadVar(12) = "Manufacture_Date"
|
||||
|
||||
UploadVal(0) = "Now()"
|
||||
UploadVal(1) = txbInfo_Barcord(chNum).Text
|
||||
@ -1899,6 +2044,7 @@ Public Class MainForm
|
||||
UploadVal(9) = txbInfo_Agency(chNum).Text
|
||||
UploadVal(10) = txbInfo_Tshot(chNum).Text
|
||||
UploadVal(11) = txbInfo_Rshot(chNum).Text
|
||||
UploadVal(12) = GetSelectedDate(chNum)
|
||||
|
||||
StrCmd = "update jomtCartridgeTbl Set " & UploadVar(0) & "=" & UploadVal(0) & ","
|
||||
For cnt = 1 To LastCnt
|
||||
@ -1941,12 +2087,12 @@ Public Class MainForm
|
||||
End Try
|
||||
End Function
|
||||
Public Function Upload_DeviceInfo(chNum As Integer) As String
|
||||
Dim UploadVar(12) As String
|
||||
Dim UploadVal(12) As String
|
||||
Dim UploadVar(13) As String
|
||||
Dim UploadVal(13) As String
|
||||
Dim TypeStr As String = ""
|
||||
Dim CheckFlag As Boolean = True
|
||||
Dim strSN As String = txbInfo_Barcord(chNum).Text.ToUpper
|
||||
Dim LastCnt As Integer = 10
|
||||
Dim LastCnt As Integer = 11
|
||||
Try
|
||||
If CheckExistDEV_SN(strSN) = False Then
|
||||
StrCmd = "insert jomtDeviceTbl set Product_SN='" & strSN & "';"
|
||||
@ -1959,9 +2105,9 @@ Public Class MainForm
|
||||
TypeStr = "DEVICE"
|
||||
ElseIf chNum = DS_TYPE.DS_FACE Then
|
||||
TypeStr = "FACE"
|
||||
ElseIf chNum = DS_TYPE.DS_FACE Then
|
||||
ElseIf chNum = DS_TYPE.DS_EYE Then
|
||||
TypeStr = "EYE"
|
||||
ElseIf chNum = DS_TYPE.DS_FACE Then
|
||||
ElseIf chNum = DS_TYPE.DS_BODY Then
|
||||
TypeStr = "BODY"
|
||||
Else
|
||||
End If
|
||||
@ -1977,6 +2123,7 @@ Public Class MainForm
|
||||
UploadVar(8) = "Type"
|
||||
UploadVar(9) = "Abroad"
|
||||
UploadVar(10) = "Agency"
|
||||
UploadVar(11) = "Manufacture_Date"
|
||||
|
||||
|
||||
UploadVal(0) = "Now()"
|
||||
@ -1990,7 +2137,7 @@ Public Class MainForm
|
||||
UploadVal(8) = TypeStr
|
||||
UploadVal(9) = txbInfo_Abroad(chNum).Text
|
||||
UploadVal(10) = txbInfo_Agency(chNum).Text
|
||||
|
||||
UploadVal(11) = GetSelectedDate(chNum)
|
||||
|
||||
StrCmd = "update jomtDeviceTbl Set " & UploadVar(0) & "=" & UploadVal(0) & ","
|
||||
For cnt = 1 To LastCnt
|
||||
|
Loading…
x
Reference in New Issue
Block a user