Beispiel #1
0
 public ActionResult Update(JournalsModel JournalsObj)
 {
     //------------------------------------------
     //Check ModelState
     //------------------------------------------
     if (!ModelState.IsValid)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Invalid data"));
     }
     //------------------------------------------
     try
     {
         bool result = JournalsFactor.Update(JournalsObj);
         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)); }
 }
Beispiel #2
0
 public ActionResult GetObject(string id)
 {
     try
     {
         JournalsModel JournalsObj = JournalsFactor.GetObject(id);
         if (JournalsObj == null)
         {
             JournalsObj = new JournalsModel();
         }
         return(Json(JournalsObj, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Beispiel #3
0
        //***********************************************************************************************
        #endregion

        #region -----------------Delete-----------------
        //***********************************************************************************************
        public ActionResult Delete(string[] ids)
        {
            //------------------------------------------
            //Check ModelState
            //------------------------------------------
            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Invalid data"));
            }
            //------------------------------------------
            try
            {
                JournalsFactor.DeleteGroupofObjects(ids);
                return(List(1, 25, null, null, null, null));
            }
            catch (Exception ex)
            { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); }
        }
Beispiel #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 <JournalsModel> JournalsList = JournalsFactor.GetPageByPage(page, pageSize, sortname, sortorder, qtype, query, out totalRecords);
                if (JournalsList.Count > 0)
                {
                    return(CreateFlexiJson(JournalsList, page, totalRecords));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Beispiel #5
0
        //***********************************************************************************************
        //
        // GET: /IndexersWithJournals/
        public ActionResult Index()
        {
            FlexigridViewModel flexigrid = new FlexigridViewModel("IndexersWithJournalsList", "IndexersWithJournalsForm", "IndexersWithJournalsPost", "/IndexersWithJournals/List", "json", "JournalCode", "asc", true, "IndexersWithJournals Listing", true, pageSize, true, 950, 2000);

            flexigrid.Columns = new List <FlexigridColumn>()
            {
                new FlexigridColumn("IndexerID", "IndexerID", 105, true, "left", false, false),
                new FlexigridColumn("JournalCode", "JournalCode", 105, true, "left", false, false),
                new FlexigridColumn("SubmissionDate", "SubmissionDate", 105, true, "left", false, false),
                new FlexigridColumn("AcceptanceDate", "AcceptanceDate", 105, true, "left", false, false),
                new FlexigridColumn("RejectionDate", "RejectionDate", 105, true, "left", false, false),
                new FlexigridColumn("NextEvaRound", "NextEvaRound", 105, true, "left", false, false),
                new FlexigridColumn("NoofEvaRound", "NoofEvaRound", 105, true, "left", false, false),
                new FlexigridColumn("Notes", "Notes", 105, true, "left", false, false),
                new FlexigridColumn("StatusID", "StatusID", 105, true, "left", false, false)
            };
            flexigrid.Buttons = new List <FlexigridButton>()
            {
                new FlexigridButton("Add", "fgButton", "Add"),
                new FlexigridButton("Edit", "fgButton", "Edit"),
                new FlexigridButton("Delete", "fgButton", "Delete")
            };
            flexigrid.DialogBoxId     = "IndexersWithJournalsDialog";
            flexigrid.DialogBoxWidth  = 700;
            flexigrid.DialogBoxHeight = 800;
            ViewData["flexigrid"]     = flexigrid;

            ViewData["IndexerID"] = IndexersFactor.Get().Select(x => new SelectListItem {
                Text = x.Name, Value = x.IndexerID.ToString()
            }).ToList();
            ViewData["JournalCode"] = JournalsFactor.Get().Select(x => new SelectListItem {
                Text = x.JournalCode, Value = x.JournalCode.ToString()
            }).ToList();
            ViewData["StatusID"] = StatusFactor.Get().Select(x => new SelectListItem {
                Text = x.Title, Value = x.StatusID.ToString()
            }).ToList();
            //ViewData["Categories"] = CategoriesFactor.Get().Select(x => new SelectListItem { Text = x.Title, Value = x.CategoryID.ToString() }).ToList();
            return(View(new IndexersWithJournalsModel()));
        }