private SearchStatementModel PrepareSearchStatement(GridCommand command, ContainerDetailSearchModel searchModel) { string whereStatement = string.Empty; IList<object> param = new List<object>(); HqlStatementHelper.AddEqStatement("ContainerId", searchModel.ContainerId, "c", ref whereStatement, param); HqlStatementHelper.AddEqStatement("Container", searchModel.Container, "c", ref whereStatement, param); string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); if (command.SortDescriptors.Count == 0) { sortingStatement = " order by CreateDate desc"; } SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectCountStatement; searchStatementModel.SelectStatement = selectStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray<object>(); return searchStatementModel; }
public ActionResult List(GridCommand command, ContainerDetailSearchModel searchModel) { SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel); if (searchCacheModel.isBack == true) { ViewBag.Page = searchCacheModel.Command.Page == 0 ? 1 : searchCacheModel.Command.Page; } ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return View(); }
public ActionResult _AjaxList(GridCommand command, ContainerDetailSearchModel searchModel) { TempData["ContainerDetailSearchModel"] = searchModel; this.GetCommand(ref command, searchModel); SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel); var list = GetAjaxPageData<ContainerDetail>(searchStatementModel, command); return PartialView(list); }