示例#1
0
        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
        public IActionResult Delete(int id, CreatePartsModel model)
        {
            this.parts.Delete(id);

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