Example #1
0
        private List <AccessRightDTO> FillDescriptions(List <AccessRightDTO> ARCS)
        {
            IEnumerable <SelectListItem> ControllerList = EnumService.GetControllers();
            IEnumerable <SelectListItem> ActionList;

            foreach (AccessRightDTO ARC in ARCS)
            {
                ARC.ContollerDescription = ControllerList.Where(c => c.Value == ARC.AccessRightObj.Controller).Select(c => c.Text).FirstOrDefault();
                ActionList            = EnumService.GetActions(ARC.AccessRightObj.Controller);
                ARC.ActionDescription = ActionList.Where(a => a.Value == ARC.AccessRightObj.Action).Select(a => a.Text).FirstOrDefault();
            }
            ARCS = ARCS.OrderBy(u => u.AccessRightObj.Controller).ToList();
            return(ARCS);
        }
Example #2
0
        public JsonResult GetActionList(string controlerName)
        {
            IEnumerable <SelectListItem> selectListItems = EnumService.GetActions(controlerName);

            return(Json(selectListItems, JsonRequestBehavior.AllowGet));
        }
Example #3
0
 public AccessRightVM FillActions(AccessRightVM viewModel, string ControllerName)
 {
     viewModel.Actions = EnumService.GetActions(ControllerName);
     return(viewModel);
 }