Пример #1
0
        public IActionResult Add()
        {
            ShopeFormVM model = new ShopeFormVM();

            model.Components = _shopeOperation.GetComponents();
            return(View(model));
        }
Пример #2
0
        public IActionResult Edit(int Id)
        {
            ShopeFormVM model = new ShopeFormVM();

            model.Shope      = _shopeOperation.GetEditShope(Id);
            model.Components = _shopeOperation.GetComponents();
            return(View(model));
        }
Пример #3
0
 public IActionResult Add(ShopeFormVM model)
 {
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     _shopeOperation.Create(model.Shope);
     return(RedirectToAction(nameof(ShopeList)));
 }
Пример #4
0
 public IActionResult Edit(ShopeFormVM model)
 {
     model.Components = _shopeOperation.GetComponents();
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     _shopeOperation.Edit(model.Shope);
     return(View(model));
 }