Beispiel #1
0
        public ActionResult TypeOfCases_Destroy([DataSourceRequest] DataSourceRequest request, TypeOfCaseViewModel db)
        {
            if (db != null)
            {
                TypeOfCaseService.Destroy(db);
            }

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

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