diff --git a/Product_Manager/MainForm.vb b/Product_Manager/MainForm.vb index 4c76b1f..35b065c 100644 --- a/Product_Manager/MainForm.vb +++ b/Product_Manager/MainForm.vb @@ -579,36 +579,6 @@ End_Finish: GoTo FAIL_Finish 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 StageCnt = ErrorList.ResultError GoTo FAIL_Finish @@ -674,6 +644,8 @@ End_Finish: Dim SerialValue As String = SerialNumSetting(nudIfSerial.Value.ToString) Dim MonthParsing As String = MonthSetting(nudIfMonth.Value.ToString) + + Dim cartridgeSerial = SerialValue SerialValue = nudIfYear.Value & MonthParsing & SerialValue 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) 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 & "', " & @@ -1615,31 +1585,6 @@ End_Finish: GoTo FAIL_Finish 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.BackColor = Color.Green GoTo End_Finish @@ -2202,31 +2147,6 @@ End_Finish: GoTo FAIL_Finish 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.BackColor = Color.Green GoTo End_Finish @@ -2273,9 +2193,12 @@ End_Finish: GoTo FAIL_Finish End If + Dim freq = txbFreq.Text + Dim power = txbPower.Text + DBCmd = "UPDATE " & UseCartridgeTbl & " SET " & - "Ct_Frequency = '" & txbFreq.Text & "', " & - "Ct_Power = '" & CSng(txbPower.Text) & "' " & + "Ct_Frequency = " & freq & ", " & + "Ct_Power = " & power & " " & "WHERE PV_SN = '" & TDNameStr & "'" DBCommand(DBCmd) @@ -2771,31 +2694,6 @@ End_Finish: GoTo FAIL_Finish 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.BackColor = Color.Green GoTo End_Finish @@ -4241,7 +4139,7 @@ End_Finish: End Sub 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 txbPDSN.Text = sqlDataQuery(0) @@ -4265,7 +4163,7 @@ End_Finish: End Function 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 txbPDSN.Text = sqlDataQuery(0) @@ -4288,7 +4186,7 @@ End_Finish: End Sub 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 txbPDSN.Text = sqlDataQuery(0) diff --git a/Product_Manager/SerialPortMoudule.vb b/Product_Manager/SerialPortMoudule.vb index 942ed34..1ff871c 100644 --- a/Product_Manager/SerialPortMoudule.vb +++ b/Product_Manager/SerialPortMoudule.vb @@ -63,9 +63,7 @@ Module SerialPortMoudule End Function Public Function PollingReceiveData(RdTimeout As Long) As String - Try - If UseSerial_Ch1.IsOpen = True Then rxMessage = "" UseSerial_Ch1.ReadTimeout = RdTimeout diff --git a/Product_Manager/bin/Debug/Product_Manager.exe b/Product_Manager/bin/Debug/Product_Manager.exe index 6bdbf83..f183001 100644 Binary files a/Product_Manager/bin/Debug/Product_Manager.exe and b/Product_Manager/bin/Debug/Product_Manager.exe differ diff --git a/Product_Manager/bin/Debug/Product_Manager.pdb b/Product_Manager/bin/Debug/Product_Manager.pdb index bbe7121..9b06821 100644 Binary files a/Product_Manager/bin/Debug/Product_Manager.pdb and b/Product_Manager/bin/Debug/Product_Manager.pdb differ diff --git a/Product_Manager/obj/Debug/Product_Manager.exe b/Product_Manager/obj/Debug/Product_Manager.exe index 6bdbf83..f183001 100644 Binary files a/Product_Manager/obj/Debug/Product_Manager.exe and b/Product_Manager/obj/Debug/Product_Manager.exe differ diff --git a/Product_Manager/obj/Debug/Product_Manager.pdb b/Product_Manager/obj/Debug/Product_Manager.pdb index bbe7121..9b06821 100644 Binary files a/Product_Manager/obj/Debug/Product_Manager.pdb and b/Product_Manager/obj/Debug/Product_Manager.pdb differ diff --git a/Product_Manager/obj/Debug/Product_Manager.vbproj.AssemblyReference.cache b/Product_Manager/obj/Debug/Product_Manager.vbproj.AssemblyReference.cache index 16abc65..7692910 100644 Binary files a/Product_Manager/obj/Debug/Product_Manager.vbproj.AssemblyReference.cache and b/Product_Manager/obj/Debug/Product_Manager.vbproj.AssemblyReference.cache differ diff --git a/Product_Manager/obj/Debug/Product_Manager.vbproj.GenerateResource.cache b/Product_Manager/obj/Debug/Product_Manager.vbproj.GenerateResource.cache index 4337472..7786185 100644 Binary files a/Product_Manager/obj/Debug/Product_Manager.vbproj.GenerateResource.cache and b/Product_Manager/obj/Debug/Product_Manager.vbproj.GenerateResource.cache differ