Пример #1
0
 public JsonResult Create(Taxi entity)
 {
     var newTaxi = taxiRepository.Create(entity);
     return Json(new JsonViewModel { Data = newTaxi, IsSuccess = true }, JsonRequestBehavior.AllowGet);
 }
Пример #2
0
 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);
 }