// Send to Excel Implementation public async Task Send2Excel() { IEnumerable <AsycudaDocumentSetEntryDataDetail> lst = null; using (var ctx = new AsycudaDocumentSetEntryDataDetailRepository()) { lst = await ctx.GetAsycudaDocumentSetEntryDataDetailsByExpressionNav(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 <AsycudaDocumentSetEntryDataDetailExcelLine, List <AsycudaDocumentSetEntryDataDetailExcelLine> > { dataToPrint = lst.Select(x => new AsycudaDocumentSetEntryDataDetailExcelLine { }).ToList() }; using (var sta = new StaTaskScheduler(numberOfThreads: 1)) { await Task.Factory.StartNew(s.GenerateReport, CancellationToken.None, TaskCreationOptions.None, sta).ConfigureAwait(false); } }
internal async void OnCurrentAsycudaDocumentSetEntryDataDetailIDChanged(object sender, NotificationEventArgs <string> e) { using (AsycudaDocumentSetEntryDataDetailRepository ctx = new AsycudaDocumentSetEntryDataDetailRepository()) { CurrentAsycudaDocumentSetEntryDataDetail = await ctx.GetAsycudaDocumentSetEntryDataDetail(e.Data).ConfigureAwait(continueOnCapturedContext: false); } NotifyPropertyChanged(m => CurrentAsycudaDocumentSetEntryDataDetail); }
public async Task SelectAll() { IEnumerable <AsycudaDocumentSetEntryDataDetail> lst = null; using (var ctx = new AsycudaDocumentSetEntryDataDetailRepository()) { lst = await ctx.GetAsycudaDocumentSetEntryDataDetailsByExpressionNav(vloader.FilterExpression, vloader.NavigationExpression).ConfigureAwait(continueOnCapturedContext: false); } SelectedAsycudaDocumentSetEntryDataDetails = new ObservableCollection <AsycudaDocumentSetEntryDataDetail>(lst); }
public IList <AsycudaDocumentSetEntryDataDetail> LoadRange(int startIndex, int count, SortDescriptionCollection sortDescriptions, out int overallCount) { try { if (FilterExpression == null) { FilterExpression = "All"; } using (var ctx = new AsycudaDocumentSetEntryDataDetailRepository()) { 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 <AsycudaDocumentSetEntryDataDetail>()); } }