public void ExportRegisterExcelFile(RegisterQueryVM vm, ColumnSet[] columns) { RegisterQueryFilter queryFilter = new RegisterQueryFilter(); if (vm.IsQuickSearch) { if (vm.QuickSearchCondition.RecvTimeFromDiffDays.HasValue) { queryFilter.RecvTimeFrom = DateTime.Now.AddDays((int)vm.QuickSearchCondition.RecvTimeFromDiffDays); } if (vm.QuickSearchCondition.RecvTimeToDiffDays.HasValue) { queryFilter.RecvTimeTo = DateTime.Now.AddDays((int)vm.QuickSearchCondition.RecvTimeToDiffDays); } queryFilter.RequestStatus = vm.QuickSearchCondition.RequestStatus; queryFilter.IsWithin7Days = vm.QuickSearchCondition.IsWithin7Days; } else { queryFilter = vm.ConvertVM <RegisterQueryVM, RegisterQueryFilter>(); } queryFilter.CompanyCode = CPApplication.Current.CompanyCode; queryFilter.PagingInfo = new QueryFilter.Common.PagingInfo { PageSize = ConstValue.MaxRowCountLimit, PageIndex = 0, SortBy = string.Empty }; string relativeUrl = "/RMAService/Register/Query"; restClient.ExportFile(relativeUrl, queryFilter, columns); }
public override void OnPageLoad(object sender, EventArgs e) { queryVM = new RegisterQueryVM(); facade = new RegisterFacade(this); commonFacade = new CommonDataFacade(this); LoadComboBoxData(); this.QueryFilter.DataContext = queryVM; base.OnPageLoad(sender, e); if (!string.IsNullOrEmpty(this.Request.Param)) { int ProductSysNo; if (int.TryParse(this.Request.QueryString["ProductSysNo"], out ProductSysNo)) { queryVM.ProductSysNo = ProductSysNo; queryVM.ProductID = this.Request.QueryString["ProductID"]; this.DataGrid_ResultList.Bind(); } } }
public void Query(RegisterQueryVM vm, int PageSize, int PageIndex, string SortField, EventHandler <RestClientEventArgs <dynamic> > callback) { RegisterQueryFilter filter = new RegisterQueryFilter(); if (vm.IsQuickSearch) { //filter = new RegisterQueryVM().ConvertVM<RegisterQueryVM, RegisterQueryFilter>(); if (vm.QuickSearchCondition.RecvTimeFromDiffDays.HasValue) { filter.RecvTimeFrom = DateTime.Now.AddDays((int)vm.QuickSearchCondition.RecvTimeFromDiffDays); filter.RecvTimeFrom = DateTime.Parse(filter.RecvTimeFrom.Value.ToShortDateString()); } if (vm.QuickSearchCondition.RecvTimeToDiffDays.HasValue) { filter.RecvTimeTo = DateTime.Now.AddDays((int)vm.QuickSearchCondition.RecvTimeToDiffDays); filter.RecvTimeTo = DateTime.Parse(filter.RecvTimeTo.Value.ToShortDateString() + " 23:59:59"); } filter.RequestStatus = vm.QuickSearchCondition.RequestStatus; filter.IsWithin7Days = vm.QuickSearchCondition.IsWithin7Days; } else { filter = vm.ConvertVM <RegisterQueryVM, RegisterQueryFilter>(); } filter.CompanyCode = CPApplication.Current.CompanyCode; filter.PagingInfo = new QueryFilter.Common.PagingInfo { PageSize = PageSize, PageIndex = PageIndex, SortBy = SortField }; string relativeUrl = "/RMAService/Register/Query"; restClient.QueryDynamicData(relativeUrl, filter, callback); }
private void Button_QuickSearch_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; string commandParameter = btn.CommandParameter.ToString(); //清空普通和高级条件 queryVM = new RegisterQueryVM { IsMoreQueryBuilderCheck = queryVM.IsMoreQueryBuilderCheck }; LoadComboBoxData(); if (!queryVM.IsMoreQueryBuilderCheck) { IsNormalQuery(); } switch (commandParameter) { case "Within21Days": queryVM.QuickSearchCondition.IsWithin7Days = null; queryVM.QuickSearchCondition.RecvTimeFromDiffDays = -21; queryVM.QuickSearchCondition.RecvTimeToDiffDays = 0; queryVM.QuickSearchCondition.RequestStatus = RMARequestStatus.Handling; //刷新界面 queryVM.RecvTimeFrom = DateTime.Today.AddDays(-20); queryVM.RecvTimeTo = DateTime.Today.AddDays(1); queryVM.RequestStatus = RMARequestStatus.Handling; break; case "Over21Days": queryVM.QuickSearchCondition.IsWithin7Days = null; queryVM.QuickSearchCondition.RecvTimeFromDiffDays = null; queryVM.QuickSearchCondition.RecvTimeToDiffDays = -21; queryVM.QuickSearchCondition.RequestStatus = RMARequestStatus.Handling; //刷新界面 // queryVM.RecvTimeFrom = DateTime.MinValue; queryVM.RecvTimeTo = DateTime.Today.AddDays(1); queryVM.RequestStatus = RMARequestStatus.Handling; break; case "7DaysWithin9Days": queryVM.QuickSearchCondition.IsWithin7Days = true; queryVM.QuickSearchCondition.RecvTimeFromDiffDays = -9; queryVM.QuickSearchCondition.RecvTimeToDiffDays = 0; queryVM.QuickSearchCondition.RequestStatus = RMARequestStatus.Handling; //刷新界面 queryVM.RecvTimeFrom = DateTime.Today.AddDays(-8); queryVM.RecvTimeTo = DateTime.Today.AddDays(1); queryVM.RequestStatus = RMARequestStatus.Handling; queryVM.IsWithin7Days = true; break; case "7DaysOver9Days": queryVM.QuickSearchCondition.IsWithin7Days = true; queryVM.QuickSearchCondition.RecvTimeFromDiffDays = null; queryVM.QuickSearchCondition.RecvTimeToDiffDays = -9; queryVM.QuickSearchCondition.RequestStatus = RMARequestStatus.Handling; //刷新界面 // queryVM.RecvTimeFrom = DateTime.MinValue; queryVM.RecvTimeTo = DateTime.Today.AddDays(1); queryVM.RequestStatus = RMARequestStatus.Handling; queryVM.IsWithin7Days = true; break; } queryVM.IsQuickSearch = true; // lastQueryVM = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone<RegisterQueryVM>(queryVM); this.DataGrid_ResultList.Bind(); }