예제 #1
0
 public ActionResult Delete(Shop shop, int id)
 {
     try
     {
         ShopService.delete(ShopService.getShopById(id));
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
예제 #2
0
 public ActionResult Create(Shop shop)
 {
     try
     {
         ShopService.save(shop);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
예제 #3
0
 public ActionResult Edit(Shop shop, int id)
 {
     try
     {
         ShopService.update(shop, id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
예제 #4
0
 public void update(Shop shop, int id)
 {
     SessionFactory.GetCurrentSession().Update(shop);
     //Muy importante realizar el flush
     SessionFactory.GetCurrentSession().Flush();
 }
예제 #5
0
 public void save(Shop shop)
 {
     SessionFactory.GetCurrentSession().Save(shop);
 }
예제 #6
0
 public void delete(Shop shop)
 {
     SessionFactory.GetCurrentSession().Delete(shop);
     SessionFactory.GetCurrentSession().Flush();
 }