Beispiel #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);
        }
Beispiel #2
0
 public AccessRightVM FillControllers(AccessRightVM viewModel)
 {
     viewModel.Controllers = EnumService.GetControllers();
     return(viewModel);
 }