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); }
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; }
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; }