public ActionResult List(GridCommand command, IssueNoSearchModel searchModel) { var search = this.ProcessSearchModel(command, searchModel); //TempData["IssueNoSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return View(); }
public ActionResult _AjaxList(GridCommand command, IssueNoSearchModel searchModel) { SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel); return PartialView(GetAjaxPageData<IssueNo>(searchStatementModel, command)); }
private SearchStatementModel PrepareSearchStatement(GridCommand command, IssueNoSearchModel searchModel) { string whereStatement = string.Empty; IList<object> param = new List<object>(); HqlStatementHelper.AddLikeStatement("Code", searchModel.Code, HqlStatementHelper.LikeMatchMode.Start, "it", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("Description", searchModel.Description, HqlStatementHelper.LikeMatchMode.Start, "it", ref whereStatement, param); if (!string.IsNullOrWhiteSpace(searchModel.IssueTypeCode)) { HqlStatementHelper.AddEqStatement("IssueType.Code", searchModel.IssueTypeCode, "it", ref whereStatement, param); } //HqlStatementHelper.AddEqStatement("IssueTypeCode", searchModel.IssueTypeCode, "it", ref whereStatement, param); if (command.SortDescriptors.Count > 0) { if (command.SortDescriptors[0].Member == "IssueTypeCode") { command.SortDescriptors[0].Member = "IssueType"; } else if (command.SortDescriptors[0].Member == "IssueTypeDescription") { command.SortDescriptors[0].Member = "IssueType"; } } string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectCountStatement; searchStatementModel.SelectStatement = selectStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray<object>(); return searchStatementModel; }