示例#1
0
文件: Role.cs 项目: radtek/geosufan
 /// <summary>
 /// 更新角色功能权限,先删后新增
 /// </summary>
 /// <param name="listFunc"></param>
 /// <returns></returns>
 public string UpdateRoleFunction(List <string> listFunc)
 {
     if (listFunc.Count <= 0)
     {
         return(string.Format("更新列表不能为空"));
     }
     if (!m_DbOperate.DeleteRow(TableName.TRoleFunction, string.Format("{0}='{1}'", ColumnName.RoleID, m_RoleID)))
     {
         return(string.Format("修改权限失败:删除权限失败"));
     }
     foreach (string func in listFunc)
     {
         if (m_DbOperate.AddRow(TableName.TRoleFunction, new List <string> {
             ColumnName.RoleID, ColumnName.FID
         }, m_RoleID, func))
         {
             continue;
         }
         else
         {
             return(string.Format("修改权限失败"));
         }
     }
     return(string.Empty);
 }
示例#2
0
 /// <summary>
 /// 删除用户
 /// </summary>
 /// <returns></returns>
 public string DeleteUser()
 {
     if (string.IsNullOrEmpty(m_UserCode))
     {
         return(string.Format("删除用户失败:用户ID为空"));
     }
     if (!m_dbOperate.DeleteRow(TableName.TUserRole, string.Format("{0}='{1}'", ColumnName.UserCode, m_UserCode)))
     {
         return(string.Format("删除用户权限失败:请查询相应日志信息"));
     }
     if (!m_dbOperate.DeleteRow(TableName.TUser, string.Format("{0}='{1}'", ColumnName.UserCode, m_UserCode)))
     {
         return(string.Format("删除用户失败:请查询相应日志信息"));
     }
     return(string.Empty);
 }