예제 #1
0
 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)); }
 }
예제 #2
0
 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));
     }
 }
예제 #3
0
        //***********************************************************************************************
        #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)); }
        }
예제 #4
0
        //***********************************************************************************************
        #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));
            }
        }