老师:如果我有三列:额定生产时间,计划生产时间,计划完成时间。另外有三个变量,一个是计划开始日期、计划每天上班时间,计划每天下班时间,那在这三个就变量中输入数据后对表中开始时间与完成时间进行计算。Dim RQ As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker3")
Dim SSJ As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
Dim XSJ As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker2")
Dim pg As WinForm.TabControl = e.Form.Controls("页签")
Dim n As String = pg.SelectedPage.Name
Dim t As String = "生产计划_" & n
For i As Integer = 0 To Tables(t).Rows.Count-1
If I=0 Then
Tables(t).Rows(i)("计划生产时间") = RQ.Value & " " & Format(SSJ.Value,"hh:mm:ss")
Tables(t).Rows(i)("计划完成时间") = Tables(t).Rows(i)("计划生产时间").AddSeconds(Tables(t).Rows(i)("额定生产时间"))
Else
Tables(t).Rows(i)("计划生产时间") = Tables(t).Rows(i-1)("计划完成时间")
Tables(t).Rows(i)("计划完成时间") = Tables(t).Rows(i)("计划生产时间").AddSeconds(Tables(t).Rows(i)("额定生产时间"))
End If
End If
Next
如果为以上代码它只会算24小时连续生产就行,但如果每天计划生产时间不同就不会计划,这要怎么改代码?请指教