Foxtable(狐表)用户栏目专家坐堂 → 根据时间来判断当月是否有过政治生日的党员,怎么优化提示信息内容!


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

主题:根据时间来判断当月是否有过政治生日的党员,怎么优化提示信息内容!

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


加好友 发短信
等级:九尾狐 帖子:2472 积分:17346 威望:0 精华:0 注册:2013/1/31 0:03:00
根据时间来判断当月是否有过政治生日的党员,怎么优化提示信息内容!  发帖心情 Post By:2020/4/28 17:33:00 [只看该作者]

根据时间来判断当月是否有过政治生日的党员,怎么优化提示信息内容!

想实现根据党员信息中的身份证号来去查找党员流程表中的数据,如果有登记类别为预备党员的记录,那就提取符合条件的时间,来进行判断是否为当月过政治生日,并在文本框里面显示出来

代码如下:
Dim t4 As WinForm.TextBox =Forms("政治生日").Controls("TextBox1")
Dim d4 = t4.BaseControl

Dim lsts As New List(Of String())
lsts= DataTables("党员信息").S QLGetValues("支部名称|姓名|身份证号")
For Each lst As String() In lsts
    Dim lsts1 As New List(Of String)
    lsts1= DataTables("党员流程").S QLGetValues("时间","身份证号='" & lst(2) & "' and 登记类别='预备党员'")
    For Each lst1 As String In lsts1
        Dim dt As Date = Date.Today
        Dim d As Date = lst1
        If dt.Month= d.Month Then
            output.Show("本月过政治生日有{" & lst(1) & "},其入党时间为【" & Format(d, "yyyy-MM-dd") & "】,所在支部" & lst(0) & "")
            t4.Text= t4.Text & vbcrlf & "本月过政治生日有{" & lst(1) & "},其入党时间为【" & Format(d, "yyyy-MM-dd") & "】,所在支部" & lst(0) & ""
        Else
            output.Show("本月无人员过政治生日!")
            t4.Text= t4.Text & vbcrlf & "本月没有党员过政治生日!"
        End If
    Next
Next

t4.SelectionStart = t4.Text.Length
d4.ScrollToCaret
Application.DoEvents


当前代码运行后效果如图“”

图片点击可在新窗口打开查看此主题相关图片如下:1111.png
图片点击可在新窗口打开查看

当前图片是把过政治生日的已经显示出来了  同时也把不符合条件的数据显示出来了
想进一步实现,
当前有党员政治生日时,就只显示第一条,不再显示没有党员过政治生日
当本月没有任何一个党员过政治生日时,显示没有党员过政治生日的提示。

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


加好友 发短信
等级:超级版主 帖子:109728 积分:558356 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/28 20:15:00 [只看该作者]

Dim t4 As WinForm.TextBox =Forms("政治生日").Controls("TextBox1")
Dim d4 = t4.BaseControl

Dim lsts As New List(Of String())
lsts= DataTables("党员信息").S QLGetValues("支部名称|姓名|身份证号")
Dim str As String = ""
For Each lst As String() In lsts
    Dim lsts1 As New List(Of String)
    lsts1= DataTables("党员流程").S QLGetValues("时间","身份证号='" & lst(2) & "' and 登记类别='预备党员' and Month(时间) =" & Date.Today.Month)
    For Each lst1 As String In lsts1
        output.Show("本月过政治生日有{" & lst(1) & "},其入党时间为【" & Format(d, "yyyy-MM-dd") & "】,所在支部" & lst(0) & "")
        str = str & vbcrlf & "本月过政治生日有{" & lst(1) & "},其入党时间为【" & Format(d, "yyyy-MM-dd") & "】,所在支部" & lst(0) & ""
    Next
Next
If str > "" Then
    t4.Text= t4.Text & str
Else
    output.Show("本月无人员过政治生日!")
    t4.Text= t4.Text & vbcrlf & "本月没有党员过政治生日!"
End If

t4.SelectionStart = t4.Text.Length
d4.ScrollToCaret
Application.DoEvents

 回到顶部