If e.Selected Then
If e.Form.DropDownBox.name="kehushuanghuIDDropBox"
Dim tbl As Table = Tables("入库商户选择_Table1")
Dim tbl1 As Table = Tables("客户资料")
Dim Result As DialogResult
If tbl.Current IsNot Nothing Then
If tbl.current.isnull("客户ID") = False Then
Result = MessageBox.Show("该商户已经绑定客户,是否重新绑定新客户,单击是解绑后重新绑定,单击否放弃绑定新商户", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.No Then
Return
Else
e.Form.DropDownBox.Value = tbl.Current("商户ID")
tbl.Current("客户ID")= tbl1.Current("客户ID")
tbl.Current("法人姓名")= tbl1.Current("客户姓名")
msgbox(tbl1.Current("客户姓名") & "客户成功绑定商户 ")
Return
End If
End If
e.Form.DropDownBox.Value = tbl.Current("商户ID")
tbl.Current("客户ID")= tbl1.Current("客户ID")
tbl.Current("法人姓名")= tbl1.Current("客户姓名")
msgbox(tbl1.Current("客户姓名") & "客户成功绑定商户 ")
Return
End If
ElseIf e.Form.DropDownBox.name="posjishanghuIDDropBox" OrElse e.form.dropTable IsNot Nothing AndAlso e.form.dropTable.Name = "POS机库存资料"
Dim tbl As Table = Tables("入库商户选择_Table1")
Dim tbl1 As Table = Tables("POS机库存资料")
Dim Result As DialogResult
Dim sr As Row = tbl.Current
If tbl.current("商户ID") <> tbl1.current("商户ID") Then
If tbl1.Current IsNot Nothing Then
If tbl.current.isnull("机具ID") Then
'' systemready = False
e.Form.DropDownBox.Value = tbl.Current("商户ID")
tbl1.Current("商户ID") = tbl.Current("商户ID")
tbl1.Current("商户名称")= tbl.Current("商户名称")
tbl1.Current("客户ID")= tbl.Current("客户ID")
tbl1.Current("客户姓名")= tbl.Current("法人姓名")
tbl.Current("机具ID")= tbl1.Current("机具ID")
tbl.Current("机具条码")= tbl1.Current("机具条码")
If tbl1.Current("商户ID") IsNot Nothing Then
tbl1.Current("机具是否绑定")= True
Else
tbl1.Current("机具是否绑定")= False
End If
Dim lsjl As DataRow = DataTables("POS机绑定商户历史记录表").Find("机具条码='" & vars("机具条码") & "' and 商户ID='" & tbl1.Current("商户ID") & "'")
If tbl.Current IsNot Nothing Then
If tbl.current.isnull("商户ID") = False Then
Result = MessageBox.Show("该机具已经绑定商户,是否重新绑定新商户,单击是解绑后重新绑定,单击否放弃绑定新商户", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.No Then
Return
Else
If lsjl IsNot Nothing Then
lsjl ("解绑日期") =Date.Today
lsjl = DataTables("POS机绑定商户历史记录表").addnew
lsjl("机具ID") =tbl.Current("机具ID")
lsjl("机具条码") =tbl.Current("机具条码")
lsjl("机具类型") =tbl.Current("机具类型")
lsjl("机具型号") =tbl.Current("机具型号")
lsjl("所属仓库") =tbl.Current("所属仓库")
lsjl("商户ID") =tbl1.Current("商户ID")
lsjl("商户名称") =tbl.Current("商户名称")
lsjl("客户ID") =tbl.Current("客户ID")
lsjl("客户姓名") =tbl.Current("客户姓名")
lsjl("绑定日期") =Date.Today
Else
lsjl = DataTables("POS机绑定商户历史记录表").addnew
lsjl("机具ID") =tbl.Current("机具ID")
lsjl("机具条码") =tbl.Current("机具条码")
lsjl("机具类型") =tbl.Current("机具类型")
lsjl("机具型号") =tbl.Current("机具型号")
lsjl("所属仓库") =tbl.Current("所属仓库")
lsjl("商户ID") =tbl1.Current("商户ID")
lsjl("商户名称") =tbl.Current("商户名称")
lsjl("客户ID") =tbl.Current("客户ID")
lsjl("客户姓名") =tbl.Current("客户姓名")
lsjl("绑定日期") =Date.Today
End If
msgbox(tbl1.Current("商户名称") & "机具成功绑定商户 ")
' systemready =True
Return
Else
Dim Result As DialogResult = MessageBox.Show("该商户已经绑定机具,是否解绑后重新绑定新机具,单击是解绑后重新绑定,单击否则添加新商户并绑定新增商户,单击取消放弃操作", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
If result = DialogResult.Yes Then
' systemready = False
If lsjl IsNot Nothing Then
'lsjl ("解绑日期") =Date.Today
'lsjl = DataTables("POS机绑定商户历史记录表").addnew
'lsjl("机具ID") =tbl.Current("机具ID")
'lsjl("机具条码") =tbl.Current("机具条码")
'lsjl("机具类型") =tbl.Current("机具类型")
'lsjl("机具型号") =tbl.Current("机具型号")
'lsjl("所属仓库") =tbl.Current("所属仓库")
'lsjl("商户ID") =tbl1.Current("商户ID")
'lsjl("商户名称") =tbl.Current("商户名称")
'lsjl("客户ID") =tbl1.Current("客户ID")
'lsjl("客户姓名") =tbl.Current("客户姓名")
'lsjl("绑定日期") =Date.Today
Else
'lsjl = DataTables("POS机绑定商户历史记录表").addnew
'lsjl("机具ID") =tbl.Current("机具ID")
'lsjl("机具条码") =tbl.Current("机具条码")
'lsjl("机具类型") =tbl.Current("机具类型")
'lsjl("机具型号") =tbl.Current("机具型号")
'lsjl("所属仓库") =tbl.Current("所属仓库")
'lsjl("商户ID") =tbl1.Current("商户ID")
'lsjl("商户名称") =tbl.Current("商户名称")
'lsjl("客户ID") =tbl1.Current("客户ID")
'lsjl("客户姓名") =tbl.Current("客户姓名")
'lsjl("绑定日期") =Date.Today
End If
'For Each dr As DataRow In tbl1.DataTable.Select("机具Id = '" & tbl.Current("机具ID") & "'")
'dr("商户ID") = Nothing
'dr("商户名称") = Nothing
'dr("客户ID") = Nothing
'dr("客户姓名") = Nothing
'dr("机具是否绑定")= False
'Next
'For Each dr As DataRow In tbl.DataTable.Select("机具Id = '" & tbl1.Current("机具ID") & "'")
'dr("机具ID") = Nothing
'dr("机具条码") = Nothing
'Next
'e.Form.DropDownBox.Value = tbl.Current("商户ID")
'tbl1.Current("商户ID") = tbl.Current("商户ID")
'tbl1.Current("商户名称")= tbl.Current("商户名称")
'tbl1.Current("客户ID")= tbl.Current("客户ID")
'tbl1.Current("客户姓名")= tbl.Current("法人姓名")
'tbl.Current("机具ID")= tbl1.Current("机具ID")
'tbl.Current("机具条码")= tbl1.Current("机具条码")
If tbl1.Current("商户ID") IsNot Nothing Then
tbl1.Current("机具是否绑定")= True
Else
tbl1.Current("机具是否绑定")= False
End If
msgbox(tbl1.Current("商户名称") & "机具成功绑定商户 ")
' systemready =True
Return
ElseIf result = DialogResult.No Then
'Dim sr As Row = tbl.Current
'Dim nr As Row = tbl.addnew
'' systemready = False
'e.Form.DropDownBox.Value = tbl.Current("商户ID")
'nr("通道名称") = sr("通道名称")
'nr("网点地址") = sr("网点地址")
'nr("商户名称") = sr("商户名称")
'nr("网点名称") = sr("网点名称")
'nr("网点编号") = sr("网点编号")
'nr("备注") = sr("备注")
'nr("商户照片") = sr("商户照片")
'nr("商户编号") = sr("商户编号")
'nr("客户ID") = sr("客户ID")
'nr("法人姓名") = sr("法人姓名")
'' nr("流量卡ID") = sr("流量卡ID")
'' nr("流量卡号") = sr("流量卡号")
'tbl1.Current("商户ID") = tbl.Current("商户ID")
'tbl1.Current("商户名称")= tbl.Current("商户名称")
'tbl1.Current("客户ID")= tbl.Current("客户ID")
'tbl1.Current("客户姓名")= tbl.Current("法人姓名")
'tbl.Current("机具ID")= tbl1.Current("机具ID")
'tbl.Current("机具条码")= tbl1.Current("机具条码")
'lsjl = DataTables("POS机绑定商户历史记录表").addnew
'lsjl("机具ID") =tbl.Current("机具ID")
'lsjl("机具条码") =tbl.Current("机具条码")
'lsjl("机具类型") =tbl.Current("机具类型")
'lsjl("机具型号") =tbl.Current("机具型号")
'lsjl("所属仓库") =tbl.Current("所属仓库")
'lsjl("商户ID") =tbl1.Current("商户ID")
'lsjl("商户名称") =tbl.Current("商户名称")
'lsjl("客户ID") =tbl1.Current("客户ID")
'lsjl("客户姓名") =tbl.Current("客户姓名")
'lsjl("绑定日期") =Date.Today
If tbl1.Current("商户ID") IsNot Nothing Then
tbl1.Current("机具是否绑定")= True
Else
tbl1.Current("机具是否绑定")= False
End If
msgbox(tbl1.Current("商户名称") & "机具成功绑定商户 ")
'systemready =True
Return
End If
End If
End If
End If
'
ElseIf e.Form.DropDownBox.name="liuliangkashanghuIDDropBox" OrElse e.form.dropTable IsNot Nothing AndAlso e.form.dropTable.Name = "流量卡资料"
Dim tbl As Table = Tables("入库商户选择_Table1")
Dim tbl1 As Table = Tables("流量卡资料")
If tbl.current("商户ID") <> tbl1.current("商户ID") Then
If tbl1.Current IsNot Nothing Then
If tbl.current.isnull("流量卡ID") Then
' systemready = False
e.Form.DropDownBox.Value = tbl.Current("商户ID")
tbl1.Current("商户ID")= tbl.Current("商户ID")
tbl1.Current("商户名称")= tbl.Current("商户名称")
tbl1.Current("客户ID")= tbl.Current("客户ID")
tbl1.Current("客户姓名")= tbl.Current("法人姓名")
tbl.Current("流量卡ID")= tbl1.Current("流量卡ID")
tbl.Current("流量卡号")= tbl1.Current("流量卡号")
Dim sr As Row = tbl.Current
Dim lsjl As DataRow = DataTables("流量卡绑定商户历史记录表").Find("流量卡号='" & sr("流量卡号") & "' and 解绑日期 is null")
If lsjl IsNot Nothing Then
lsjl ("解绑日期") =Date.Today
lsjl = DataTables("流量卡绑定商户历史记录表").addnew
lsjl("流量卡ID") =tbl1.Current("流量卡ID")
lsjl("流量卡号") =tbl1.Current("流量卡号")
lsjl("类型") =tbl1.Current("类型")
lsjl("商户ID") =tbl.Current("商户ID")
lsjl("商户名称") =tbl.Current("商户名称")
lsjl("客户ID") =tbl.Current("客户ID")
lsjl("客户姓名") =tbl.Current("法人姓名")
lsjl("绑定日期") =Date.Today
Else
lsjl = DataTables("流量卡绑定商户历史记录表").addnew
lsjl("流量卡ID") =tbl1.Current("流量卡ID")
lsjl("流量卡号") =tbl1.Current("流量卡号")
lsjl("类型") =tbl1.Current("类型")
lsjl("商户ID") =tbl.Current("商户ID")
lsjl("商户名称") =tbl.Current("商户名称")
lsjl("客户ID") =tbl.Current("客户ID")
lsjl("客户姓名") =tbl.Current("法人姓名")
lsjl("绑定日期") =Date.Today
End If
If tbl1.Current("商户ID") IsNot Nothing Then
tbl1.Current("是否绑定")= True
Else
tbl1.Current("是否绑定")= False
End If
msgbox(tbl1.Current("商户名称") & "流量卡成功绑定商户 ")
'systemready =True
Return
Else
Dim Result As DialogResult = MessageBox.Show("该商户已经绑定流量卡,是否解绑后重新绑定新流量卡,单击是解绑后重新绑定,单击否则添加新商户并绑定新增商户,单击取消放弃操作", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
If result = DialogResult.Yes Then
'systemready = False
Dim sr As Row = tbl.Current
Dim lsjl As DataRow = DataTables("流量卡绑定商户历史记录表").Find("流量卡号='" & sr("流量卡号") & "' and 解绑日期 is null")
If lsjl IsNot Nothing Then
lsjl ("解绑日期") =Date.Today
lsjl = DataTables("流量卡绑定商户历史记录表").addnew
lsjl("流量卡ID") =tbl1.Current("流量卡ID")
lsjl("流量卡号") =tbl1.Current("流量卡号")
lsjl("类型") =tbl1.Current("类型")
lsjl("商户ID") =tbl.Current("商户ID")
lsjl("商户名称") =tbl.Current("商户名称")
lsjl("客户ID") =tbl.Current("客户ID")
lsjl("客户姓名") =tbl.Current("法人姓名")
lsjl("绑定日期") =Date.Today
Else
lsjl = DataTables("流量卡绑定商户历史记录表").addnew
lsjl("流量卡ID") =tbl1.Current("流量卡ID")
lsjl("流量卡号") =tbl1.Current("流量卡号")
lsjl("类型") =tbl1.Current("类型")
lsjl("商户ID") =tbl.Current("商户ID")
lsjl("商户名称") =tbl.Current("商户名称")
lsjl("客户ID") =tbl.Current("客户ID")
lsjl("客户姓名") =tbl.Current("法人姓名")
lsjl("绑定日期") =Date.Today
End If
For Each dr As DataRow In tbl1.DataTable.Select("流量卡ID = '" & tbl.Current("流量卡ID") & "'")
dr("商户ID") = Nothing
dr("商户名称") = Nothing
dr("客户ID") = Nothing
dr("客户姓名") = Nothing
dr("是否绑定")= False
Next
For Each dr As DataRow In tbl.DataTable.Select("流量卡ID = '" & tbl1.Current("流量卡ID") & "'")
dr("流量卡ID") = Nothing
dr("流量卡号") = Nothing
Next
e.Form.DropDownBox.Value = tbl.Current("商户ID")
tbl1.Current("商户ID")= tbl.Current("商户ID")
tbl1.Current("商户名称")= tbl.Current("商户名称")
tbl1.Current("客户ID")= tbl.Current("客户ID")
tbl1.Current("客户姓名")= tbl.Current("法人姓名")
tbl.Current("流量卡ID")= tbl1.Current("流量卡ID")
tbl.Current("流量卡号")= tbl1.Current("流量卡号")
If tbl1.Current("商户ID") IsNot Nothing Then
tbl1.Current("是否绑定")= True
Else
tbl1.Current("是否绑定")= False
End If
msgbox(tbl1.Current("商户名称") & "流量卡成功绑定商户 ")
' systemready =True
Return
ElseIf result = DialogResult.No Then
Dim sr As Row = tbl.Current
Dim nr As Row = tbl.addnew
' systemready = False
e.Form.DropDownBox.Value = tbl.Current("商户ID")
nr("通道名称") = sr("通道名称")
nr("网点地址") = sr("网点地址")
nr("商户名称") = sr("商户名称")
nr("网点名称") = sr("网点名称")
nr("网点编号") = sr("网点编号")
nr("备注") = sr("备注")
nr("商户照片") = sr("商户照片")
nr("商户编号") = sr("商户编号")
nr("客户ID") = sr("客户ID")
nr("法人姓名") = sr("法人姓名")
'nr("机具ID") = sr("机具ID")
' nr("机具条码") = sr("机具条码")
tbl1.Current("商户ID")= tbl.Current("商户ID")
tbl1.Current("商户名称")= tbl.Current("商户名称")
tbl1.Current("客户ID")= tbl.Current("客户ID")
tbl1.Current("客户姓名")= tbl.Current("法人姓名")
tbl.Current("流量卡ID")= tbl1.Current("流量卡ID")
tbl.Current("流量卡号")= tbl1.Current("流量卡号")
If tbl1.Current("商户ID") IsNot Nothing Then
tbl1.Current("是否绑定")= True
Else
tbl1.Current("是否绑定")= False
End If
Dim lsjl As DataRow = DataTables("流量卡绑定商户历史记录表").Find("流量卡号='" & sr("流量卡号") & "' and 解绑日期 is null")
lsjl = DataTables("流量卡绑定商户历史记录表").addnew
lsjl("流量卡ID") =tbl1.Current("流量卡ID")
lsjl("流量卡号") =tbl1.Current("流量卡号")
lsjl("类型") =tbl1.Current("类型")
lsjl("商户ID") =tbl.Current("商户ID")
lsjl("商户名称") =tbl.Current("商户名称")
lsjl("客户ID") =tbl.Current("客户ID")
lsjl("客户姓名") =tbl.Current("法人姓名")
lsjl("绑定日期") =Date.Today
msgbox(tbl1.Current("商户名称") & "流量卡成功绑定商户 ")
systemready =True
Return
End If
End If
End If
End If
End If
End If
If e.Form.DropTable IsNot Nothing Then '如果是通过表下拉的
e.Form.DropTable.FinishEditing()
ElseIf e.Form.DropDownBox.BindingField > "" '如果是通过窗口下拉的
e.Form.DropDownBox.WriteValue()
End If
此主题相关图片如下:无法保存.jpg
老师看看哪有问题怎么无法保存代码?
[此贴子已经被作者于2017/10/4 14:49:13编辑过]