Ejemplo n.º 1
0
        public ActionResult Update(UpdateRoleGroupViewModel viewModel)
        {
            var request = viewModel.MapTo<UpdateRoleGroupRequest>();
            var response = _roleGroupService.Update(request);
            TempData["IsSuccess"] = response.IsSuccess;
            TempData["Message"] = response.Message;
            if (response.IsSuccess)
            {
                return RedirectToAction("Index");
            }

            return View("Update", viewModel);
        }
Ejemplo n.º 2
0
        public UpdateRoleGroupViewModel UpdateViewModel(UpdateRoleGroupViewModel 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;
        }
Ejemplo n.º 3
0
        public UpdateRoleGroupViewModel UpdateViewModel(UpdateRoleGroupViewModel 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();

            return viewModel;
        }