Example #1
0
 //
 private string Update(HttpContext context)
 {
     try
     {
         int succ = 0;
         int err  = 0;
         if (1 == adminUser.AdminTypeId)
         {
             SysLogBll.Create("系统管理员", "更新系统管理员操作", adminUser.AdminName);
             AdminUser model = GetModel(context);
             if (dal.Update(model))
             {
                 dynamic   role = null;
                 DataTable dt   = new PermissionsDal().GetAllList(model.AdminTypeId);
                 roleDal.Delete(model.Id);
                 foreach (dynamic row in dt.Rows)
                 {
                     role             = new RolePermissions();
                     role.AdminUserId = model.Id;
                     role.SysFunId    = int.Parse(row["SysFunId"].ToString());
                     role.Editor      = adminUser.AdminLogName;
                     if (roleDal.Create(role))
                     {
                         succ++;
                     }
                     else
                     {
                         err++;
                     }
                 }
                 return("更新成功!— 授权操作成功了[" + succ.ToString() + "]条,失败了[" + err.ToString() + "]条!");
             }
             else
             {
                 return("更新失败,请重新操作!");
             }
         }
         else
         {
             return("您没有管理员权限!");
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord("时间:[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]类名:[" + this.GetType().Name + "],行号:[" + Component.GetLineNum().ToString() + "行],错误信息:[" + ex.Message + "]");
         return("更新失败,错误代码:500 ");
     }
 }
Example #2
0
 public PermissionsBll()
 {
     dal = new PermissionsDal();
     xml = new XmlHelper();
 }
Example #3
0
 public PermissionsBll()
 {
     adminUser = new AdminUser();
     dal       = new PermissionsDal();
 }