public ActionResult Courts_Update([DataSourceRequest] DataSourceRequest request, CourtsViewModel db) { if (db != null && ModelState.IsValid) { CourtsService.Update(db); } return(Json(new[] { db }.ToDataSourceResult(request, ModelState))); }
public ActionResult Courts_Destroy([DataSourceRequest] DataSourceRequest request, CourtsViewModel db) { try { if (ModelState.IsValid) { if (db != null) { CourtsService.Destroy(db); } } } catch (Exception) { ModelState.AddModelError("خطأ", "لا يمكن الحذف"); return(Json(new[] { db }.ToDataSourceResult(request, ModelState))); } return(Json(new[] { db }.ToDataSourceResult(request, ModelState))); }
public ActionResult Courts_Destroy([DataSourceRequest] DataSourceRequest request, CourtsViewModel db) { if (db != null) { CourtsService.Destroy(db); } return(Json(new[] { db }.ToDataSourceResult(request, ModelState))); }