以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- [求助]设置确认按钮的错误。。 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=45393)
|
-- 作者:幼狐
-- 发布时间:2014/1/24 8:50:00
-- [求助]设置确认按钮的错误。。
逻辑列的DataColChanging代码:
If e.DataCol.name= "审核完成" Then Dim Result As DialogResult Result = MessageBox.Show("确定该订单审核无误,转生产部!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.NO Then e.Cancel=True End If End If
确认后会出现如下提示:第三张图的提示是我在生产部界面做的提示。不知道为什么跳到订单界面出现了。
此主题相关图片如下:111.jpg

此主题相关图片如下:222.jpg

此主题相关图片如下:333.jpg

|
-- 作者:Bin
-- 发布时间:2014/1/24 8:57:00
--
检查你是否触发改动了别的表的内容,从而触发别的表的DataColChanged事件.
|
-- 作者:幼狐
-- 发布时间:2014/1/24 9:00:00
--
是的,Bin老师,我是通过逻辑列自动复制行到下一流程,下一流程也有同样的DataColChanging事件。
像这种情况如何处理呢。因为我的下一流程也需要确认的
|
-- 作者:幼狐
-- 发布时间:2014/1/24 9:03:00
--
像自动复制行的这种情况,因为现在是一勾选逻辑列数据就自动复制到下1流程了,能否改为当勾选逻辑列后,数据不流转,只有保存数据后,才可以自动复制行的数据到下一流程呢。
|
-- 作者:Bin
-- 发布时间:2014/1/24 9:06:00
--
那你流转放到 保存事件去做. 就可以了.
|
-- 作者:幼狐
-- 发布时间:2014/1/24 9:56:00
--
If e.Col.Name = "交货日期" Then If e.Row.IsNull("交货日期") = False andalso e.row("已经入库")=false then If e.Row("交货日期") < Date.Today.AddDays(2) Then e.Style = "到期提醒" End If End If End If
Bin老师,上面的代码是我做到期提醒后,如果已经入库,就取消提醒。
我想在加个条件。就是如果实际入库数量不等0,也会取消提醒。代码如下:
If e.Col.Name = "交货日期" Then If e.Row.IsNull("交货日期") = False AndAlso e.Row("实际入库数量") = 0 Then If e.Row("交货日期") < Date.Today.AddDays(2) Then e.Style = "到期提醒" End If End If End If
为什么我把这2个代码都放在DrawCell事件里,只有1个判定条件有效呢。
|
-- 作者:Bin
-- 发布时间:2014/1/24 10:04:00
--
你应该用 orElse 不是 andalso
|
-- 作者:幼狐
-- 发布时间:2014/1/24 10:36:00
--
我这样写代码哪里错了,Bin老师。
If e.Col.Name = "交货日期" Then If e.Row.IsNull("交货日期") = False OrElse e.Row("实际入库数量") =0 OrElse e.Row("已经入库")=False Then If e.Row("交货日期") < Date.Today.AddDays(2) Then e.Style = "到期提醒" End If End If End If
|
-- 作者:Bin
-- 发布时间:2014/1/24 11:02:00
--
If e.Col.Name = "交货日期" Then If e.Row.IsNull("交货日期") = False ANDalso (e.Row("实际入库数量") =0 OrElse e.Row("已经入库")=False) Then If e.Row("交货日期") < Date.Today.AddDays(2) Then e.Style = "到期提醒" End If End If End If
或者
If e.Col.Name = "交货日期" Then If e.Row.IsNull("交货日期") = False Then if e.Row("实际入库数量") =0 OrElse e.Row("已经入库")=False then If e.Row("交货日期") < Date.Today.AddDays(2) Then e.Style = "到期提醒" End If end if End If End If
|
-- 作者:幼狐
-- 发布时间:2014/1/24 11:08:00
--
代码还是不行,Bin老师。2种代码都测试了。
|