public ActionResult Delete(int id, Store model) { try { _storeService.Delete(id); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(Store model) { if (ModelState.IsValid) { _storeService.Create(model); return RedirectToAction("Index"); } else { return View(model); } }
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(); } }
public void Update(Store store) { _storeRepository.Update(store); }
public void Create(Store store) { _storeRepository.Create(store); }