Foxtable(狐表)用户栏目专家坐堂 → 求助,用户管理


  共有1510人关注过本帖树形打印复制链接

主题:求助,用户管理

帅哥哟,离线,有人找我吗?
long086
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:298 积分:2605 威望:0 精华:0 注册:2013/5/22 7:16:00
求助,用户管理  发帖心情 Post By:2019/7/23 21:36:00 [只看该作者]

示例文件中的 用户管理 窗口 的 删除用户 按钮,我想新增一个 admin 管理员 账号,这个账号不允许删除,怎么实现

 

Dim lst As WinForm.ListBox = e.Form.Controls("ListBox1")
If lst.SelectedIndex >=0 Then
    Dim UserName As String = lst.SelectedItem
        _UserTable.SQLDeleteFor("[Name] = '" & UserName & "'")
        lst.Items.RemoveAt(lst.SelectedIndex)
        lst.Select()     
End If

 

这个是原代码

[此贴子已经被作者于2019/7/23 22:13:13编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106665 积分:542508 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/23 22:29:00 [只看该作者]

Dim lst As WinForm.ListBox = e.Form.Controls("ListBox1")
If lst.SelectedIndex >=0 Then
    Dim UserName As String = lst.SelectedItem
if UserName  ="admin" then
msgbox("不允许删除")
return
end if
        _UserTable.SQLDeleteFor("[Name] = '" & UserName & "'")
        lst.Items.RemoveAt(lst.SelectedIndex)
        lst.Select()      
End If

 回到顶部