feat: #1 쓰기 기능 사용 시 DB 자동 반영 기능 추가 #3

Merged
Ghost merged 10 commits from feaure/add-database-update into main 2025-05-08 14:15:50 +09:00
Showing only changes of commit 1b4edfe996 - Show all commits

View File

@ -654,12 +654,23 @@ End_Finish:
End If
txbIfNumber.Text = ModelCode & Mid(SerialValue, 1, 4) & Mid(SerialValue, 8, 3) & Mid(SerialValue, 5, 3)
Dim cartridgeSerial = Mid(SerialValue, 5, 3) & Mid(SerialValue, 8, 3)
'여기에 Update TD 번호 조건 걸어서 넣기'
' 변수 정리하고 어떤 칼럼인지 정리
Dim DBCmd = "UPDATE " & UseCartridgeTbl & "SET Product_SN = '" & txbIfNumber.Text & "', Ct_Manufacture_Name = '" & txbIfCode.Text & "', Ct_Manufacture_Year = '" & nudIfYear.Value & "', Ct_Manufacture_Month = '" & nudIfMonth.Value & "', Ct_SN = '" & cartridgeSerial & "', Ct_Model = 'MAXIMUM', Ct_Type = 'SET', Ct_Remain_ShotCnt = 0 WHERE PV_SN = '" & TDNameStr & "'"
If ckbDBUse.Checked = True Then
Dim cartridgeSerial = Mid(SerialValue, 5, 3) & Mid(SerialValue, 8, 3)
Dim DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
"Product_SN = '" & txbIfNumber.Text & "', " &
"Ct_Manufacture_Name = '" & txbIfCode.Text & "', " &
"Ct_Manufacture_Year = '" & nudIfYear.Value & "', " &
"Ct_Manufacture_Month = '" & nudIfMonth.Value & "', " &
"Ct_SN = '" & cartridgeSerial & "', " &
"Ct_Model = 'MAXIMUM', " &
"Ct_Type = 'SET', " &
"Ct_Remain_ShotCnt = 0 " &
"WHERE PV_SN = '" & TDNameStr & "'"
DBCommand(DBCmd)
End If
txbInfoBox.Text = "SUCCESS"
txbInfoBox.BackColor = Color.Green
@ -732,6 +743,23 @@ End_Finish:
txbIfNumber.Text = ModelCode & Mid(SerialValue, 1, 4) & Mid(SerialValue, 8, 3) & Mid(SerialValue, 5, 3)
If ckbDBUse.Checked = True Then
Dim cartridgeSerial = Mid(SerialValue, 5, 3) & Mid(SerialValue, 8, 3)
Dim DBCmd = "UPDATE " & NonCartridgeTbl & " SET " &
"Product_SN = '" & txbIfNumber.Text & "', " &
"Ct_Manufacture_Name = '" & txbIfCode.Text & "', " &
"Ct_Manufacture_Year = '" & nudIfYear.Value & "', " &
"Ct_Manufacture_Month = '" & nudIfMonth.Value & "', " &
"Ct_SN = '" & cartridgeSerial & "', " &
"Ct_Model = 'ALTO', " &
"Ct_Type = 'SET' " &
"WHERE PV_SN = '" & TDNameStr & "'"
DBCommand(DBCmd)
End If
txbInfoBox.Text = "SUCCESS"
txbInfoBox.BackColor = Color.Green
GoTo End_Finish
@ -803,6 +831,23 @@ End_Finish:
txbIfNumber.Text = ModelCode & Mid(SerialValue, 1, 4) & Mid(SerialValue, 8, 3) & Mid(SerialValue, 5, 3)
If ckbDBUse.Checked = True Then
Dim cartridgeSerial = Mid(SerialValue, 5, 3) & Mid(SerialValue, 8, 3)
Dim DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
"Product_SN = '" & txbIfNumber.Text & "', " &
"Ct_Manufacture_Name = '" & txbIfCode.Text & "', " &
"Ct_Manufacture_Year = '" & nudIfYear.Value & "', " &
"Ct_Manufacture_Month = '" & nudIfMonth.Value & "', " &
"Ct_SN = '" & cartridgeSerial & "', " &
"Ct_Model = 'EFFECT', " &
"Ct_Type = 'SET', " &
"Ct_Remain_ShotCnt = 0 " &
"WHERE PV_SN = '" & TDNameStr & "'"
DBCommand(DBCmd)
End If
txbInfoBox.Text = "SUCCESS"
txbInfoBox.BackColor = Color.Green
GoTo End_Finish