上方按关键词输入的零件号 事件ValueChanged代码:
Dim PN As String = e.Form.Controls("CBox_PN").Value
If PN = "" Then Return
DataTables("WOReleaseSchedule").LoadFilter = "PartNumber like '%" & PN & "%'"
DataTables("WOReleaseSchedule").Load
e.Form.Controls("CBox_WO").Value = ""
e.Form.Controls("CBox_BatchNo").Value = ""
表1 的CurrentChanged 事件代码:If e.Table.Position = -1 OrElse e.Table.Rows.Count = 0 Then Return
SystemReady = False
Dim r As Row = e.Table.Current
Dim PN As String = r("PartNumber")
Dim Pbx As WinForm.PictureBox = e.Form.Controls("PictureBox1")
Dim fpf As String
Dim fp As String = "P:\General documents\Setup\Pic\"
fpf = fp & PN & ".jpg"
If FileSys.FileExists(fpf) = False Then
fp = "T:\ME\ME Documentation\Picture\"
fpf = fp & PN & ".jpg"
If FileSys.FileExists(fpf) = False Then
fpf = "P:\General documents\Setup\Pic\Error.jpg"
End If
End If
pbx.ImageFile = fpf
pbx.SizeMode = ImageSizeMode.Zoom
Dim WO As String = r("WO")
'工单发料明细更新
DataTables("INI_RMReleaseToWO").LoadFilter = "WO = '" & WO & "'"
DataTables("INI_RMReleaseToWO").Load
DataTables("INIWO_Receive").LoadFilter = "WO = '" & WO & "'"
DataTables("INIWO_Receive").Load
DataTables("ProductionIssue").LoadFilter = "WO = '" & WO & "'"
DataTables("ProductionIssue").Load
DataTables("WorkOrderStatus").LoadFilter = "WO = '" & WO & "'"
DataTables("WorkOrderStatus").Load
DataTables("Production_List").LoadFilter = "WO = '" & WO & "'"
DataTables("Production_List").Load
SystemReady = True
表2 CurrentChaged 事件代码:
If e.Table.Position = -1 OrElse e.Table.Rows.Count = 0 Then Return
Dim r As Row = e.Table.Current
Dim FG As String = r("BatchNumber")
Dim dr As DataRow = DataTables("INIWO_Receive").SQLFind("BatchNumber='" & FG & "'")
Dim PN As String
If dr IsNot Nothing Then
PN = dr("PartNumber")
Dim wo As String = dr("WO")
Dim FL As String = "WO ='" & wo & "'"
'基于发料批次号确认其入库时该批次号对应工单号写入 入库表中
If FG > "" Then
DataTables("INIWO_Receive").LoadFilter = "BatchNumber ='" & FG & "'"
DataTables("INIWO_Receive").Load
'MessageBox.Show(FG)
End If
DataTables("ProductionIssue").LoadFilter = FL
DataTables("ProductionIssue").Load
DataTables("WorkOrderStatus").LoadFilter = FL
DataTables("WorkOrderStatus").Load
DataTables("Production_List").LoadFilter = FL
DataTables("Production_List").Load
Tables("WOQuery_Table3").Filter = FL
Tables("WOQuery_Table4").Filter = FL
Tables("WOQuery_Table5").Filter = FL
Tables("WOQuery_Table6").Filter = FL
End If
Dim Pbx As WinForm.PictureBox = e.Form.Controls("PictureBox1")
Dim fpf As String
Dim fp As String = "P:\General documents\Setup\Pic\"
fpf = fp & PN & ".jpg"
If FileSys.FileExists(fpf) = False Then
fp = "T:\ME\ME Documentation\Picture\"
fpf = fp & PN & ".jpg"
If FileSys.FileExists(fpf) = False Then
fpf = "P:\General documents\Setup\Pic\Error.jpg"
End If
End If
pbx.ImageFile = fpf
pbx.SizeMode = ImageSizeMode.Zoom
[此贴子已经被作者于2023/11/3 17:17:18编辑过]