Exemple #1
0
 public ActionResult SaveRole(RoleEntity role)
 {
     try
     {
         var result = new RoleBC().SaveRole(role, CurrentUserInfo.Account);
         if (result == 0)
         {
             return(Json(string.Empty));
         }
         return(Json("保存成功"));
     }
     catch (Exception ex)
     {
         return(Json(string.Empty));
     }
 }
Exemple #2
0
        /// <summary>
        /// 根据角色ID获取已配置菜单列表
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public ActionResult GetMenusByRoleId(string RoleId)
        {
            try
            {
                List <string> menus  = new List <string>();
                var           result = new RoleBC().GetMenusByRoleId(RoleId);
                if (result != null && result.Count > 0)
                {
                    foreach (var item in result)
                    {
                        menus.Add(item.Menu_Id);
                    }
                }

                return(Json(menus, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new List <string>(), JsonRequestBehavior.AllowGet));
            }
        }
Exemple #3
0
 public ActionResult EnableRole(string roleId, int status)
 {
     try
     {
         if (string.IsNullOrEmpty(roleId))
         {
             return(Json(string.Empty));
         }
         var result = new RoleBC().EnableRole(roleId, status);
         if (result > 0)
         {
             return(Json("更新成功", JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(string.Empty, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(string.Empty, JsonRequestBehavior.AllowGet));
     }
 }