Esempio n. 1
0
        public ActionResult SortAction(IPQueryModel model)
        {
            try
            {
                //this.CollectSortConditionFromUI();
                //model.SortConditions.Clear();
                string sortName = Request.Form["hidSortFieldName"];
                string sortValue = Request.Form["hidSortFieldOrderBy"];
                if (!string.IsNullOrWhiteSpace(sortName))
                {
                    if (string.IsNullOrWhiteSpace(sortName))
                    {
                        sortValue = "ASC";
                    }

                    model.SortConditions.Add(sortName, sortValue);
                }
                return this.RefreshData(true, model);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return View();
            }
        }
Esempio n. 2
0
 public ActionResult SearchAction(IPQueryModel model)
 {
     try
     {
         return this.RefreshData(true, model);
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", ex.Message);
         return View();
     }
 }
        public ActionResult OneAccount(string id)
        {
            if (String.IsNullOrWhiteSpace(id))
            {
                return View("index", new StatByAccountViewModel());
            }

            IPQueryModel model = new IPQueryModel();
            model.SelectedUserID = id;

            model.QueryData();
            model.CountTotalRows();
            return View(model);
        }
Esempio n. 4
0
 public ActionResult PagingAction(IPQueryModel model)
 {
     try
     {
         string pageIndex = Request.Form["txtPageNaviNo"];
         if (!string.IsNullOrWhiteSpace(pageIndex))
         {
             model.PageIndex = int.Parse(pageIndex);
         }
         else
         {
             model.PageIndex = 0;
         }
         //this.CollectCurrentPageInfoFromUI(model);
         return this.RefreshData(false, model);
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", ex.Message);
         return View();
     }
 }
        public ActionResult PagingAction(IPQueryModel model)
        {
            try
            {
                string pageIndex = Request.Form["txtPageNaviNo"];

                if (!string.IsNullOrWhiteSpace(pageIndex))
                {
                    model.PageIndex = int.Parse(pageIndex);
                }
                else
                {
                    model.PageIndex = 0;
                }
                model.SelectedUserID = Request.Form["hidUserID"];
                model.QueryData();
                return View(model);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return View();
            }
        }
Esempio n. 6
0
 private IPQueryModel InitilizeModel()
 {
     IPQueryModel model = new IPQueryModel();
     model.SearchConditions["StartDate"] = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
     model.SearchConditions["EndDate"] = DateTime.Now.ToString("yyyy-MM-dd");
     //model.QueryData();
     return model;
 }
Esempio n. 7
0
        protected ViewResult RefreshData(bool needReFetchRecordCount, IPQueryModel model)
        {
            if (needReFetchRecordCount)
            {
                model.CountTotalRows();
                ModelState.Remove("TotalRows");
            }

            model.QueryData();
            return View(model);
        }