Пример #1
0
        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"));
        }
Пример #2
0
        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"));
        }