public ActionResult Update(ImagesCategoriesModel ImagesCategoriesObj) { //------------------------------------------ //Check ModelState //------------------------------------------ if (!ModelState.IsValid) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Invalid data")); } //------------------------------------------ try { bool result = ImagesCategoriesFactor.Update(ImagesCategoriesObj); if (result == true) { return(List(1, 25, null, null, null, null)); } else { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Saving operation faild")); } } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }
public ActionResult GetObject(int id) { try { ImagesCategoriesModel ImagesCategoriesObj = ImagesCategoriesFactor.GetObject(id); if (ImagesCategoriesObj == null) { ImagesCategoriesObj = new ImagesCategoriesModel(); } return(Json(ImagesCategoriesObj, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }