public ActionResult List(GridCommand command, LocationSearchModel searchModel) { SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel); ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return View(); }
public ActionResult _AjaxList(GridCommand command, LocationSearchModel searchModel) { searchModel.IsActive = true; if (searchModel.IsIncludeInActive) { searchModel.IsActive = false; } SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel); return PartialView(GetAjaxPageData<Location>(searchStatementModel, command)); }
/// <summary> /// Search Statement /// </summary> /// <param name="command">Telerik GridCommand</param> /// <param name="searchModel">Location Search Model</param> /// <returns>Search Statement</returns> private SearchStatementModel PrepareSearchStatement(GridCommand command, LocationSearchModel searchModel) { string whereStatement = string.Empty; IList<object> param = new List<object>(); HqlStatementHelper.AddLikeStatement("SAPLocation", searchModel.SAPLocation, HqlStatementHelper.LikeMatchMode.Start, "u", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("Code", searchModel.Code, HqlStatementHelper.LikeMatchMode.Start, "u", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("Name", searchModel.Name, HqlStatementHelper.LikeMatchMode.Start, "u", ref whereStatement, param); HqlStatementHelper.AddEqStatement("Region", searchModel.Region, "u", ref whereStatement, param); HqlStatementHelper.AddEqStatement("IsActive", searchModel.IsActive, "u", ref whereStatement, param); if (searchModel.AllowNegaInv) { HqlStatementHelper.AddEqStatement("AllowNegative", searchModel.AllowNegaInv, "u", ref whereStatement, param); } if (searchModel.IsMRP) { HqlStatementHelper.AddEqStatement("IsMRP", searchModel.IsMRP, "u", ref whereStatement, param); } if (searchModel.AllowNegativeConsignment) { HqlStatementHelper.AddEqStatement("AllowNegativeConsignment", searchModel.AllowNegativeConsignment, "u", ref whereStatement, param); } if (searchModel.IsSource) { HqlStatementHelper.AddEqStatement("IsSource", searchModel.IsSource, "u", ref whereStatement, param); } 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; }
public ActionResult List(GridCommand command, LocationSearchModel 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(); }