Foxtable(狐表)用户栏目专家坐堂 → [求助]平均分配数据并提醒


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

主题:[求助]平均分配数据并提醒

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


加好友 发短信
等级:一尾狐 帖子:409 积分:3723 威望:0 精华:0 注册:2017/6/9 18:02:00
[求助]平均分配数据并提醒  发帖心情 Post By:2017/11/7 10:47:00 [只看该作者]


此主题相关图片如下:qq截图20171107103537.png
按此在新窗口浏览图片

Dim t As Table = Tables("资源分配_Table1")
Dim dic As new Dictionary(Of String, Integer)
For Each r As Row In t.GetCheckedRows
    r("工号") = Forms("资源分配").Controls("CheckedListBox1").SelectedValue
    If Forms("资源分配").Controls("_mtxz").Value = Nothing Then
    Else
        r("媒体") = Forms("资源分配").Controls("_mtxz").Value
    End If
    r("分配日期") = Forms("资源分配").Controls("DateTimePicker1").Value
    r.save
    Dim nm As String =  r("部门") & "." & r("工号")
    If dic.ContainsKey(nm) = False Then
        dic.Add(nm, 1)
    Else
        dic(nm) += 1
    End If
Next
For Each key As String In dic.Keys
    QQClient.SendChatMessage(key, "{!} 已收到" & dic(key) & "条新的客户资源请及时处理!")
Next
Syscmd.Project.Save()
这段代码是图片中确认分配的。效果就如图一样可以批量将数据的工号修改为CheckedListBox1控件中打勾的人。同时给这个人发去OpenQQ的弹窗告诉他接收导XX条新的客户资源。
但是这段代码只能给一个人分配同时只会提醒一个人。如果我想改成CheckedListBox1控件选择多个人时会将Table中勾选中的数据工号列中平均填入CheckedListBox1控件选择的多个人的工号并给这些人发送接收XX条新的客户资源应该怎么做。自己绕的有点晕麻烦各位老师了。。

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


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

Dim t As Table = Tables("资源分配_Table1")
Dim dic As new Dictionary(Of String, Integer)
Dim ary() As String = Forms("资源分配").Controls("CheckedListBox1").Value.split(",")
Dim i As Integer = 0
For Each r As Row In t.GetCheckedRows
    r("工号") = ary(i)
    If Forms("资源分配").Controls("_mtxz").Value = Nothing Then
    Else
        r("媒体") = Forms("资源分配").Controls("_mtxz").Value
    End If
    r("分配日期") = Forms("资源分配").Controls("DateTimePicker1").Value
    r.save
    Dim nm As String =  r("部门") & "." & r("工号")
    If dic.ContainsKey(nm) = False Then
        dic.Add(nm, 1)
    Else
        dic(nm) += 1
    End If
    i += 1
    If i = ary.length Then
        i = 0
    End If
Next
For Each key As String In dic.Keys
    QQClient.SendChatMessage(key, "{!} 已收到" & dic(key) & "条新的客户资源请及时处理!")
Next
Syscmd.Project.Save()

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


加好友 发短信
等级:一尾狐 帖子:409 积分:3723 威望:0 精华:0 注册:2017/6/9 18:02:00
  发帖心情 Post By:2017/11/7 13:59:00 [只看该作者]

感谢甜老师,没问题图片点击可在新窗口打开查看

 回到顶部