public IActionResult Edit3DScanners(int id, ThreeDScannerBindingModel threeDScannerModel) { if (!ModelState.IsValid) { return(View(threeDScannerModel)); } var threeDScannerExists = this.threeDScanners.Exists(id); if (!threeDScannerExists) { return(NotFound()); } this.threeDScanners.EditScanners( id, threeDScannerModel.Make, threeDScannerModel.Model, threeDScannerModel.Price, threeDScannerModel.WorkingRange, threeDScannerModel.DepthImageSize, threeDScannerModel.Description, threeDScannerModel.ImageUrl); return(RedirectToAction("All3DScanners")); }
public IActionResult Add3DScanner(ThreeDScannerBindingModel threeDScannerModel) { if (!ModelState.IsValid) { return(View(threeDScannerModel)); } this.threeDScanners.Create( threeDScannerModel.Make, threeDScannerModel.Model, threeDScannerModel.Price, threeDScannerModel.WorkingRange, threeDScannerModel.DepthImageSize, threeDScannerModel.Description, threeDScannerModel.ImageUrl, this.userManager.GetUserId(User)); return(RedirectToAction("All3DScanners")); }