internal async Task DownloadCPSalesDateRange() { if (CoreEntities.ViewModels.BaseViewModel.Instance.CurrentAsycudaDocumentSetEx != null) { await CounterPointSalesRepository.Instance.DownloadCPSalesDateRange(StartDateFilter.GetValueOrDefault(), EndDateFilter.GetValueOrDefault(), CoreEntities.ViewModels.BaseViewModel.Instance.CurrentAsycudaDocumentSetEx.AsycudaDocumentSetId).ConfigureAwait(false); StatusModel.Timer("Refreshing Sales Data..."); MessageBus.Default.BeginNotify(EntryDataQS.MessageToken.EntryDataExChanged, null, new NotificationEventArgs(EntryDataQS.MessageToken.EntryDataExChanged)); MessageBus.Default.BeginNotify(EntryDataQS.MessageToken.EntryDataDetailsExesChanged, null, new NotificationEventArgs(EntryDataQS.MessageToken.EntryDataDetailsExesChanged)); MessageBus.Default.BeginNotify(SalesDataQS.MessageToken.SalesDatasChanged, null, new NotificationEventArgs(SalesDataQS.MessageToken.SalesDatasChanged)); MessageBus.Default.BeginNotify(SalesDataQS.MessageToken.SalesDataDetailsChanged, null, new NotificationEventArgs(SalesDataQS.MessageToken.SalesDataDetailsChanged)); MessageBus.Default.BeginNotify(MessageToken.CounterPointSalesChanged, null, new NotificationEventArgs(MessageToken.CounterPointSalesChanged)); StatusModel.StopStatusUpdate(); MessageBox.Show("Download Complete"); } else { MessageBox.Show("Please Select a Asycuda Document Set before downloading Sales"); } }
public override void FilterData() { var res = GetAutoPropertyFilterString(); if (CoreEntities.ViewModels.BaseViewModel.Instance.CurrentAsycudaDocumentSetEx != null) { res.Append(string.Format("&& AsycudaDocumentSetId == {0}", CoreEntities.ViewModels.BaseViewModel.Instance.CurrentAsycudaDocumentSetEx.AsycudaDocumentSetId)); } if (BaseViewModel.Instance.CurrentEntryDataEx != null) { res.Append(string.Format("&& EntryDataId == \"{0}\"", BaseViewModel.Instance.CurrentEntryDataEx.InvoiceNo)); } if (StartDateFilter != DateTime.MinValue) { res.Append(string.Format("&& DeliveryDate >= \"{0}\" || ShipDate >= \"{0}\"", StartDateFilter.ToShortDateString())); } if (EndDateFilter != DateTime.MinValue) { res.Append(string.Format("&& DeliveryDate <= \"{0}\" || ShipDate <= \"{0}\"", EndDateFilter.ToShortDateString())); } //if (res.Length == 0 && vloader.NavigationExpression.Count != 0) res.Append("&& All"); FilterData(res); }