public async Task <IActionResult> Create() { var model = new AddProcedureInputModel() { Categories = await this.categoriesService.GetAllAsSelectListItemAsync(), SkinTypes = await this.skinTypesService.GetAllAsSelectListItemAsync(), SkinProblems = await this.skinProblemsService.GetAllAsSelectListItemAsync(), }; return(this.View(model)); }
public async Task <IActionResult> Create(AddProcedureInputModel input) { if (!this.ModelState.IsValid) { input.Categories = await this.categoriesService.GetAllAsSelectListItemAsync(); input.SkinTypes = await this.skinTypesService.GetAllAsSelectListItemAsync(); input.SkinProblems = await this.skinProblemsService.GetAllAsSelectListItemAsync(); return(this.View(input)); } var id = await this.proceduresService.CreateAsync(input.Name, input.Description, input.Price, input.CategoryId, input.SkinTypeId, input.IsSensitive, input.SkinProblems); this.TempData["InfoMessage"] = GlobalMessages.SuccessCreateMessage; return(this.RedirectToAction(nameof(this.GetAll))); }