Foxtable(狐表)用户栏目专家坐堂 → 精简代码(自动复制多行)


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

主题:精简代码(自动复制多行)

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/7/6 21:21:00 [显示全部帖子]

If e.DataCol.Name = "选择" Then
    Dim dr As DataRow = e.DataRow
    Dim cs() As String = {"轻度","严重"}
    If dr("选择") = True
        Dim dt As DataTable = DataTables("事件汇总")
        Dim ndr As DataRow
        For Each c As String In cs
            Dim n As Integer = dr(c)
            If n > 0 Then
                ndr = dt.AddNew(n)
                For Each dr1 As DataRow In dt.DataRows
                    If dr1.RowState = DataRowState.Added Then
                        dr1("译码日期") = dr("译码日期")
                        dr1("性质") = "轻度"
                        dr1.Save
                    End If
                Next
            End If
        Next
    End If
End If

 回到顶部