public async Task <IActionResult> Edit(PartsEditViewModel vm) { if (!ModelState.IsValid) { return(View()); } var editSuccessful = (await _partsService.TryEditPart(vm.Id, vm.MfrsPartNumber, vm.PartCategoryId, vm.CataloguePartNumber, vm.Name, vm.Description, vm.PriceIn, vm.PriceOut, vm.Vendor, vm.MinimumStock, vm.Image)); if (editSuccessful) { StatusMessage = ("Changes saved successfully."); Success = true; } else { StatusMessage = "There was an error handling your request. Try again, and if the issue persists contact site administration."; Success = false; } return(RedirectToAction("Index", "Inventory")); }