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