private List<TicketExceptions> LoadLiabilities() { busTreasury = new TreasuryTransactions(); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { lvLiability.Items.Clear(); }); List<string> lstPositionstoDisplay = busTreasury.FillListOfFilteredPositions(RouteNumber); TicketsClaimed oTicketsClaimed = new TicketsClaimed(); oTicketsClaimed.TicketsClaimedFrom = StartDate + " " + StartTime; oTicketsClaimed.TicketsClaimedTo = EndDate + " " + EndTime; Tickets oTickets = new Tickets(); oTickets.EndDate = EndDate + " " + EndTime; oTickets.StartDate = StartDate + " " + StartTime; oTickets.IsLiability = true; oTickets.BarCode = "%"; oTickets.Type = "C"; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); List<TicketExceptions> lstTitoTicketsClaimed = busTreasury.TitoTicketsClaimedLiability(oTickets, lstPositionstoDisplay); if (lstTitoTicketsClaimed == null) { lstTitoTicketsClaimed = new List<TicketExceptions>(); } oTickets.Type = "P"; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); List<TicketExceptions> lstTitoTicketsPrinted = busTreasury.TitoTicketsPrintedLiability(oTickets, lstPositionstoDisplay); //lvLiability.ItemsSource = lstTitoTicketsPrinted; if (lstTitoTicketsPrinted != null) { foreach (TicketExceptions item in lstTitoTicketsPrinted) { lstTitoTicketsClaimed.Add(item); } } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); List<TicketExceptions> lstTicketsClaimed = busTreasury.TicketsClaimed(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsClaimed != null) { foreach (TicketExceptions item in lstTicketsClaimed) { lstTitoTicketsClaimed.Add(item); } //lvLiability.ItemsSource = lstTicketsClaimed; } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); List<TicketExceptions> lstTicketsPrinted = busTreasury.TicketsPrinted(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsPrinted != null) { foreach (TicketExceptions item in lstTicketsPrinted) { lstTitoTicketsClaimed.Add(item); } // lvLiability.ItemsSource = lstTicketsPrinted; } float ExceptionTotal = 0F; TicketExceptions Total = new TicketExceptions(); Total.PrintDate = "Total"; foreach (TicketExceptions exep in lstTitoTicketsClaimed) { ExceptionTotal += (float)exep.Value; } Total.Value = ExceptionTotal; Total.Amount = ExceptionTotal.ToString(); lstTitoTicketsClaimed.Insert(0, Total); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); return lstTitoTicketsClaimed; }