Foxtable(狐表)用户栏目专家坐堂 → 菜单按钮控件代码


  共有3346人关注过本帖树形打印复制链接

主题:菜单按钮控件代码

帅哥哟,离线,有人找我吗?
爱相随
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:932 积分:6531 威望:0 精华:0 注册:2014/6/25 10:48:00
菜单按钮控件代码  发帖心情 Post By:2015/3/27 15:36:00 [只看该作者]

老师,下面是菜单按钮控件代码,其意思是点击此按钮时,将HTB1指定的列复制到XMJDB1,HTB1中列“HTBH”是唯一的,原来的按钮是是没有限制复制次数的,现在要增加条件,就是如果已经复制行到XMJDB1,如果XMJDB1的“ND”“YF”为空时,则相同的行不能再从HTB1复制到XMJDB1,这样就避免当月因误点按钮重复在XJMJDB1生成数据行。代码如下,现在如何在黄色代码处加上条件代码呢??请老师指导

If User.IsRole("经办人") Then
    For Each r As Row In Tables("HTB1").Rows
      If r("XZH") = True Then
       Dim dS As DataRow
         dS = DataTables("HTB").Find("HTBH = '" & e.DataRow("HTBH") & "'" ) ‘在XMJDB1里查找HTBH 
         If dS Is Nothing '如果找到, 则设置各列内容

            判断XMJDB1的“ND”“YF”列为空的代码 就是在XMJDB1里找到合同编号且没有“ND”“YF”  为空的行时,复制下列列到XMJDB1,否则提示“本月已经。。。。。”                                           

           Dim nma() As String = { "XMLB","XMBM","XMMC","HTBH","HTMC","KSJM","KSMC","FYDL","HTFYLB","HTJE","LJZFGCK","分项名称","YZFYFK","YFJK" } 'A表数据来源列
           Dim nmb() As String = { "XMLB","XMBM","XMMC","HTBH","HTMC","KSJM","KSMC","FYDL","FYLB","HTJE","LJYFJDK","分项名称","YFGCK","GCJK" } 'B表数据接收列
           Dim dr As DataRow = DataTables("XMJDB1").AddNew         
            For i As Integer = 0 To nma.Length - 1
              dr(nmb(i)) = r(nma(i))
          Next
      End If
    Next
End If

[此贴子已经被作者于2015/3/27 15:44:19编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/3/27 16:00:00 [只看该作者]

 

If User.IsRole("经办人") Then
    For Each r As Row In Tables("HTB1").Rows
        If r("XZH") = True Then
            Dim fdr As DataRow = DataTables("XMJDB1").Find("HTBH = '" & r("HTBH") & "' and ND is null and yf is null")
            If fdr IsNot Nothing Then
               
                Dim nma() As String = { "XMLB","XMBM","XMMC","HTBH","HTMC","KSJM","KSMC","FYDL","HTFYLB","HTJE","LJZFGCK","分项名称","YZFYFK","YFJK" } 'A表数据来源列
                Dim nmb() As String = { "XMLB","XMBM","XMMC","HTBH","HTMC","KSJM","KSMC","FYDL","FYLB","HTJE","LJYFJDK","分项名称","YFGCK","GCJK" } 'B表数据接收列
                Dim dr As DataRow = DataTables("XMJDB1").AddNew
                For i As Integer = 0 To nma.Length - 1
                    dr(nmb(i)) = r(nma(i))
                Next
            End If
        End If
    Next
End If


 

[此贴子已经被作者于2015/3/27 16:00:01编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
爱相随
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:932 积分:6531 威望:0 精华:0 注册:2014/6/25 10:48:00
  发帖心情 Post By:2015/3/27 16:09:00 [只看该作者]

谢谢老师啊

 回到顶部