Beispiel #1
0
 public ActionResult Delete(int id)
 {
     using (ShoppingCartsDAL service = new ShoppingCartsDAL())
         try
         {
             service.Delete(id);
             TempData["Message"] = Helper.MsgBox.GetMsg("success", "Success! ", "Your data has been removed from your Cart");
         }
         catch (Exception ex)
         {
             TempData["Message"] = Helper.MsgBox.GetMsg("danger", "Error", ex.Message);
         }
     return(RedirectToAction("Index"));
 }
Beispiel #2
0
 public ActionResult Delete(int id)
 {
     using (ShoppingCartsDAL service = new ShoppingCartsDAL())
     {
         try
         {
             service.Delete(id);
         }
         catch (Exception ex)
         {
         }
     }
     return(RedirectToAction("Index"));
 }
 public ActionResult Delete(int?id)
 {
     if (id != null)
     {
         using (ShoppingCartsDAL service = new ShoppingCartsDAL())
         {
             try
             {
                 service.Delete(id.Value);
                 TempData["Pesan"] = Helper.KotakPesan.GetPesan("success",
                                                                "Sukses ", "Data berhasil dihapus");
             }
             catch (Exception ex)
             {
                 TempData["Pesan"] = Helper.KotakPesan.GetPesan("danger",
                                                                "Error! ", ex.Message);
             }
         }
     }
     return(RedirectToAction("Index"));
 }