Exemplo n.º 1
0
 public override void OnClick()
 {
     if (m_Hook.RoleTree.SelectedNode != null)
     {
         Exception eError;
         Role      role = m_Hook.RoleTree.SelectedNode.Tag as Role;
         if (role == null)
         {
             return;
         }
         if (role.Name == "超级管理员")
         {
             ErrorHandle.ShowFrmErrorHandle("提示", "管理员不能删除!");
             return;
         }
         if (ErrorHandle.ShowFrmInformation("确认", "取消", "确认删除?"))
         {
             if (ModuleOperator.DeleteData("role", "roleid", role.IDStr, ref ModData.gisDb, out eError))
             {
                 if (this.WriteLog)
                 {
                     Fan.Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志
                 }
                 m_Hook.RoleTree.SelectedNode.Remove();
             }
             else
             {
                 if (eError != null)
                 {
                     ErrorHandle.ShowInform("提示", eError.Message);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 public override void OnClick()
 {
     if (m_Hook.UserTree.SelectedNode != null)
     {
         Exception eError;
         User      user = m_Hook.UserTree.SelectedNode.Tag as User;
         if (user == null)
         {
             return;
         }
         if (m_AppUser == null)
         {
             return;
         }
         if (user.Name.ToLower() == "admin")
         {
             ErrorHandle.ShowFrmErrorHandle("提示", "管理员不能删除!");
             return;
         }
         if (user.IDStr == m_AppUser.IDStr)
         {
             ErrorHandle.ShowFrmErrorHandle("提示", "用户不能删除自己!");
             return;
         }
         if (ErrorHandle.ShowFrmInformation("确认", "取消", "确认删除?"))
         {
             //删除提取范围
             ModuleOperator.DeleteData("USER_EXPORT", "userid", user.IDStr, ref ModData.gisDb, out eError);
             if (ModuleOperator.DeleteData("user_info", "userid", user.IDStr, ref ModData.gisDb, out eError))
             {
                 if (this.WriteLog)
                 {
                     Fan.Plugin.LogTable.Writelog(Caption);//xisheng 2011.07.09 增加日志
                 }
                 m_Hook.UserTree.SelectedNode.Remove();
             }
             else
             {
                 if (eError != null)
                 {
                     ErrorHandle.ShowInform("提示", eError.Message);
                     return;
                 }
             }
         }
     }
 }