-- 作者:xianzheng
-- 发布时间:2015/11/1 9:21:00
-- [求助]时间比较问题
[求助]时间比较问题:
主表有”工作安排时间“列,关联明细表有“分工安排时间”列,要求“分工安排时间”必须小于”工作安排时间“,下面代码不知道哪里有错,运行失效
If e.DataCol.Name = "分工安排时间" AndAlso e.NewValue <> Nothing Then Dim drs As List(Of DataRow) = e.DataRow.GetChildRows("工作任务") For Each dr As DataRow In drs If e.NewValue < dr("安排时间") And e.NewValue <> Nothing Then Dim result As DialogResult result = MessageBox.Show("不能小于主表的\'安排时间\'", "提示",MessageBoxButtons.YesNo, MessageBoxIcon.Question) e.DataRow("分工安排时间") = Nothing e.cancel = True Exit For End If Next End If
此主题相关图片如下:qq图片20151101090919.png

|