Example #1
0
        public CreateRoleGroupViewModel CreateViewModel(CreateRoleGroupViewModel viewModel)
        {
            viewModel.LevelList = _levelService.GetLevels(
                new Services.Requests.Level.GetLevelsRequest {
                Skip = 0, Take = 0
            }).Levels.Select(x => new SelectListItem
            {
                Text  = x.Name,
                Value = x.Id.ToString()
            }).ToList();

            return(viewModel);
        }
        public CreateRoleGroupViewModel CreateViewModel(CreateRoleGroupViewModel viewModel)
        {
            viewModel.LevelList = _levelService.GetLevels(
                new Services.Requests.Level.GetLevelsRequest {
                Take = -1,
                SortingDictionary = new Dictionary <string, SortOrder> {
                    { "Name", SortOrder.Ascending }
                }
            }).Levels.Select(x => new SelectListItem {
                Text = x.Name, Value = x.Id.ToString()
            }).ToList();
            viewModel.IsActive = true;

            return(viewModel);
        }
Example #3
0
        public ActionResult List()
        {
            // Get the source list and map to the view model type.
            var targetList = _levelService.GetLevels().ToList();

            return(View(targetList));
        }
Example #4
0
        public async Task <IActionResult> Index()
        {
            IEnumerable <Level> level = (await levelService.GetLevels()).Select(lvl =>
            {
                lvl.LevelEncryptedId = protector.Protect(lvl.Id.ToString());
                return(lvl);
            });

            return(View(level));
        }
Example #5
0
 public void GetDataRowCount(GridViewCustomBindingGetDataRowCountArgs e)
 {
     e.DataRowCount = _levelService.GetLevels(new GetLevelsRequest()).Levels.Count;
 }