If e.DataCol.name = "结账" Then dim dr as datarow = e.DataRow Dim h As integer= date.now.hour
If dr("结账") = True Then If dr("开始日期") is Nothing Then MessageBox.Show("请输入『开始日期』!", "提示") dr("结账") = False Else If dr("停止日期") is Nothing Then dr("停止日期") = today End If dr("日期差")= (dr("停止日期")-dr("开始日期")).days+iif(h >10,1,0) dr.Locked = True End If End If End If