/// <summary> /// 获取权限列表 /// </summary> /// <returns></returns> public JsonResult GetRights() { UserDbContext udb = new UserDbContext("ConnStr1"); List <Rights> list = udb.GetRights(); var list2 = from r in list select new { RightName = r.RightName, RightID = r.RightID }; JsonResult jr = Json(list2.ToList(), JsonRequestBehavior.AllowGet); return(jr); }
/// <summary> /// 权限更新页面 /// </summary> /// <param name="rightID"></param> /// <returns></returns> public ActionResult UpdateRight(string rightID) { Rights data = new Rights(); string resStr = string.Empty; try { UserDbContext udb = new UserDbContext("ConnStr1"); data = udb.GetRights(rightID); } catch (Exception ex) { resStr = MisBase.BaseUT.GetRootException(ex).Message; } return(View(data)); }
/// <summary> /// 获取权限列表 /// </summary> /// <returns></returns> public JsonResult GetRightDataGrid() { UserDbContext udb = new UserDbContext("ConnStr1"); List <Rights> list = udb.GetRights(); var list2 = from r in list select new { r.RightDesc, r.RightID, r.RightName, r.RightUrl, RightID2 = r.RightID }; return(Json(list2.ToList(), JsonRequestBehavior.AllowGet)); }