Dim lst3 As New List(of Date)Do While d <= d1
If (d.DayOfWeek = 0 OrElse d.DayOfWeek = 6 OrElse lst1.Contains(d)) And lst2.Contains(d) = False
Else
lst3.add(d)
End If
d = d.AddDays(1)
Loop
For each d2 as date in lst3
Dim dr = DataTables("托管日况").AddNew
dr("学生编号") = e.Form.Controls("学生编号").text
dr("托管班级") = e.Form.Controls("托管班级").text
dr("托管日期") = d2
dr("录入日期") = Format(Date.Now,"yyyy-MM-dd")
dr("录入人") = _UserJgbh
Next
[此贴子已经被作者于2019/11/14 13:55:09编辑过]