以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 关于数据入库问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107517) |
||||||||
-- 作者:裴保民 -- 发布时间:2017/9/29 15:06:00 -- 关于数据入库问题 老师我在下拉窗体“入库机具选择”中写了如下代码: If e.Selected Then If e.Form.DropDownBox.name="jijutiaomaDropBox" OrElse e.form.dropTable IsNot Nothing AndAlso e.form.dropTable.Name = "商户资料表" Dim tbl As Table = Tables("入库机具选择_Table1") Dim tbl1 As Table = Tables("商户资料表") Dim Result As DialogResult Dim sr As Row = tbl.Current Dim lsjl As DataRow = DataTables("POS机绑定商户历史记录表").Find("机具条码=\'" & sr("机具条码") & "\' and 解绑日期 is null") 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") =tbl.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") =tbl.Current("商户ID") lsjl("商户名称") =tbl.Current("商户名称") lsjl("客户ID") =tbl.Current("客户ID") lsjl("客户姓名") =tbl.Current("客户姓名") lsjl("绑定日期") =Date.Today End If e.Form.DropDownBox.Value = tbl.Current("机具ID") tbl1.Current("机具ID")= tbl.Current("机具ID") tbl1.Current("机具条码")= tbl.Current("机具条码") tbl.Current("商户ID")= tbl1.Current("商户ID") tbl.Current("客户ID")= tbl1.Current("客户ID") tbl.Current("客户姓名")= tbl1.Current("法人姓名") tbl.Current("商户名称")=tbl1.Current("商户名称") msgbox(tbl1.Current("商户名称") & "客户成功绑定机具") If Forms("商户资料入库窗体").Opened=True Then Forms("商户资料入库窗体").Controls("jijutiaomaDropBox").value ="" End If Return End If End If e.Form.DropDownBox.Value = tbl.Current("机具ID") tbl1.Current("机具ID")= tbl.Current("机具ID") tbl1.Current("机具条码")= tbl.Current("机具条码") tbl.Current("商户ID")= tbl1.Current("商户ID") tbl.Current("客户ID")= tbl1.Current("客户ID") tbl.Current("客户姓名")= tbl1.Current("法人姓名") tbl.Current("商户名称")=tbl1.Current("商户名称") 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") =tbl.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") =tbl.Current("商户ID") lsjl("商户名称") =tbl.Current("商户名称") lsjl("客户ID") =tbl.Current("客户ID") lsjl("客户姓名") =tbl.Current("客户姓名") lsjl("绑定日期") =Date.Today End If msgbox(tbl1.Current("商户名称") & "商户成功绑定机具") If Forms("商户资料入库窗体").Opened=True Then Forms("商户资料入库窗体").Controls("jijutiaomaDropBox").value ="" End If Return 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 如果红色代码为“ Dim sr As Row = tbl.Current ”时,在“商户资料表中”绑定机具时出现如果所选的数据已经机具绑定的商户时,再绑定机具的时候,解绑的机具在“POS机绑定商户历史记录表”中就不能给"解绑日期”赋值。如果在“商户资料表中”所选的数据是空值但所绑定的机具在其他商户所占用时,解绑的机具在“POS机绑定商户历史记录表”中能正常给"解绑日期”赋值。 如果红色代码改为“ Dim sr As Row = tbl1.Current ”时,在“商户资料表中”绑定机具时出现如果所选的数据已经机具绑定的商户时,再绑定机具的时候,解绑的机具在“POS机绑定商户历史记录表”中能正常给"解绑日期”赋值。如果在“商户资料表中”所选的数据是空值但所绑定的机具在其他商户所占用时,解绑的机具在“POS机绑定商户历史记录表”中就不能给"解绑日期”赋值 我怎么实现不管在"商户资料表"中的“机具ID”是空值还是已绑定了其他机具,只要在绑定机具这个动作中有解绑的机具成功的机具就要在 “POS机绑定商户历史记录表”中给所解绑的机具的“解绑日期”字段赋值呢?
|
||||||||
-- 作者:有点甜 -- 发布时间:2017/9/29 15:14:00 -- Dim lsjl As DataRow = DataTables("POS机绑定商户历史记录表").Find("机具条码=\'" & sr("机具条码") & "\' and 解绑日期 is null")
改成
Dim lsjl As DataRow = DataTables("POS机绑定商户历史记录表").Find("机具条码=\'" & sr("机具条码") & "\'") |
||||||||
-- 作者:有点甜 -- 发布时间:2017/9/29 15:16:00 --
你要解绑哪一个机具id,你就find哪一个机具id啊。
|
||||||||
-- 作者:裴保民 -- 发布时间:2017/9/29 15:26:00 -- 在“商户资料表中”绑定机具时出现如果所选的数据已经机具绑定的商户时,再绑定机具的时候,解绑的机具在“POS机绑定商户历史记录表”中就不能给"解绑日期”赋值。 |
||||||||
-- 作者:有点甜 -- 发布时间:2017/9/29 15:27:00 -- 你解绑哪一个机具id,就根据机具id的值find对应的行。 |
||||||||
-- 作者:裴保民 -- 发布时间:2017/9/29 22:47:00 -- 如果红色代码为“ Dim sr As Row = tbl.Current ”时,在“商户资料表中”绑定机具时出现如果所选的数据已经机具绑定的商户时,再绑定机具的时候,解绑的机具在“POS机绑定商户历史记录表”中就不能给"解绑日期”赋值。如果在“商户资料表中”所选的数据是空值但所绑定的机具在其他商户所占用时,解绑的机具在“POS机绑定商户历史记录表”中能正常给"解绑日期”赋值。
如果红色代码改为“ Dim sr As Row = tbl1.Current ”时,在“商户资料表中”绑定机具时出现如果所选的数据已经机具绑定的商户时,再绑定机具的时候,解绑的机具在“POS机绑定商户历史记录表”中能正常给"解绑日期”赋值。如果在“商户资料表中”所选的数据是空值但所绑定的机具在其他商户所占用时,解绑的机具在“POS机绑定商户历史记录表”中就不能给"解绑日期”赋值
一直调不好老师给看看怎么解决一下?
我怎么实现不管在"商户资料表"中的“机具ID”是空值还是已绑定了其他机具,只要在绑定机具这个动作中有解绑的机具成功的机具就要在 “POS机绑定商户历史记录表”中给所解绑的机具的“解绑日期”字段赋值呢?
[此贴子已经被作者于2017/9/29 23:40:33编辑过]
|
||||||||
-- 作者:有点蓝 -- 发布时间:2017/9/30 9:58:00 -- DropDownOpened事件加上 If e.form.dropTable IsNot Nothing AndAlso e.form.dropTable.Name = "商户资料表" AndAlso Tables("商户资料表").Current IsNot Nothing Then vars("机具条码") = Tables("商户资料表").Current("机具条码") End If DropDownClosed事件 If e.Selected Then If e.Form.DropDownBox.name="jijutiaomaDropBox" OrElse e.form.dropTable IsNot Nothing AndAlso e.form.dropTable.Name = "商户资料表" Dim tbl As Table = Tables("入库机具选择_Table1") Dim tbl1 As Table = Tables("商户资料表") Dim Result As DialogResult Dim sr As Row = tbl.Current 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("机具类型") ……
|
||||||||
-- 作者:裴保民 -- 发布时间:2017/9/30 21:12:00 -- 蓝老师经过测试其他功能实现,就是在选择“商户资料表”中为绑定机具的商户,选择机具的时候如果选择的的机具被别的商户绑定,徐解绑后绑定该商户,但解绑的机具应该在“POS机绑定商户历史记录表”中给解绑的商户机具赋值给"解绑日期”但执行该代码时不赋值
[此贴子已经被作者于2017/9/30 21:33:56编辑过]
|
||||||||
-- 作者:有点蓝 -- 发布时间:2017/10/4 8:53:00 -- 商户资料,Datacolchanging If e.DataCol.name = "流量卡ID" Then Dim dr As DataRow = e.DataTable.Find("流量卡ID=\'" & e.NewValue & "\'" ) If dr IsNot Nothing Then dr("流量卡ID") = Nothing dr("流量卡号") = Nothing End If End If If e.DataCol.name = "机具ID" Then Dim dr As DataRow = e.DataTable.Find("机具ID=\'" & e.NewValue & "\'" ) If dr IsNot Nothing Then Dim lsjl As DataRow = DataTables("POS机绑定商户历史记录表").Find("机具条码=\'" & dr("机具条码") & "\' and 商户ID=\'" & dr("商户ID") & "\'") If lsjl IsNot Nothing Then lsjl("解绑日期") = Date.Today End If dr("机具ID") = Nothing dr("机具条码") = Nothing End If End If |
||||||||
-- 作者:裴保民 -- 发布时间:2017/10/4 14:47:00 -- 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 老师看看哪有问题怎么无法保存代码? [此贴子已经被作者于2017/10/4 14:49:13编辑过]
|