Dim d As Date = Date.Today
Dim XQ As String
If d.Month >= 5 And d.Month <=11 Then
XQ = d.Year & "年秋季"
Else If d.Month = 12 Then
XQ = (d.Year+1) & "年春季"
Else If d.Month < 5 Then
XQ = d.Year & "年春季"
End If
Dim kbs() As String = {"学费","餐费","车费"}
Dim bts() As String = {"学费","餐费","车费"}
For j As Integer = 0 To kbs.Length - 1
Dim kb As String = e.Form.Controls(kbs(j)).Text
Dim bt As String = e.Form.Controls(bts(j)).Name
If kb> "" Then
DataTables("缴费标准").deletefor("学期 = '"& XQ &"' And 缴费项目 = '"& bt &"'")
Dim idx As Integer = Tables("缴费标准").Rows.Count
Tables("缴费标准").AddNew(4)
Dim dr As Row
For i As Integer = idx To Tables("缴费标准").Rows.Count - 1
dr = Tables("缴费标准").Rows(i)
dr("学期") = XQ
dr("缴费项目") = bt
dr("月份") = format(i-idx+1)+2
If dr("月份") = 3 Then
dr("缴费金额") = e.Form.Controls(kbs(j)).Text
End If
If dr("月份") = 4 Then
dr("缴费金额") = e.Form.Controls(kbs(j)).Text*0.75
End If
If dr("月份") = 5 Then
dr("缴费金额") = e.Form.Controls(kbs(j)).Text*0.5
End If
If dr("月份") = 6 Then
dr("缴费金额") = e.Form.Controls(kbs(j)).Text*0.25
End If
Next
End If
Next