예제 #1
0
        public ActionResult SortAction(IPScanQueryViewModel 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();
            }
        }
예제 #2
0
 public ActionResult SearchAction(IPScanQueryViewModel model)
 {
     try
     {
         return this.RefreshData(true, model);
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", ex.Message);
         return View();
     }
 }
예제 #3
0
 public ActionResult PagingAction(IPScanQueryViewModel 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();
     }
 }
예제 #4
0
        protected ViewResult RefreshData(bool needReFetchRecordCount, IPScanQueryViewModel model)
        {
            if (needReFetchRecordCount)
            {
                model.CountTotalRows();
                ModelState.Remove("TotalRows");
            }

            model.QueryData();
            return View(model);
        }
예제 #5
0
 private IPScanQueryViewModel InitilizeModel()
 {
     IPScanQueryViewModel model = new IPScanQueryViewModel();
     model.SearchConditions["StartDate"] = DateTime.Now.AddMinutes(-5).ToString("yyyy-MM-dd HH:mm");
     model.SearchConditions["EndDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
     return model;
 }