Select Case e.DataCol.Name
Case "账单固定日","还款固定日"
Dim cd As DataRow=e.DataRow
Dim d1 As Date=Date.Today
Dim y As Integer =d1.year
Dim m As Integer=d1.month
Dim d As Integer=d1.day
If cd.isnull("账单固定日") OrElse cd.Isnull("还款固定日") Then
cd("账单日")=Nothing
cd("最后还款日")=Nothing
Else
Dim d2 As Date = new Date(y,m,Date.DaysInMonth(y,m))
If d2.Day < cd("账单固定日")
cd("账单日")= d2
Else
cd("账单日")=new Date(y,m,cd("账单固定日"))
End If
If cd("账单固定日")>cd("还款固定日") Then
If m<12 Then
m=m+1
Else
y=d1.AddYears(1).year
m=1
End If
End If
If cd("还款固定日")=31 Then
d=Date.daysinmonth(y,m)
cd("最后还款日")= new Date(y,m,d)
Else
cd("最后还款日")= new Date(y,m,cd("还款固定日"))
End If
End If
End Select