fix: DB 업데이트 에러 수정
This commit is contained in:
parent
a413b16831
commit
ad195a7192
@ -579,36 +579,6 @@ End_Finish:
|
|||||||
GoTo FAIL_Finish
|
GoTo FAIL_Finish
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ckbDBUse.Checked = True Then
|
|
||||||
Dim TDNameStr = TDNameLoad()
|
|
||||||
|
|
||||||
If TDNameStr = Str(ErrorList.SendError) Or TDNameStr = Str(ErrorList.ReceiveError) Then
|
|
||||||
MsgBox("TD 시리얼 번호를 확인할 수 없습니다. 저장하고자 하는 Serial 번호를 먼저 입력하여 주십시오.", vbExclamation, FormName)
|
|
||||||
StageCnt = TDNameStr
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim DBExist As Boolean = TDNameDBLoad(TDNameStr)
|
|
||||||
|
|
||||||
If DBExist = False Then
|
|
||||||
MsgBox("TD 시리얼 번호가 데이터베이스에 등록되어 있지 않습니다.", vbCritical, FormName)
|
|
||||||
StageCnt = ErrorList.ReceiveError
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
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 = '" & SerialValue & "', " &
|
|
||||||
"Ct_Model = '" & ModelCode.ToString & "', " &
|
|
||||||
"Ct_Type = '" & TypeCode.ToString & "', " &
|
|
||||||
"WHERE PV_SN = '" & TDNameStr & "'"
|
|
||||||
|
|
||||||
DBCommand(DBCmd)
|
|
||||||
End If
|
|
||||||
|
|
||||||
If DataResult <> "success" Then
|
If DataResult <> "success" Then
|
||||||
StageCnt = ErrorList.ResultError
|
StageCnt = ErrorList.ResultError
|
||||||
GoTo FAIL_Finish
|
GoTo FAIL_Finish
|
||||||
@ -674,6 +644,8 @@ End_Finish:
|
|||||||
Dim SerialValue As String = SerialNumSetting(nudIfSerial.Value.ToString)
|
Dim SerialValue As String = SerialNumSetting(nudIfSerial.Value.ToString)
|
||||||
Dim MonthParsing As String = MonthSetting(nudIfMonth.Value.ToString)
|
Dim MonthParsing As String = MonthSetting(nudIfMonth.Value.ToString)
|
||||||
|
|
||||||
|
|
||||||
|
Dim cartridgeSerial = SerialValue
|
||||||
SerialValue = nudIfYear.Value & MonthParsing & SerialValue
|
SerialValue = nudIfYear.Value & MonthParsing & SerialValue
|
||||||
|
|
||||||
Dim ResultData As Int16 = MAXInfoWrite(txbIfCode.Text, SerialValue, ModelCode, AboardCode, AgencyCode)
|
Dim ResultData As Int16 = MAXInfoWrite(txbIfCode.Text, SerialValue, ModelCode, AboardCode, AgencyCode)
|
||||||
@ -686,8 +658,6 @@ End_Finish:
|
|||||||
txbIfNumber.Text = ModelCode & Mid(SerialValue, 1, 4) & Mid(SerialValue, 8, 3) & Mid(SerialValue, 5, 3)
|
txbIfNumber.Text = ModelCode & Mid(SerialValue, 1, 4) & Mid(SerialValue, 8, 3) & Mid(SerialValue, 5, 3)
|
||||||
|
|
||||||
If ckbDBUse.Checked = True Then
|
If ckbDBUse.Checked = True Then
|
||||||
Dim cartridgeSerial = Mid(SerialValue, 5, 3) & Mid(SerialValue, 8, 3)
|
|
||||||
|
|
||||||
Dim DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
|
Dim DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
|
||||||
"Product_SN = '" & txbIfNumber.Text & "', " &
|
"Product_SN = '" & txbIfNumber.Text & "', " &
|
||||||
"Ct_Manufacture_Name = '" & txbIfCode.Text & "', " &
|
"Ct_Manufacture_Name = '" & txbIfCode.Text & "', " &
|
||||||
@ -1615,31 +1585,6 @@ End_Finish:
|
|||||||
GoTo FAIL_Finish
|
GoTo FAIL_Finish
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ckbDBUse.Checked = True Then
|
|
||||||
Dim TDNameStr = TDNameLoad()
|
|
||||||
|
|
||||||
If TDNameStr = Str(ErrorList.SendError) Or TDNameStr = Str(ErrorList.ReceiveError) Then
|
|
||||||
MsgBox("TD 시리얼 번호를 확인할 수 없습니다. 저장하고자 하는 Serial 번호를 먼저 입력하여 주십시오.", vbExclamation, FormName)
|
|
||||||
StageCnt = TDNameStr
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim DBExist As Boolean = TDNameDBLoad(TDNameStr)
|
|
||||||
|
|
||||||
If DBExist = False Then
|
|
||||||
MsgBox("TD 시리얼 번호가 데이터베이스에 등록되어 있지 않습니다.", vbCritical, FormName)
|
|
||||||
StageCnt = ErrorList.ReceiveError
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
|
|
||||||
"Ct_Abroad = '" & txbAbroad.Text.Trim() & "', " &
|
|
||||||
"Ct_Agency = '" & txbAgency.Text.Trim() & "' " &
|
|
||||||
"WHERE PV_SN = '" & TDNameStr & "'"
|
|
||||||
|
|
||||||
DBCommand(DBCmd)
|
|
||||||
End If
|
|
||||||
|
|
||||||
txbAreaBox.Text = "SUCCESS"
|
txbAreaBox.Text = "SUCCESS"
|
||||||
txbAreaBox.BackColor = Color.Green
|
txbAreaBox.BackColor = Color.Green
|
||||||
GoTo End_Finish
|
GoTo End_Finish
|
||||||
@ -2202,31 +2147,6 @@ End_Finish:
|
|||||||
GoTo FAIL_Finish
|
GoTo FAIL_Finish
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ckbDBUse.Checked = True Then
|
|
||||||
Dim TDNameStr = TDNameLoad()
|
|
||||||
|
|
||||||
If TDNameStr = Str(ErrorList.SendError) Or TDNameStr = Str(ErrorList.ReceiveError) Then
|
|
||||||
MsgBox("TD 시리얼 번호를 확인할 수 없습니다. 저장하고자 하는 Serial 번호를 먼저 입력하여 주십시오.", vbExclamation, FormName)
|
|
||||||
StageCnt = TDNameStr
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim DBExist As Boolean = TDNameDBLoad(TDNameStr)
|
|
||||||
|
|
||||||
If DBExist = False Then
|
|
||||||
MsgBox("TD 시리얼 번호가 데이터베이스에 등록되어 있지 않습니다.", vbCritical, FormName)
|
|
||||||
StageCnt = ErrorList.ReceiveError
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
|
|
||||||
"Ct_Frequency = '" & txbFreq.Text & "', " &
|
|
||||||
"Ct_Power = '" & CSng(txbPower.Text) & "' " &
|
|
||||||
"WHERE PV_SN = '" & TDNameStr & "'"
|
|
||||||
|
|
||||||
DBCommand(DBCmd)
|
|
||||||
End If
|
|
||||||
|
|
||||||
txbFPBox.Text = "SUCCESS"
|
txbFPBox.Text = "SUCCESS"
|
||||||
txbFPBox.BackColor = Color.Green
|
txbFPBox.BackColor = Color.Green
|
||||||
GoTo End_Finish
|
GoTo End_Finish
|
||||||
@ -2273,9 +2193,12 @@ End_Finish:
|
|||||||
GoTo FAIL_Finish
|
GoTo FAIL_Finish
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim freq = txbFreq.Text
|
||||||
|
Dim power = txbPower.Text
|
||||||
|
|
||||||
DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
|
DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
|
||||||
"Ct_Frequency = '" & txbFreq.Text & "', " &
|
"Ct_Frequency = " & freq & ", " &
|
||||||
"Ct_Power = '" & CSng(txbPower.Text) & "' " &
|
"Ct_Power = " & power & " " &
|
||||||
"WHERE PV_SN = '" & TDNameStr & "'"
|
"WHERE PV_SN = '" & TDNameStr & "'"
|
||||||
|
|
||||||
DBCommand(DBCmd)
|
DBCommand(DBCmd)
|
||||||
@ -2771,31 +2694,6 @@ End_Finish:
|
|||||||
GoTo FAIL_Finish
|
GoTo FAIL_Finish
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ckbDBUse.Checked = True Then
|
|
||||||
Dim TDNameStr = TDNameLoad()
|
|
||||||
|
|
||||||
If TDNameStr = Str(ErrorList.SendError) Or TDNameStr = Str(ErrorList.ReceiveError) Then
|
|
||||||
MsgBox("TD 시리얼 번호를 확인할 수 없습니다. 저장하고자 하는 Serial 번호를 먼저 입력하여 주십시오.", vbExclamation, FormName)
|
|
||||||
StageCnt = TDNameStr
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim DBExist As Boolean = TDNameDBLoad(TDNameStr)
|
|
||||||
|
|
||||||
If DBExist = False Then
|
|
||||||
MsgBox("TD 시리얼 번호가 데이터베이스에 등록되어 있지 않습니다.", vbCritical, FormName)
|
|
||||||
StageCnt = ErrorList.ReceiveError
|
|
||||||
GoTo FAIL_Finish
|
|
||||||
End If
|
|
||||||
|
|
||||||
DBCmd = "UPDATE " & UseCartridgeTbl & " SET " &
|
|
||||||
"Ct_Remain_ShotCnt = '" & txbShot.Text & "' " &
|
|
||||||
"Ct_Max_ShotCnt = '" & txbMaxShot.Text & "' " &
|
|
||||||
"WHERE PV_SN = '" & TDNameStr & "'"
|
|
||||||
|
|
||||||
DBCommand(DBCmd)
|
|
||||||
End If
|
|
||||||
|
|
||||||
txbShotBox.Text = "SUCCESS"
|
txbShotBox.Text = "SUCCESS"
|
||||||
txbShotBox.BackColor = Color.Green
|
txbShotBox.BackColor = Color.Green
|
||||||
GoTo End_Finish
|
GoTo End_Finish
|
||||||
@ -4241,7 +4139,7 @@ End_Finish:
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function TD_Search() As Boolean
|
Private Function TD_Search() As Boolean
|
||||||
Dim DBCmd As String = "Select Product_SN,Ct_Manufacture_Name,Ct_SN,Ct_Model,Ct_Type,Ct_Abroad,Ct_Agency,Ct_Power,Ct_Max_ShotCnt,Ct_Motor_Lv,PV_SN,P1_Frequency,P3_DateTime FROM " & CartDB & " WHERE PV_SN = '" & txbLoadNum.Text & "' Limit 1"
|
Dim DBCmd As String = "Select Product_SN,Ct_Manufacture_Name,Ct_SN,Ct_Model,Ct_Type,Ct_Abroad,Ct_Agency,Ct_Power,Ct_Max_ShotCnt,Ct_Motor_Lv,PV_SN,Ct_Frequency,P3_DateTime FROM " & UseCartridgeTbl & " WHERE PV_SN = '" & txbLoadNum.Text & "' Limit 1"
|
||||||
|
|
||||||
If DBQueryReader(DBCmd) Then
|
If DBQueryReader(DBCmd) Then
|
||||||
txbPDSN.Text = sqlDataQuery(0)
|
txbPDSN.Text = sqlDataQuery(0)
|
||||||
@ -4265,7 +4163,7 @@ End_Finish:
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub NonTD_Search()
|
Private Sub NonTD_Search()
|
||||||
Dim DBCmd As String = "SELECT Product_SN, Ct_Manufacture_Name, Ct_SN, Ct_Model,Ct_Type,Ct_Abroad,Ct_Agency,PV_SN,P3_DateTime FROM " & NonCartridgeTbl & " WHERE PV_SN = '" & txbLoadNum.Text & "' Limit 1"
|
Dim DBCmd As String = "SELECT Product_SN, Ct_Manufacture_Name, Ct_SN, Ct_Model ,Ct_Type, Ct_Abroad, Ct_Agency, PV_SN, P3_DateTime FROM " & NonCartridgeTbl & " WHERE PV_SN = '" & txbLoadNum.Text & "' Limit 1"
|
||||||
|
|
||||||
If DBQueryReader(DBCmd) Then
|
If DBQueryReader(DBCmd) Then
|
||||||
txbPDSN.Text = sqlDataQuery(0)
|
txbPDSN.Text = sqlDataQuery(0)
|
||||||
@ -4288,7 +4186,7 @@ End_Finish:
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function Product_Search() As Boolean
|
Private Function Product_Search() As Boolean
|
||||||
Dim DBCmd As String = "SELECT Product_SN,Ct_Manufacture_Name,Ct_SN,Ct_Model,Ct_Type,Ct_Abroad,Ct_Agency,Ct_Power,Ct_Max_ShotCnt,Ct_Motor_Lv,PV_SN,P1_Frequency,P3_DateTime FROM " & CartDB & " WHERE Product_SN = '" & txbLoadNum.Text & "' Limit 1"
|
Dim DBCmd As String = "SELECT Product_SN,Ct_Manufacture_Name,Ct_SN,Ct_Model,Ct_Type,Ct_Abroad,Ct_Agency,Ct_Power,Ct_Max_ShotCnt,Ct_Motor_Lv,PV_SN,Ct_Frequency,P3_DateTime FROM " & UseCartridgeTbl & " WHERE Product_SN = '" & txbLoadNum.Text & "' Limit 1"
|
||||||
|
|
||||||
If DBQueryReader(DBCmd) Then
|
If DBQueryReader(DBCmd) Then
|
||||||
txbPDSN.Text = sqlDataQuery(0)
|
txbPDSN.Text = sqlDataQuery(0)
|
||||||
|
@ -63,9 +63,7 @@ Module SerialPortMoudule
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function PollingReceiveData(RdTimeout As Long) As String
|
Public Function PollingReceiveData(RdTimeout As Long) As String
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|
||||||
If UseSerial_Ch1.IsOpen = True Then
|
If UseSerial_Ch1.IsOpen = True Then
|
||||||
rxMessage = ""
|
rxMessage = ""
|
||||||
UseSerial_Ch1.ReadTimeout = RdTimeout
|
UseSerial_Ch1.ReadTimeout = RdTimeout
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user