以文本方式查看主题

-  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=152776)

--  作者:long086
--  发布时间:2020/7/21 22:46:00
--  自定义用户
请问老师

自定义用户与权限管理之一里面的用户管理窗口 的

 

"删除用户“按钮的代码为:

 

Dim lst As WinForm.ListBox = e.Form.Controls("ListBox1")
If
lst.SelectedIndex >=0 Then
    Dim UserName As String = lst.Sele ctedItem
    Dim
cmd As
New SQLCommand
    cmd.ConnectionName =
"User"
    cmd.CommandText =
"Del ete Fr om {Users} Where [Name] = \'" & UserName & "\'"
   cmd.ExecuteNonQuery
   lst.Items.RemoveAt(lst.SelectedIndex)
End If

 

如何在删除前加个提示确认


--  作者:有点蓝
--  发布时间:2020/7/21 22:50:00
--  
参考:http://www.foxtable.com/webhelp/topics/0326.htm

Dim Result As DialogResult
Result = MessageBox.Show(
"是不是
删除?""提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
删除的代码
End
 if

--  作者:hitzfeld
--  发布时间:2020/7/21 22:51:00
--  
Dim Result As DialogResult
Result = MessageBox.Show("请确认删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
    Tables("users").Current.Delete 
    DataTables.Save()  
Else
  forms("用户管理").open()
End If