/// <summary> /// Search Statement /// </summary> /// <param name="command">Telerik GridCommand</param> /// <param name="searchModel">LocationBin Search Model</param> /// <param name="locationCode">location Code</param> /// <returns>Search Statement</returns> private SearchStatementModel LocationBinPrepareSearchStatement(GridCommand command, LocationBinSearchModel searchModel, string locationCode) { string whereStatement = "where l.Location = '" + locationCode + "'"; IList<object> param = new List<object>(); HqlStatementHelper.AddLikeStatement("Code", searchModel.Code, HqlStatementHelper.LikeMatchMode.Start, "l", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("Name", searchModel.Name, HqlStatementHelper.LikeMatchMode.Start, "l", ref whereStatement, param); HqlStatementHelper.AddEqStatement("Area", searchModel.Area, "l", ref whereStatement, param); string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = locationBinselectCountStatement; searchStatementModel.SelectStatement = locationBinselectStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray<object>(); return searchStatementModel; }
public ActionResult _AjaxLocationBinList(GridCommand command, LocationBinSearchModel searchModel, string locationCode) { SearchStatementModel searchStatementModel = this.LocationBinPrepareSearchStatement(command, searchModel, locationCode); return PartialView(GetAjaxPageData<LocationBin>(searchStatementModel, command)); }
public void ExportBin(LocationBinSearchModel searchModel) { int value = Convert.ToInt32(base.systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.MaxRowSizeOnPage)); GridCommand command = new GridCommand(); command.Page = 1; command.PageSize = !this.CheckSearchModelIsNull(searchModel) ? 0 : value; if (!this.CheckSearchModelIsNull(searchModel)) { return; } SearchStatementModel searchStatementModel = this.LocationBinPrepareSearchStatement(command, searchModel, searchModel.LocationCode); ExportToXLS<LocationBin>("LocationBin.xls", GetAjaxPageData<LocationBin>(searchStatementModel, command).Data.ToList()); }
public ActionResult _LocationBinList(GridCommand command, LocationBinSearchModel searchModel, string locationCode) { ViewBag.LocationCode = locationCode; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); SearchCacheModel searchCacheModel = ProcessSearchModel(command, searchModel); SearchStatementModel searchStatementModel = this.LocationBinPrepareSearchStatement(command, (LocationBinSearchModel)searchCacheModel.SearchObject, locationCode); return PartialView(GetPageData<LocationBin>(searchStatementModel, command)); }
public ActionResult _AjaxLocationBinList(GridCommand command, LocationBinSearchModel searchModel, string locationCode) { string replaceFrom = "_AjaxLocationBinList"; string replaceTo = "_LocationBinList/"; this.GetCommand(ref command, searchModel, replaceFrom, replaceTo); SearchStatementModel searchStatementModel = this.LocationBinPrepareSearchStatement(command, searchModel, locationCode); return PartialView(GetAjaxPageData<LocationBin>(searchStatementModel, command)); }