Example #1
0
 public ActionResult Delete(int id, Store model)
 {
     try
     {
         _storeService.Delete(id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Example #2
0
 public ActionResult Create(Store model)
 {
     if (ModelState.IsValid)
     {
         _storeService.Create(model);
         return RedirectToAction("Index");
     }
     else
     {
         return View(model);
     }
 }
Example #3
0
 public ActionResult Edit(int id, Store model)
 {
     try
     {
         var store = _storeService.GetById(id);
         store.Name = model.Name;
         _storeService.Update(store);
         return RedirectToAction("Index");
     }
     catch (Exception e)
     {
         return View();
     }
 }
Example #4
0
 public void Update(Store store)
 {
     _storeRepository.Update(store);
 }
Example #5
0
 public void Create(Store store)
 {
     _storeRepository.Create(store);
 }