public JsonResult Create(Taxi entity) { var newTaxi = taxiRepository.Create(entity); return Json(new JsonViewModel { Data = newTaxi, IsSuccess = true }, JsonRequestBehavior.AllowGet); }
public ActionResult Edit(Taxi data) { if (ModelState.IsValid) { var updateTaxi = taxiRepository.Update(data); return Json(new JsonViewModel() { Data = updateTaxi, IsSuccess = updateTaxi != null }, JsonRequestBehavior.AllowGet); } return Json(new JsonViewModel() { IsSuccess = false, Message = "Eror" }, JsonRequestBehavior.AllowGet); }