以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  MsgBox("ddddd!",64,"提示"),重复提示  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=11680)

--  作者:yanzhen2010
--  发布时间:2011/8/7 20:26:00
--  MsgBox("ddddd!",64,"提示"),重复提示

If e.DataCol.Name = "拼音码" Then
    If e.DataRow.Isnull("拼音码") Then
        e.DataRow("项目类别") = Nothing
        e.DataRow("项目名称") = Nothing
        e.DataRow("sys_剂量值") = Nothing
        e.DataRow("启用") = False
    Else
        Dim dr As DataRow = DataTables("收费项目").Find("[拼音码] = \'" & e.DataRow("拼音码") & "\'")
        If dr IsNot Nothing Then
            e.DataRow("项目类别") = dr("项目类别")
            e.DataRow("项目名称") = dr("项目名称")
            e.DataRow("sys_剂量值") = dr("规格值")
            e.DataRow("启用") = True
        Else
            MsgBox("项目不存在,请重新输入!",64,"提示")
            e.DataRow("项目类别") = Nothing
            e.DataRow("项目名称") = Nothing
            e.DataRow("sys_剂量值") = Nothing
            e.DataRow("拼音码") = Nothing
            e.DataRow("启用") = False
        End If
    End If
End If
If e.DataCol.Name = "追加数量" Then
    If e.DataRow("追加数量")>=1 Then
        e.DataRow("启用") = True
    Else
        e.DataRow("追加数量") = Nothing
        e.DataRow("启用") = False
        MsgBox("数量不能小于1!",64,"提示")
    End If
End If

 

求助1,红色的代码会重复提示2次,怎么能让提示1次?

求助2,上下两组代码均以If e.DataCol.Name = "拼音码" Then开头,如何如何合并到一起?

 


--  作者:狐狸爸爸
--  发布时间:2011/8/7 22:30:00
--  
If e.DataCol.Name = "追加数量" Then
    If e.DataRow("追加数量")>=1 Then
        e.DataRow("启用") = True
    ElseIf e.DataRow.IsNull("追加数量") =False
        e.DataRow("追加数量") = Nothing
        e.DataRow("启用") = False
        MsgBox("数量不能小于1!",64,"提示")
    End If
End If

--  作者:yanzhen2010
--  发布时间:2011/8/7 23:56:00
--  
以下是引用狐狸爸爸在2011-8-7 22:30:00的发言:
If e.DataCol.Name = "追加数量" Then
    If e.DataRow("追加数量")>=1 Then
        e.DataRow("启用") = True
    ElseIf e.DataRow.IsNull("追加数量") =False
        e.DataRow("追加数量") = Nothing
        e.DataRow("启用") = False
        MsgBox("数量不能小于1!",64,"提示")
    End If
End If
学习学习:e.DataRow("追加数量") =  ,ElseIf e.DataRow.IsNull("追加数量") =

Nothing和False居然得到的结果不一样,呵呵

[此贴子已经被作者于2011-8-8 0:02:04编辑过]