以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  时间判断问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87418)

--  作者:douglas738888
--  发布时间:2016/7/11 11:59:00
--  时间判断问题
请教老师,以下代码写的有点问题,不执行判断提醒

If e.DataCol.Name = "计划开始时间" AndAlso e.NewValue <> Nothing Then  
   Dim pr As DataRow = e.DataRow.GetParentrow("投标策商任务书")
   If e.NewValue < pr("计划开始时间") Then 
    Dim drs As List(Of DataRow) = e.DataRow.GetChildRows("投标商务主表")
        For Each dr As  DataRow  In drs
            Dim result As  DialogResult
            result = MessageBox.Show("不能小于总策划的\'计划开始时间\'", "提示",MessageBoxButtons.YesNo, MessageBoxIcon.Question)
            e.DataRow("计划开始时间") = Nothing
            e.cancel = True
            Exit  For
    Next
   End If
End If

--  作者:大红袍
--  发布时间:2016/7/11 12:30:00
--  
 加入msgbox看哪个if判断没有进入。
--  作者:douglas738888
--  发布时间:2016/7/11 13:00:00
--  
msgbox,报错,datarow 无法转换为 STRING
--  作者:大红袍
--  发布时间:2016/7/11 14:31:00
--  
If e.DataCol.Name = "计划开始时间" AndAlso e.NewValue <> Nothing Then  
msgbox(1)
   Dim pr As DataRow = e.DataRow.GetParentrow("投标策商任务书")
msgbox(2)
   If e.NewValue < pr("计划开始时间") Then 
msgbox(3)
    Dim drs As List(Of DataRow) = e.DataRow.GetChildRows("投标商务主表")
msgbox(drs.count & "abc")
        For Each dr As  DataRow  In drs
            Dim result As  DialogResult
            result = MessageBox.Show("不能小于总策划的\'计划开始时间\'", "提示",MessageBoxButtons.YesNo, MessageBoxIcon.Question)
            e.DataRow("计划开始时间") = Nothing
            e.cancel = True
            Exit  For
    Next
   End If
End If