Foxtable(狐表)用户栏目专家坐堂 → [求助]这段代码有什么问题吗,运行不了,请专家指导


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

主题:[求助]这段代码有什么问题吗,运行不了,请专家指导

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


加好友 发短信
等级:五尾狐 帖子:1095 积分:8440 威望:0 精华:0 注册:2012/7/10 9:09:00
[求助]这段代码有什么问题吗,运行不了,请专家指导  发帖心情 Post By:2021/2/7 10:09:00 [只看该作者]

DataTables("值班补助表").DataRows.Clear

systemReady = False

 

Dim Vals As List(of String)

Vals = DataTables("值班排班表").SQLGetValues("处级带班_姓名  + ',' + 年度 + ',' + 节假日名称 + ',' + 补助项目" ,"时段区分 <> '03晚上' and 处级带班_姓名 Is not null")

For Each name As String In DataTables("值班排班表").SQLGetValues("科级带班_姓名 + ',' + 年度 + ',' + 节假日名称 + ',' + 补助项目","科级带班_姓名 is not null")

    If Vals.Contains(name) = False Then vals.Add(name)

Next

For Each name As String In DataTables("值班排班表").SQLGetValues("值班人员_姓名 + ',' + 年度 + ',' + 节假日名称 + ',' + 补助项目","值班人员_姓名 is not null")

    If Vals.Contains(name) = False Then vals.Add(name)

Next

Dim dr As DataRow

For Each name As String In vals

    Dim arr() As String = name.Split(",")

    dr = DataTables("值班补助表").find(" 姓名 ='" & arr(0) & "'and 年度 ='" & arr(1) & "'and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'")

    If dr Is Nothing Then

        dr = DataTables("值班补助表").AddNew      

        dr("姓名") = arr(0)

        dr("年度") = arr(1)

        dr("节假日名称") = arr(2)

        dr("补助项目") = arr(3)

     End If

 

    dr("次数") = DataTables("值班排班表").GetValues("值班日期|处级带班_姓名","处级带班_姓名 ='" & arr(0) & "' and 年度 ='" & arr(1) & "' and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'").Count + DataTables("值班排班表").GetValues("值班日期|科级带班_姓名","科级带班_姓名='" & arr(0) & "' and 年度='" & arr(1) & "' and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'").Count + DataTables("值班排班表").GetValues("值班日期|值班人员_姓名","值班人员_姓名='" & arr(0) & "' and 年度='" & arr(1) & "' and 节假日名称 ='" & arr(2) & "' and 补助项目 ='" & arr(3) & "'").Count

    Dim dr2 As DataRow = DataTables("值班排班表").find("(处级带班_姓名 ='" & arr(0) & "' or 科级带班_姓名 ='" & arr(0) & "' or 值班人员_姓名 ='" & arr(0) & "') and 年度 ='" & arr(1) & "'and 节假日名称 ='" & arr(2) & "' And 补助项目 ='" & arr(3) & "'")

    If dr2 IsNot Nothing Then

        dr("值班日期") = dr2 ("值班日期")

    End If

Next

SystemReady = True

 


 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105495 积分:536466 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/2/7 10:38:00 [只看该作者]

提示什么错误?如果是逻辑问题,自行调试一下:http://www.foxtable.com/webhelp/scr/1485.htm

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


加好友 发短信
等级:五尾狐 帖子:1095 积分:8440 威望:0 精华:0 注册:2012/7/10 9:09:00
  发帖心情 Post By:2021/2/7 11:20:00 [只看该作者]

谢谢,已找出问题

 回到顶部