public JsonResult GetMenuManagmentAssign(long MenuNo) { MenuManagmentAssignVo assignVo = new MenuManagmentAssignVo(); JsonResponses jsonResponses = assignSDK.GetMenuManagmentAssign(MenuNo); if (jsonResponses.ValidateResponses()) { assignVo = JsonConvert.DeserializeObject <MenuManagmentAssignVo>(JsonConvert.SerializeObject(jsonResponses.data)); } return(Json(assignVo, JsonRequestBehavior.AllowGet)); }
public ActionResult <JsonResponses> GetMenuManagmentAssign([FromQuery] long MenuNo) { bool result = DataHandleManager.Instance().PsMenuHandle.CheckMenuNoIsExist(MenuNo); if (!result) { return(new JsonResponses(JsonResponses.FailedCode, ErrorResultType.ERROR_MENUNO_NOT_EXISET.ToString())); } MenuManagmentAssignVo assignVo = DataHandleManager.Instance().PsMenuManagementHandle.GetMenuManagmentAssignVo(MenuNo); return(new JsonResponses(assignVo)); }
/// <summary> /// 获取菜单权限列表 /// </summary> /// <param name="menuNo"></param> /// <returns></returns> public MenuManagmentAssignVo GetMenuManagmentAssignVo(long MenuNo) { MenuManagmentAssignVo assignVo = new MenuManagmentAssignVo(); List <PsMenuManagement> menuManagements = this.GetMenuManagements(MenuNo); assignVo.MenuInfo = DataHandleManager.Instance().PsMenuHandle.GetMenuInfo(MenuNo); List <OptionValue> optionValues = DataHandleManager.Instance().PsManagementHandle.GetRolesOptionValues(assignVo.MenuInfo.PlatformNo, (int)ManagementType.OPERATE_TYPE); assignVo.optionValues = new List <CheckOptionValue>(); foreach (var item in optionValues) { bool isCheck = menuManagements.Where(o => o.ManagementNo == item.Value).FirstOrDefault() != null; assignVo.optionValues.Add(new CheckOptionValue() { isCheck = isCheck, Name = item.Name, Value = item.Value }); } return(assignVo); }