// Send to Excel Implementation public async Task Send2Excel() { IEnumerable <CounterPointSalesDetails> lst = null; using (var ctx = new CounterPointSalesDetailsRepository()) { lst = await ctx.GetCounterPointSalesDetailsByExpressionNav(vloader.FilterExpression, vloader.NavigationExpression).ConfigureAwait(continueOnCapturedContext: false); } if (lst == null || !lst.Any()) { MessageBox.Show("No Data to Send to Excel"); return; } var s = new ExportToExcel <CounterPointSalesDetailsExcelLine, List <CounterPointSalesDetailsExcelLine> > { dataToPrint = lst.Select(x => new CounterPointSalesDetailsExcelLine { INVNO = x.INVNO, SEQ_NO = x.SEQ_NO, ITEM_NO = x.ITEM_NO, ITEM_DESCR = x.ITEM_DESCR, QUANTITY = x.QUANTITY, COST = x.COST, ACCT_NO = x.ACCT_NO, CUSTOMER_NAME = x.CUSTOMER_NAME, DATE = x.DATE, TAX_AMT = x.TAX_AMT, UNIT_WEIGHT = x.UNIT_WEIGHT, QTY_UNIT = x.QTY_UNIT }).ToList() }; using (var sta = new StaTaskScheduler(numberOfThreads: 1)) { await Task.Factory.StartNew(s.GenerateReport, CancellationToken.None, TaskCreationOptions.None, sta).ConfigureAwait(false); } }
internal async void OnCurrentCounterPointSalesDetailsIDChanged(object sender, NotificationEventArgs <string> e) { using (CounterPointSalesDetailsRepository ctx = new CounterPointSalesDetailsRepository()) { CurrentCounterPointSalesDetails = await ctx.GetCounterPointSalesDetails(e.Data).ConfigureAwait(continueOnCapturedContext: false); } NotifyPropertyChanged(m => CurrentCounterPointSalesDetails); }
public async Task SelectAll() { IEnumerable <CounterPointSalesDetails> lst = null; using (var ctx = new CounterPointSalesDetailsRepository()) { lst = await ctx.GetCounterPointSalesDetailsByExpressionNav(vloader.FilterExpression, vloader.NavigationExpression).ConfigureAwait(continueOnCapturedContext: false); } SelectedCounterPointSalesDetails = new ObservableCollection <CounterPointSalesDetails>(lst); }
public IList <CounterPointSalesDetails> LoadRange(int startIndex, int count, SortDescriptionCollection sortDescriptions, out int overallCount) { try { if (FilterExpression == null) { FilterExpression = "None"; } using (var ctx = new CounterPointSalesDetailsRepository()) { var r = ctx.LoadRange(startIndex, count, FilterExpression, navExp, IncludesLst); overallCount = r.Result.Item2; return(r.Result.Item1.ToList()); } } catch (Exception ex) { StatusModel.Message(ex.Message); overallCount = 0; return(new List <CounterPointSalesDetails>()); } }