原代码是当去向为空时,归还日期为系统日期,现在想改成取自设备目录表、设备管理窗口、DateTimePicker1控件的值,代码应该如何修改,请各位老师指教,谢谢!!(附原代码)
Select Case e.DataCol.Name
Case "去向"
If e.DataRow.IsNull("去向") And e.DataRow.IsNull("使用单位") Then
e.DataRow("归还日期")=Nothing
Else
Dim dr As DataRow = DataTables("设备目录").Find("[设备编号] = '" & e.DataRow("设备编号") & "'")
If e.DataRow.IsNull("去向") Then
e.DataRow("归还日期") = Date.Today
If dr IsNot Nothing Then
dr("使用单位") = e.DataRow("使用单位")
End If
Else
dr("使用单位") = e.DataRow("产权单位")
End If
End If
End Select
[此贴子已经被作者于2011-9-21 9:15:19编辑过]