把签到日期控件改为日期控件
Dim Filter As String = "1=1 "
With e.Form.Controls("txtCardNumber")
If .Value IsNot Nothing Then
Filter &= " and 会员卡号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
Filter &= " and 上课时间 >= '" & .Value.Date & "' and 上课时间 < '" & .Value.Date.adddays(1) & "' and 签到次数 = 1"
End If
End With
If Filter > "" Then
Dim dr As DataRow = DataTables("上课签到表").Find(filter)
If dr IsNot Nothing Then
dr("下课时间") = Date.Now
dr("签到次数") = dr("签到次数") + 1
End If
End If