Пример #1
0
        public ActionResult Courts_Update([DataSourceRequest] DataSourceRequest request, CourtsViewModel db)
        {
            if (db != null && ModelState.IsValid)
            {
                CourtsService.Update(db);
            }

            return(Json(new[] { db }.ToDataSourceResult(request, ModelState)));
        }
Пример #2
0
 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)));
 }
Пример #3
0
        public ActionResult Courts_Destroy([DataSourceRequest] DataSourceRequest request, CourtsViewModel db)
        {
            if (db != null)
            {
                CourtsService.Destroy(db);
            }

            return(Json(new[] { db }.ToDataSourceResult(request, ModelState)));
        }