/// <summary> /// 获取设置用户分组的信息 /// </summary> /// <param name="ID"></param> /// <returns></returns> public ActionResult SetAction(int ID) { //根据ID查询出权限信息的信息 var currentUser = _actioninfoService.LoadEntities(u => u.ID == ID).FirstOrDefault(); ViewData.Model = currentUser; //根据传递过去的菜单组获取到所有的菜单组信息 short ActionID = (short)DelFlagEnum.Normal; var allAction = _actionGroupService.LoadEntities(c => c.DelFlag == ActionID).ToList(); ViewBag.AllAction = allAction; //然后传递给前台判断权限组数据是否被选中 ViewBag.Exists = (from n in currentUser.ActionGroup //获取到权限表 select n.ID).ToList(); return(View()); }
/// <summary> /// 实现对前台信息的绑定 /// </summary> /// <param name="ID"></param> /// <returns></returns> public ActionResult BindActionGroupInfo(int ID) { var data = _actiongroupService.LoadEntities(c => c.ID == ID).FirstOrDefault(); return(Json(data, JsonRequestBehavior.AllowGet)); }