public async Task <IActionResult> Detail(string id) { var inspectType = await this.inspectTypesService.GetCurrentInspectType(id); var viewModel = new EditInspectTypeViewModel { InspectTypeDetail = inspectType, }; return(this.View(viewModel)); }
public async Task <IActionResult> Edit([FromForm] EditInspectTypeViewModel model) { var isCreate = false; if (GlobalConstants.Editors.Contains(this.User.Identity.Name)) { isCreate = await this.inspectTypesService.EditInspectType(model.Id, model.Name); } if (isCreate) { this.TempData["EditInspectType"] = $"Типът преглед {model.Name} е редактиран!"; } return(this.RedirectToAction("All")); }