private List<TicketExceptions> LoadCashDeskDetails() { string szErrDesc = string.Empty; double cTicketClaimedTotalCashdesk = 0, cTicketPrintedTotalCashdesk = 0, cTicketPrintedTotalEGM = 0, cTicketClaimedTotalEGM = 0, cTicketsUnclaimed = 0, cTicketInExceptions = 0, cTicketOutExceptions = 0; double currEGM = 0, currCashdesk = 0, cTicketsVoid = 0, cTicketsExpired = 0, cTicketCancelled = 0; double cRefundTotal = 0, cRefillTotal = 0, cShortpayTotal = 0, cHandPayTotal = 0, cCashDeskFloatTotal = 0, cProgressiveTotal = 0, cJackpotTotal = 0; double RefillQty = 0, RefundQty = 0, ShortpayQty = 0, HandpayQty = 0, CashDeskFloatQty = 0, ProgressiveQty = 0, JackpotQty = 0, CashDeskClaimedQty = 0, MachineClaimedQty = 0, CashDeskPrintedQty = 0, MachinePrintedQty = 0; busTreasury = new TreasuryTransactions(); RouteNumber = "0"; List<string> lstPositionstoDisplay = busTreasury.FillListOfFilteredPositions(RouteNumber); if (string.IsNullOrEmpty(StartDate) || string.IsNullOrEmpty(EndDate)) { System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { BMC.Presentation.CashDeskManager.MessageBox.showBox("Not a valid Date Range"); //prgViewAll.Value = 0; }); return null; } if (!Business.CashDeskManager.Common.isValidDateRange((StartDate + " " + StartTime), (EndDate + " " + EndTime))) { System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { BMC.Presentation.CashDeskManager.MessageBox.showBox("Not a valid Date Range"); // prgViewAll.Value = 0; }); return null; } TicketsClaimed oTicketsClaimed = new TicketsClaimed(); oTicketsClaimed.TicketsClaimedTo = EndDate + " " + EndTime; oTicketsClaimed.TicketsClaimedFrom = StartDate + " " + StartTime; szErrDesc = "pre tickets claimed"; List<TicketExceptions> lstTicketsClaimed = busTreasury.TicketsClaimed(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsClaimed != null) { foreach (TicketExceptions exep in lstTicketsClaimed) { cTicketClaimedTotalCashdesk += (float)exep.Value; } } else { lstTicketsClaimed = new List<TicketExceptions>(); } szErrDesc = "pre tickets printed"; List<TicketExceptions> lstTicketsPrinted = busTreasury.TicketsPrinted(oTicketsClaimed, lstPositionstoDisplay); if (lstTicketsPrinted != null) { foreach (TicketExceptions exep in lstTicketsPrinted) { cTicketPrintedTotalEGM += (float)exep.Value; } foreach (TicketExceptions item in lstTicketsPrinted) { lstTicketsClaimed.Add(item); } } szErrDesc = "pre TiTo claimed"; Tickets oTickets = new Tickets(); oTickets.EndDate = EndDate + " " + EndTime; oTickets.StartDate = StartDate + " " + StartTime; oTickets.IsLiability = false; oTickets.BarCode = "%"; oTickets.Type = "C"; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsClaimedInCashDesk = (bool)chkCashDeskTicketIn.IsChecked; oTickets.IsClaimedInMachine = (bool)chkTicketIn.IsChecked; prgViewAll.Value += 20; } ); List<TicketExceptions> lstTitoClaimed = busTreasury.TitoTicketsClaimed(oTickets, lstPositionstoDisplay); if (lstTitoClaimed != null) { foreach (TicketExceptions exep in lstTitoClaimed) { currEGM += exep.currEGM; currCashdesk += exep.CurrentCashDesk; CashDeskClaimedQty += exep.CashDeskClaimedQty; MachineClaimedQty += exep.MachineClaimedQty; } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { if ((bool)chkCashDeskTicketIn.IsChecked && (bool)chkTicketIn.IsChecked) { foreach (TicketExceptions item in lstTitoClaimed) { lstTicketsClaimed.Add(item); } } prgViewAll.Value += 20; }); cTicketClaimedTotalCashdesk = cTicketClaimedTotalCashdesk + currCashdesk; cTicketClaimedTotalEGM = cTicketClaimedTotalEGM + currEGM; } oTickets.Type = "U"; List<TicketExceptions> lstTicketsUnclaimed = busTreasury.TitoTicketsUnclaimed(oTickets, lstPositionstoDisplay); if (lstTicketsUnclaimed != null) { foreach (TicketExceptions exep in lstTicketsUnclaimed) { cTicketsUnclaimed += (float)exep.Value; lstTicketsClaimed.Add(exep); } } oTickets.Type = "E"; List<TicketExceptions> lstTicketInExceptions = busTreasury.TITOTicketInExceptions(oTickets, lstPositionstoDisplay); if (lstTicketInExceptions != null) { foreach (TicketExceptions exep in lstTicketInExceptions) { cTicketInExceptions += (double)exep.currValue; lstTicketsClaimed.Add(exep); } } oTickets.Type = "E"; List<TicketExceptions> lstTicketOutExceptions = busTreasury.TitoTicketOutExceptions(oTickets, lstPositionstoDisplay); if (lstTicketOutExceptions != null) { foreach (TicketExceptions exep in lstTicketOutExceptions) { cTicketOutExceptions += (float)exep.cTicketTotal; // lstTicketsClaimed.Add(exep); } } //cTicketOutExceptions = lstTicketOutExceptions[0].cTicketTotal; oTickets.Type = "V"; List<TicketExceptions> lstTicketsVoid = busTreasury.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay); if (lstTicketsVoid != null) { foreach (TicketExceptions exep in lstTicketsVoid) { lstTicketsClaimed.Add(exep); cTicketsVoid += (float)exep.cTicketTotal; } } //cTicketsVoid = lstTicketsVoid[0].cTicketTotal; oTickets.Type = "D"; List<TicketExceptions> lstTicketsExpired = busTreasury.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay); if (lstTicketsExpired != null) { foreach (TicketExceptions exep in lstTicketsExpired) { lstTicketsClaimed.Add(exep); cTicketsExpired += (float)exep.currValue; } } oTickets.Type = "B"; List<TicketExceptions> lstTicketsCancelled = busTreasury.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay); if (lstTicketsCancelled != null) { foreach (TicketExceptions exep in lstTicketsCancelled) { lstTicketsClaimed.Add(exep); cTicketCancelled += (float)exep.cTicketTotal; } } oTickets.Type = "P"; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsPrintedInCashDesk = (bool)chkCashDeskTicketOut.IsChecked; oTickets.IsPrintedInMachine = (bool)chkTicketOut.IsChecked; prgViewAll.Value += 20; }); List<TicketExceptions> lstTitoTicketsPrinted = busTreasury.TitoTicketsPrinted(oTickets, lstPositionstoDisplay); if (lstTitoTicketsPrinted != null) { foreach (TicketExceptions exep in lstTitoTicketsPrinted) { System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { if ((bool)chkCashDeskTicketOut.IsChecked && (bool)chkTicketOut.IsChecked) { lstTicketsClaimed.Add(exep); } }); CashDeskPrintedQty += exep.CashDeskPrintedQty; MachinePrintedQty += exep.MachinePrintedQty; } if (lstTitoTicketsPrinted != null && lstTitoTicketsPrinted.Count > 0) { currEGM = lstTitoTicketsPrinted[0].currEGM; currCashdesk = lstTitoTicketsPrinted[0].CurrentCashDesk; cTicketPrintedTotalCashdesk += currCashdesk; cTicketPrintedTotalEGM += currEGM; } } szErrDesc = "pre refunds"; oTickets.Type = TREASURY_REFUND; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsLiability = (bool)chkRefunds.IsChecked; prgViewAll.Value += 20; }); List<TicketExceptions> RefundItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay); if (RefundItems != null) { foreach (TicketExceptions item in RefundItems) { lstTicketsClaimed.Add(item); cRefundTotal += item.TreasuryAmount; RefundQty += item.HandpayQty; } } szErrDesc = "pre refill"; oTickets.Type = TREASURY_REFILL; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsLiability = (bool)chkRefills.IsChecked; }); List<TicketExceptions> RefillItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay); if (RefillItems != null) { foreach (TicketExceptions item in RefillItems) { lstTicketsClaimed.Add(item); cRefillTotal += item.TreasuryAmount; RefillQty += item.HandpayQty; } } szErrDesc = "pre shortpay"; oTickets.Type = TREASURY_SHORTPAY; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsLiability = (bool)chkShortPays.IsChecked; }); List<TicketExceptions> ShortpayItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay); if (ShortpayItems != null) { foreach (TicketExceptions item in ShortpayItems) { lstTicketsClaimed.Add(item); cShortpayTotal += item.TreasuryAmount; ShortpayQty += item.HandpayQty; } } szErrDesc = "Handpays"; oTickets.Type = TREASURY_HANDPAY_CREDIT; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsLiability = (bool)chkHandpays.IsChecked; prgViewAll.Value += 20; }); List<TicketExceptions> Handpays = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay); if (Handpays != null) { foreach (TicketExceptions item in Handpays) { lstTicketsClaimed.Add(item); cHandPayTotal += Convert.ToDouble(item.Amount); HandpayQty += item.HandpayQty; } } szErrDesc = "pre cash desk float"; oTickets.Type = TREASURY_CASH_DESK_FLOAT; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsLiability = (bool)chkCashDeskFloat.IsChecked; }); List<TicketExceptions> CashDeskFloatItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay); if (CashDeskFloatItems != null) { foreach (TicketExceptions item in CashDeskFloatItems) { lstTicketsClaimed.Add(item); cCashDeskFloatTotal += item.TreasuryAmount; CashDeskFloatQty += item.HandpayQty; } } szErrDesc = "Progressive"; oTickets.Type = TREASURY_PROGRESSIVE; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsLiability = (bool)chkProghandpays.IsChecked; }); List<TicketExceptions> ProgItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay); if (ProgItems != null) { foreach (TicketExceptions item in ProgItems) { lstTicketsClaimed.Add(item); cProgressiveTotal += item.TreasuryAmount; ProgressiveQty += item.HandpayQty; } } szErrDesc = "Jackpot"; oTickets.Type = TREASURY_JACKPOT; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { oTickets.IsLiability = (bool)chkjackpot.IsChecked; }); List<TicketExceptions> JackPotItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay); if (JackPotItems != null) { foreach (TicketExceptions item in JackPotItems) { lstTicketsClaimed.Add(item); cJackpotTotal += item.TreasuryAmount; JackpotQty += item.HandpayQty; } } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgViewAll.Value += 20; txtCashDeskTicketInVal.Text = cTicketClaimedTotalCashdesk.ToString(MYFORMAT); txtMachineTicketInVal.Text = cTicketClaimedTotalEGM.ToString(MYFORMAT); txtMachineTicketOutVal.Text = cTicketPrintedTotalEGM.ToString(MYFORMAT); txtCashDeskTicketOutVal.Text = cTicketPrintedTotalCashdesk.ToString(MYFORMAT); txtLiabilityVal.Text = ((cTicketPrintedTotalEGM + cTicketPrintedTotalCashdesk) - (cTicketClaimedTotalEGM + cTicketClaimedTotalCashdesk)).ToString(MYFORMAT); txtExcepVal.Text = cTicketInExceptions.ToString(MYFORMAT) + "/" + cTicketOutExceptions.ToString(MYFORMAT); txtActiveVal.Text = cTicketsUnclaimed.ToString(MYFORMAT); txtVoidval.Text = cTicketsVoid.ToString(MYFORMAT) + "/" + cTicketCancelled.ToString(MYFORMAT); txtExpiredVal.Text = cTicketsExpired.ToString(MYFORMAT); txtRefundVal.Text = cRefundTotal.ToString(MYFORMAT); txtFillsVal.Text = cRefillTotal.ToString(MYFORMAT); txtCashDeskShortPaysVal.Text = cShortpayTotal.ToString(MYFORMAT); txtHandpayVal.Text = cHandPayTotal.ToString(MYFORMAT); txtCashDeskFloatVal.Text = cCashDeskFloatTotal.ToString(MYFORMAT); txtProgHandpayVal.Text = cProgressiveTotal.ToString(MYFORMAT); txtJackpotVal.Text = cJackpotTotal.ToString(MYFORMAT); }); double promoTotal = 0; List<TicketExceptions> lstPromo = busTreasury.GetPromoCashableTickets(oTicketsClaimed, lstPositionstoDisplay); if (lstPromo != null) { foreach (TicketExceptions item in lstPromo) { promoTotal += item.Value; } } System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { txtPromoCashableVal.Text = promoTotal.ToString(MYFORMAT); txtHandpayQty.Text = HandpayQty.ToString(); txtProgHandpayQty.Text = ProgressiveQty.ToString(); txtJackPotQty.Text = JackpotQty.ToString(); txtRefundQty.Text = RefundQty.ToString(); txtFillsQty.Text = RefillQty.ToString(); txtCashDeskShortPayQty.Text = ShortpayQty.ToString(); txtCashDeskFloatQty.Text = CashDeskFloatQty.ToString(); txtCashDeskTicketInQty.Text = CashDeskClaimedQty.ToString(); txtMachineTicketInQty.Text = MachineClaimedQty.ToString(); txtCashDeskTicketOutQty.Text = CashDeskPrintedQty.ToString(); txtMachineTicketOutQty.Text = MachinePrintedQty.ToString(); }); HandpayQty = 0; ProgressiveQty = 0; JackpotQty = 0; RefundQty = 0; RefillQty = 0; ShortpayQty = 0; CashDeskFloatQty = 0; CashDeskClaimedQty = 0; CashDeskPrintedQty = 0; MachineClaimedQty = 0; MachinePrintedQty = 0; return lstTicketsClaimed; }
private List<TicketExceptions> LoadPromoTickets() { busTreasury = new TreasuryTransactions(); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { lvPromoCashable.Items.Clear(); }); List<string> lstPositionstoDisplay = busTreasury.FillListOfFilteredPositions(RouteNumber); TicketsClaimed oTicketsClaimed = new TicketsClaimed(); oTicketsClaimed.TicketsClaimedFrom = StartDate + " " + StartTime; oTicketsClaimed.TicketsClaimedTo = EndDate + " " + EndTime; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgPromo.Value += 50; }); List<TicketExceptions> lstPromoTickets = busTreasury.GetPromoCashableTickets(oTicketsClaimed, lstPositionstoDisplay); decimal ExceptionTotal = 0; TicketExceptions Total = new TicketExceptions(); Total.PrintDate = "Total"; foreach (TicketExceptions exep in lstPromoTickets) { ExceptionTotal += (decimal)exep.Value; } Total.Value = (double)Decimal.Round(ExceptionTotal, 2); lstPromoTickets.Insert(0, Total); System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate { prgPromo.Value += 50; }); return lstPromoTickets; }