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(); }
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; }
public ActionResult List(GridCommand command, ShipListSearchModel searchModel) { ViewBag.PageSize = base.ProcessPageSize(command.PageSize); SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel); ViewBag.SearchModel = searchModel; return View(); }
public ActionResult _AjaxList(GridCommand command, ShipListSearchModel searchModel) { SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel); return PartialView(GetAjaxPageData<ShipList>(searchStatementModel, command)); }
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); }