public IActionResult CreateWithRole() { var model = new CreateAccountViewModel { Roles = new List <SelectListItem> { new SelectListItem { Text = "Client", Value = "Client" }, new SelectListItem { Text = "Secretary", Value = "Secretary" }, new SelectListItem { Text = "Mechanic", Value = "Mechanic" }, new SelectListItem { Text = "Admin", Value = "Admin" }, }, Specialties = _specialtyRepository.GetComboSpecialty() }; return(View(model)); }
//// GET: Mecanics/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var mechanic = await _mechanicRepository.GetMechanicWithSpecialtyById(id.Value); if (mechanic == null) { return(NotFound()); } var model = _converterHelper.ToPersonEditViewModel(mechanic); model.Specialties = _specialtyRepository.GetComboSpecialty(); model.SpecialtyId = mechanic.SpecialtyId; return(View(model)); }