public IActionResult Add() { ShopeFormVM model = new ShopeFormVM(); model.Components = _shopeOperation.GetComponents(); return(View(model)); }
public IActionResult Edit(int Id) { ShopeFormVM model = new ShopeFormVM(); model.Shope = _shopeOperation.GetEditShope(Id); model.Components = _shopeOperation.GetComponents(); return(View(model)); }
public IActionResult Add(ShopeFormVM model) { if (!ModelState.IsValid) { return(View(model)); } _shopeOperation.Create(model.Shope); return(RedirectToAction(nameof(ShopeList))); }
public IActionResult Edit(ShopeFormVM model) { model.Components = _shopeOperation.GetComponents(); if (!ModelState.IsValid) { return(View(model)); } _shopeOperation.Edit(model.Shope); return(View(model)); }