Esempio n. 1
0
 public ActionResult ListNew(GridCommand command, ShipListSearchModel searchModel)
 {
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.SearchModel = searchModel;
     if (String.IsNullOrEmpty(searchModel.Vehicle))
     {
         SaveWarningMessage("车牌号不能为空");
     }
     return View();
 }
Esempio n. 2
0
        private SearchStatementModel PrepareSearchStatement(GridCommand command, ShipListSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();

            HqlStatementHelper.AddEqStatement("ShipNo", searchModel.ShipNo, "u", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Vehicle", searchModel.Vehicle, "u", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Shipper", searchModel.Shipper, "u", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Status", searchModel.Status, "u", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = "select count(*) from ShipList as u";
            searchStatementModel.SelectStatement = "select u from ShipList as u";
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
Esempio n. 3
0
 public ActionResult List(GridCommand command, ShipListSearchModel searchModel)
 {
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     ViewBag.SearchModel = searchModel;
     return View();
 }
Esempio n. 4
0
 public ActionResult _AjaxList(GridCommand command, ShipListSearchModel searchModel)
 {
     SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<ShipList>(searchStatementModel, command));
 }
Esempio n. 5
0
        public ActionResult _AjaxListNew(GridCommand command, ShipListSearchModel searchModel)
        {
            IList<IpMaster> ips = new List<IpMaster>();
            if (!String.IsNullOrEmpty(searchModel.Vehicle))
            {
                ips =
                    base.genericMgr.FindAll<IpMaster>(
                        "from IpMaster where Vehicle = ? and (ShipNo is null or ShipNo = '')", searchModel.Vehicle);
            }

            GridModel<IpMaster> GridModel = new GridModel<IpMaster>();
            GridModel.Total = ips.Count;
            GridModel.Data = ips;
            ViewBag.Total = GridModel.Total;
            
            return PartialView(GridModel);
        }