Ejemplo n.º 1
0
 public ActionResult EditPost(Barang brg)
 {
     using (BarangDAL service = new BarangDAL())
     {
         try
         {
             service.Edit(brg);
             TempData["Pesan"] = Helpers.Pesan.getPesan("Success!", "success", "Data " + brg.Stok + " successfully changed");
         }
         catch (Exception ex)
         {
             TempData["Pesan"] = Helpers.Pesan.getPesan("Error!", "danger", ex.Message);
         }
     }
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 2
0
 public ActionResult Edit(Barang brg)
 {
     using (BarangDAL services = new BarangDAL())
     {
         try
         {
             services.Edit(brg);
             TempData["Pesan"] = Helpers.Message.GetPesan("Sukses !",
                                                          "success", "Data barang " + brg.nama_barang + " berhasil diedit");
         }
         catch (Exception ex)
         {
             TempData["Pesan"] = Helpers.Message.GetPesan("Error !",
                                                          "danger", ex.Message);
         }
     }
     return(RedirectToAction("Index"));
 }