根据时间来判断当月是否有过政治生日的党员,怎么优化提示信息内容!
想实现根据党员信息中的身份证号来去查找党员流程表中的数据,如果有登记类别为预备党员的记录,那就提取符合条件的时间,来进行判断是否为当月过政治生日,并在文本框里面显示出来
代码如下:
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

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