// Send to Excel Implementation


        public async Task Send2Excel()
        {
            IEnumerable <AsycudaDocumentSetEntryData> lst = null;

            using (var ctx = new AsycudaDocumentSetEntryDataRepository())
            {
                lst = await ctx.GetAsycudaDocumentSetEntryDatasByExpressionNav(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 <AsycudaDocumentSetEntryDataExcelLine, List <AsycudaDocumentSetEntryDataExcelLine> >
            {
                dataToPrint = lst.Select(x => new AsycudaDocumentSetEntryDataExcelLine
                {
                    EntryDataId = x.EntryDataId
                }).ToList()
            };

            using (var sta = new StaTaskScheduler(numberOfThreads: 1))
            {
                await Task.Factory.StartNew(s.GenerateReport, CancellationToken.None, TaskCreationOptions.None, sta).ConfigureAwait(false);
            }
        }
Example #2
0
 internal async void OnCurrentAsycudaDocumentSetEntryDataIDChanged(object sender, NotificationEventArgs <string> e)
 {
     using (AsycudaDocumentSetEntryDataRepository ctx = new AsycudaDocumentSetEntryDataRepository())
     {
         CurrentAsycudaDocumentSetEntryData = await ctx.GetAsycudaDocumentSetEntryData(e.Data).ConfigureAwait(continueOnCapturedContext: false);
     }
     NotifyPropertyChanged(m => CurrentAsycudaDocumentSetEntryData);
 }
        public async Task SelectAll()
        {
            IEnumerable <AsycudaDocumentSetEntryData> lst = null;

            using (var ctx = new AsycudaDocumentSetEntryDataRepository())
            {
                lst = await ctx.GetAsycudaDocumentSetEntryDatasByExpressionNav(vloader.FilterExpression, vloader.NavigationExpression).ConfigureAwait(continueOnCapturedContext: false);
            }
            SelectedAsycudaDocumentSetEntryDatas = new ObservableCollection <AsycudaDocumentSetEntryData>(lst);
        }
Example #4
0
        public IList <AsycudaDocumentSetEntryData> LoadRange(int startIndex, int count, SortDescriptionCollection sortDescriptions, out int overallCount)
        {
            try
            {
                if (FilterExpression == null)
                {
                    FilterExpression = "All";
                }
                using (var ctx = new AsycudaDocumentSetEntryDataRepository())
                {
                    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 <AsycudaDocumentSetEntryData>());
            }
        }