public ActionResult CreateEdit(PelangganViewModel model) { try { if (ModelState.IsValid) { if (PelangganDataAccess.Update(model)) { return(Json(new { success = true, message = "Succes" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, message = PelangganDataAccess.Message }, JsonRequestBehavior.AllowGet)); } } else { return(Json(new { success = false, message = "Pelase full fill required fields" }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { success = false, message = ex.Message }, JsonRequestBehavior.AllowGet)); { } } }
public ActionResult DeleteConfirm(int id) { if (PelangganDataAccess.Delete(id)) { return(Json(new { success = true, message = "Success" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, message = "Error" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Delete(int id) { return(View(PelangganDataAccess.GetById(id))); }
public ActionResult List() { return(View(PelangganDataAccess.GetAll())); }