以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [讨论]这段小代吗虽然能正确执行,但总觉得那里不妥,谁帮我看看  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=43125)

--  作者:dycjj
--  发布时间:2013/11/29 23:10:00
--  [讨论]这段小代吗虽然能正确执行,但总觉得那里不妥,谁帮我看看
Dim dr As DataRow = CurrentTable.Current.DataRow
If dr IsNot Nothing Then
    Dim Result As DialogResult
    Result = MessageBox.Show("确实要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If dr("营销人员") <> User.Name Then
        MessageBox.Show("老表姐,这不是你的记录,你无权删除哦")
        e.Cancel = True
    Else
        If Result = DialogResult.Yes Then
             Tables("短信通_Table1").Current.Delete
            End If
    End If
End If

--  作者:逛逛
--  发布时间:2013/11/30 8:55:00
--  
Dim dr As DataRow = CurrentTable.Current.DataRow
If dr IsNot Nothing Then
    If dr("营销人员") <> User.Name Then
        MessageBox.Show("老表姐,这不是你的记录,你无权删除哦")
        e.Cancel = True
    Else
        Dim Result As DialogResult
       Result = MessageBox.Show("确实要删除吗?", "提示", MessageBoxButtons.YesNo,   MessageBoxIcon.Question)
        If Result = DialogResult.Yes Then
             Tables("短信通_Table1").Current.Delete
            End If
    End If
End If
 
 
感觉改一下次序会顺一点,不会直接跳出删除确认的对话框

--  作者:dycjj
--  发布时间:2013/11/30 20:57:00
--  
呵呵,却实是这样,谢谢逛逛 大师了
--  作者:程兴刚
--  发布时间:2013/11/30 21:23:00
--  
if MessageBox.Show("确实要删除吗?", "系统询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = 7

    Return

end if
if CurrentTable.Current = nothing
     MessageBox.Show("请先选择一条记录后再删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information

     Return

end if

Dim dr As DataRow = CurrentTable.Current.DataRow
If dr("营销人员") <> User.Name Then
    MessageBox.Show("老表姐,这不是你的记录,你无权删除哦")
else
    CurrentTable.Current.Delete
End If

--  作者:dycjj
--  发布时间:2013/12/2 0:33:00
--  
程总出马,更具说服力哦