private List <TicketExceptions> LoadLiabilities() { objCashDeskManager = CashDeskManagerBusinessObject.CreateInstance(); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate { lvLiability.Items.Clear(); }); List <string> lstPositionstoDisplay = objCashDeskManager.FillListOfFilteredPositions(RouteNumber); TicketsClaimed oTicketsClaimed = new TicketsClaimed(); oTicketsClaimed.TicketsClaimedFrom = StartDate; oTicketsClaimed.TicketsClaimedTo = EndDate; Tickets oTickets = new Tickets(); oTickets.EndDate = EndDate; oTickets.StartDate = StartDate; oTickets.IsLiability = true; oTickets.BarCode = "%"; oTickets.Type = "C"; oTickets.UserNo = UserNo; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate { prgLiability.Value += 50; }); List <TicketExceptions> lstTitoTicketsClaimed = objCashDeskManager.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 = objCashDeskManager.TitoTicketsPrintedLiability(oTickets, lstPositionstoDisplay); //lvLiability.ItemsSource = lstTitoTicketsPrinted; if (lstTitoTicketsPrinted != null) { foreach (TicketExceptions item in lstTitoTicketsPrinted) { if (item.VoucherStatus.ToUpper().Trim() != "PP") { lstTitoTicketsClaimed.Add(item); } } } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate { prgLiability.Value += 50; }); List <TicketExceptions> lstTicketsClaimed = objCashDeskManager.TicketsClaimed(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsClaimed != null) { foreach (TicketExceptions item in lstTicketsClaimed) { if (item.VoucherStatus.ToUpper().Trim() != "PP") { lstTitoTicketsClaimed.Add(item); } } //lvLiability.ItemsSource = lstTicketsClaimed; } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate { prgLiability.Value += 50; }); List <TicketExceptions> lstTicketsPrinted = objCashDeskManager.TicketsPrinted(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsPrinted != null) { foreach (TicketExceptions item in lstTicketsPrinted) { lstTitoTicketsClaimed.Add(item); } // lvLiability.ItemsSource = lstTicketsPrinted; } decimal ExceptionTotal = 0; TicketExceptions Total = new TicketExceptions(); Total.PrintDate = "Total"; foreach (TicketExceptions exep in lstTitoTicketsClaimed) { if (exep.VoucherStatus.ToUpper().Trim() != "PP") { ExceptionTotal += (decimal)exep.Value; } } Total.Value = Convert.ToDouble(ExceptionTotal); Total.Amount = CurrencySymbol + "" + Convert.ToDecimal(ExceptionTotal).GetUniversalCurrencyFormat(); //Total.Amount = ExceptionTotal.ToString(); lstTitoTicketsClaimed.Insert(0, Total); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate { prgLiability.Value += 50; }); return(lstTitoTicketsClaimed); }
private List<TicketExceptions> LoadLiabilities() { objCashDeskManager = CashDeskManagerBusinessObject.CreateInstance(); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { lvLiability.Items.Clear(); }); List<string> lstPositionstoDisplay = objCashDeskManager.FillListOfFilteredPositions(RouteNumber); TicketsClaimed oTicketsClaimed = new TicketsClaimed(); oTicketsClaimed.TicketsClaimedFrom = StartDate; oTicketsClaimed.TicketsClaimedTo = EndDate; Tickets oTickets = new Tickets(); oTickets.EndDate = EndDate; oTickets.StartDate = StartDate; oTickets.IsLiability = true; oTickets.BarCode = "%"; oTickets.Type = "C"; oTickets.UserNo = UserNo; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); List<TicketExceptions> lstTitoTicketsClaimed = objCashDeskManager.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 = objCashDeskManager.TitoTicketsPrintedLiability(oTickets, lstPositionstoDisplay); //lvLiability.ItemsSource = lstTitoTicketsPrinted; if (lstTitoTicketsPrinted != null) { foreach (TicketExceptions item in lstTitoTicketsPrinted) { if (item.VoucherStatus.ToUpper().Trim() != "PP") { lstTitoTicketsClaimed.Add(item); } } } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); List<TicketExceptions> lstTicketsClaimed = objCashDeskManager.TicketsClaimed(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsClaimed != null) { foreach (TicketExceptions item in lstTicketsClaimed) { if (item.VoucherStatus.ToUpper().Trim() != "PP") { lstTitoTicketsClaimed.Add(item); } } //lvLiability.ItemsSource = lstTicketsClaimed; } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); List<TicketExceptions> lstTicketsPrinted = objCashDeskManager.TicketsPrinted(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsPrinted != null) { foreach (TicketExceptions item in lstTicketsPrinted) { lstTitoTicketsClaimed.Add(item); } // lvLiability.ItemsSource = lstTicketsPrinted; } decimal ExceptionTotal = 0; TicketExceptions Total = new TicketExceptions(); Total.PrintDate = "Total"; foreach (TicketExceptions exep in lstTitoTicketsClaimed) { if (exep.VoucherStatus.ToUpper().Trim() != "PP") { ExceptionTotal += (decimal)exep.Value; } } Total.Value = Convert.ToDouble(ExceptionTotal); Total.Amount = CurrencySymbol + "" + Convert.ToDecimal(ExceptionTotal).GetUniversalCurrencyFormat(); //Total.Amount = ExceptionTotal.ToString(); lstTitoTicketsClaimed.Insert(0, Total); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgLiability.Value += 50; }); return lstTitoTicketsClaimed; }