public ActionResult CreateEdit(ItemViewModel model) { try { if (ModelState.IsValid) { if (ItemDataAccess.Update(model)) { return(Json(new { success = true, message = "berhasil" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, mesage = ItemDataAccess.Message }, JsonRequestBehavior.AllowGet)); } } else { return(Json(new { succes = false, message = "Please full fill required fields!" }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { success = false, message = ex.Message }, JsonRequestBehavior.AllowGet)); } }