コード例 #1
0
ファイル: PartsController.cs プロジェクト: player200/SoftUni
        public IActionResult Edit(int id, CreatePartsModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            this.parts.Edit(
                id,
                model.Name,
                model.Price,
                model.Quantity
                );

            return(RedirectToAction(nameof(All)));
        }
コード例 #2
0
ファイル: PartsController.cs プロジェクト: player200/SoftUni
        public IActionResult Delete(int id, CreatePartsModel model)
        {
            this.parts.Delete(id);

            return(RedirectToAction(nameof(All)));
        }