以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 请问一下,当我“贷款每日进度表”中“最新进度”这一列的值为“放款”时,在“已放款”这个表会自动增加此行,现在的问题是: (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=113755) |
-- 作者:lzw001 -- 发布时间:2018/1/22 16:07:00 -- 请问一下,当我“贷款每日进度表”中“最新进度”这一列的值为“放款”时,在“已放款”这个表会自动增加此行,现在的问题是: 请问一下,当我“贷款每日进度表”中“最新进度”这一列的值为“放款”时,在“已放款”这个表会自动增加此行,现在的问题是:如果我重新把“放款”改为进件或其他之类的,以及改变一下其他列的数据,那么“已放款”就会重新增加一行,有没有可能是让他覆盖之前的那一行呢?这个是“贷款每日进度表”中datacolchanged中的代码:
If e.DataCol.Name = "最新进度" AndAlso e.DataRow("最新进度") = "放款" Then
Dim nma() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"} \'A表数据来源列
Dim nmb() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"}\'B表数据接收列
If dr1 Is Nothing Then
Dim dr As DataRow = DataTables("已放款").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Nex
t
End If |
-- 作者:lzw001 -- 发布时间:2018/1/22 16:09:00 -- 。 |
-- 作者:有点蓝 -- 发布时间:2018/1/22 17:57:00 -- If e.DataCol.Name = "最新进度" AndAlso e.DataRow("最新进度") = "放款" Then Dim nma() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"} \'A表数据来源列 Dim nmb() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"}\'B表数据接收列 Dim dr1 As DataRow = DataTables("已放款").find("客户名字=\'" & e.DataRow("客户名字") & "\'") \'自己改为合适的查询条件 If dr1 Is Nothing Then Dim dr As DataRow = DataTables("已放款").AddNew End If For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next End If
|
-- 作者:lzw001 -- 发布时间:2018/1/22 18:02:00 -- 如果是这个查找的条件中列的内容不确定改哪一个的呢,这里也可以吗? |
-- 作者:有点甜 -- 发布时间:2018/1/22 18:09:00 -- 以下是引用lzw001在2018/1/22 18:02:00的发言:
如果是这个查找的条件中列的内容不确定改哪一个的呢,这里也可以吗?
只要改的不是客户名字列,都不会有问题。 |
-- 作者:lzw001 -- 发布时间:2018/1/22 18:45:00 -- 好的,谢谢 |
-- 作者:lzw001 -- 发布时间:2018/1/22 18:45:00 -- 好的,谢谢 |
-- 作者:lzw001 -- 发布时间:2018/1/22 19:29:00 -- 这个当客户名字不变时,我改了其他列的数据,然后保存,放款表并不会有数据随着变化呢 我按照以下代码改了,查询条件是客户名字,没有变化呀 If e.DataCol.Name = "最新进度" AndAlso e.DataRow("最新进度") = "放款" Then Dim nma() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"} \'A表数据来源列 Dim nmb() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"}\'B表数据接收列 Dim dr1 As DataRow = DataTables("已放款").find("客户名字=\'" & e.DataRow("客户名字") & "\'") \'自己改为合适的查询条件 If dr1 Is Nothing Then Dim dr As DataRow = DataTables("已放款").AddNew End If For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next End If 然后我换成了这样,也是没变 Dim dr As DataRow Dim dr1 As DataRow If e.DataCol.Name = "最新进度" AndAlso e.DataRow("最新进度") = "放款" Then Dim nma() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"} \'A表数据来源列 Dim nmb() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"}\'B表数据接收列 \'("归属人 = \'" & e.DataRow("归属人") & dr1= DataTables("已放款").Find("客户名字 = \'" & e.DataRow("客户名字") & "\'")\'已放款表的行 If dr1 Is Nothing Then dr= DataTables("已放款").AddNew \'已放款添加一行 For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next Else For i As Integer = 0 To nma.Length - 1 dr1(nmb(i)) = e.DataRow(nma(i)) Next End If End If \'保存表 e.DataRow.Save() |
-- 作者:lzw001 -- 发布时间:2018/1/23 1:30:00 -- 已经解决了,但是有一个问题,就是当我客户名字相同时,后面一个客户的那一行会自动取代前面一行,这明显不符合要求,因为客户可以有名字相同的,这个可以怎么改呢,以下是代码: Dim dr As DataRow Dim dr1 As DataRow If e.DataCol.Name = "最新进度" AndAlso e.DataRow("最新进度") = "放款" Then Dim nma() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"} \'A表数据来源列 Dim nmb() As String = {"进件日期","分类","部门或渠道","客户经理","客户名字","客户手机号","产品名称","期数","进件额度","批款日期","批款额度","放款日期","放款额度","最新进度","备注"}\'B表数据接收列 \'("归属人 = \'" & e.DataRow("归属人") & dr1= DataTables("已放款").Find("客户名字 = \'" & e.DataRow("客户名字") & "\'")\'已放款表的行 If dr1 Is Nothing Then dr= DataTables("已放款").AddNew \'已放款添加一行 For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next Else For i As Integer = 0 To nma.Length - 1 dr1(nmb(i)) = e.DataRow(nma(i)) Next End If End If \'保存表 e.DataRow.Save() |
-- 作者:有点甜 -- 发布时间:2018/1/23 8:58:00 -- 这个条件必须唯一
dr1= DataTables("已放款").Find("客户名字 = \'" & e.DataRow("客户名字") & "\'")\'已放款表的行
你表格里面哪个字段是唯一的?你可以要求输入身份证号码,身份证号码是唯一的啊。 |