public ActionResult Update(IndexersWithJournalsModel IndexersWithJournalsObj) { //------------------------------------------ //Check ModelState //------------------------------------------ if (!ModelState.IsValid) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Invalid data")); } //------------------------------------------ try { bool result = IndexersWithJournalsFactor.Update(IndexersWithJournalsObj); 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 { IndexersWithJournalsModel IndexersWithJournalsObj = IndexersWithJournalsFactor.GetObject(id); if (IndexersWithJournalsObj == null) { IndexersWithJournalsObj = new IndexersWithJournalsModel(); } return(Json(IndexersWithJournalsObj, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }
//*********************************************************************************************** #endregion #region -----------------Delete----------------- //*********************************************************************************************** public ActionResult Delete(int[] ids) { //------------------------------------------ //Check ModelState //------------------------------------------ if (!ModelState.IsValid) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Invalid data")); } //------------------------------------------ try { IndexersWithJournalsFactor.DeleteGroupofObjects(ids); return(List(1, 25, null, null, null, null)); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }
//*********************************************************************************************** #endregion #region -----------------List----------------- //*********************************************************************************************** public ActionResult List(int page, int rp, string sortname, string sortorder, string qtype, string query) { try { int pageSize = rp; int totalRecords = 0; List <IndexersWithJournalsModel> IndexersWithJournalsList = IndexersWithJournalsFactor.GetPageByPage(page, pageSize, sortname, sortorder, qtype, query, out totalRecords); if (IndexersWithJournalsList.Count > 0) { return(CreateFlexiJson(IndexersWithJournalsList, page, totalRecords)); } else { return(null); } } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }