public  List<TicketExceptions> TitoTicketsPrinted(Tickets oTickets, List<string> lstPositionstoDisplay)
        {
            string strTicketInException = string.Empty;
            string sPosTer = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;
            double CurrentCashDesk = 0, currEGM = 0;

            try
            {
                DataTable dtTickets = GetTickets(oTickets);
                if (dtTickets == null || dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.bExceptionRecordFound = false;
                        excep.SEGM = row["PrintDevice"].ToString();
                        excep.VoucherStatus = row["strVoucherStatus"].ToString();
                        excep.TicketAddedtoList = false;
                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;
                        if (!string.IsNullOrEmpty(excep.SEGM))
                        {
                            if (row["strDeviceType"].ToString().Equals("EXTITO") || string.IsNullOrEmpty(row["strDeviceType"].ToString()))
                            {
                                if (DBCommon.IsMachineATicketWorkstation(excep.SEGM))
                                {
                                    sPosTer = excep.SEGM;
                                    excep.Position = excep.SEGM;
                                    excep.Machine = "";
                                    CurrentCashDesk += excep.currValue;

                                    excep.CashDeskPrintedQty += 1;
                                    if (oTickets.IsPrintedInCashDesk)
                                    {
                                        excep.TicketAddedtoList = true;
                                    }
                                }
                                else
                                {
                                    sPosTer = string.Empty;
                                    excep.Machine = GetBarPositionFromAsset(excep.SEGM);
                                    if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositionstoDisplay))
                                    {
                                        currEGM += excep.currValue;
                                        excep.MachinePrintedQty += 1;
                                        if (oTickets.IsPrintedInMachine)
                                        {
                                            excep.TicketAddedtoList = true;
                                        }
                                    }
                                    else
                                    {
                                        excep.TicketAddedtoList = false;
                                    }
                                }
                            }
                            else
                            {
                                excep.Position = GetBarPositionFromAsset(excep.SEGM);
                                excep.Machine = "";
                                excep.CurrentCashDesk += excep.currValue;

                                excep.CashDeskPrintedQty += 1;
                                excep.TicketAddedtoList = true;
                            }
                        }

                        if (excep.TicketAddedtoList)
                        {
                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            //excep.Amount = excep.Value.ToString("###0.#0");
                            excep.Amount = CurrencySymbol + " " + Convert.ToDecimal(excep.Value).GetUniversalCurrencyFormat();
                            string dPrintDate = row["dtPrinted"].ToString().ToShortDateTimeString();
                            string dClaimDate = string.IsNullOrEmpty(row["dtPaid"].ToString()) ? "01/01/2100" : row["dtPaid"].ToString();

                            if(excep.MachinePrintedQty > 0)
                                excep.TransactionType = "M/c Voucher Issued";
                            else if(excep.CashDeskPrintedQty > 0)
                                excep.TransactionType = "C/D Voucher Issued";
                            
                            excep.Zone = "n/a";
                            excep.Asset = row["Asset"].ToString();


                            if ((Convert.ToDateTime(row["dtPrinted"].ToString()) >= Convert.ToDateTime(oTickets.StartDate)) &&
                                (Convert.ToDateTime(string.IsNullOrEmpty(row["dtPaid"].ToString()) ? DateTime.Now.ToString() : row["dtPaid"].ToString())
                                <= Convert.ToDateTime(oTickets.EndDate)))
                            {
                                excep.Status = "Printed within, Claimed in different category";
                            }
                            else if (string.IsNullOrEmpty(row["dtPaid"].ToString()))
                            {
                                excep.Status = "Active Ticket";
                            }
                            else
                            {
                                excep.Value = -excep.Value;
                                //  excep.Amount = excep.Value.ToString("###0.#0");
                                excep.Amount = CurrencySymbol + " " + Convert.ToDecimal(excep.Value).GetUniversalCurrencyFormat();
                                excep.Status = "Printed within period, claimed later";
                            }
                            excep.Position = sPosTer;


                            excep.PrintDate = row["dtPrinted"].ToString().ToShortDateTimeString();
                          //  excep.PrintDate = row["dtPrinted"].ToShortDateTimeString();
                         
                            if (!(row["dtPrinted"] == null))
                            {
                                excep.PayDate = Convert.ToDateTime(row["dtPrinted"]) != null ?  row["dtPrinted"].ToString().ToShortDateTimeString() :
                                    string.Empty;
                             }
                            excep.PayDate = Convert.ToDateTime(row["dtPrinted"]) != null ? row["dtPrinted"].ToString().ToShortDateTimeString() :
                                    string.Empty;
                          
                            excep.PayDevice = (row["PayDevice"] != null ? row["PayDevice"].ToString() : string.Empty);

                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            // excep.Details = excep.Ticket;
                            excep.Details = string.Empty;
                         
                        }
                        lstTickets.Add(excep); 
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            if (lstTickets != null && lstTickets.Count > 0)
            {
                lstTickets[0].currEGM = currEGM;
                lstTickets[0].CurrentCashDesk = CurrentCashDesk;
            }

            return lstTickets;
        }
        private List<TicketExceptions> LoadVoidCancelledTickets()
        {
            objCashDeskManager = CashDeskManagerBusinessObject.CreateInstance();

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
               {
                   lvVoidCancelled.Items.Clear();
               });
            List<string> lstPositionstoDisplay = objCashDeskManager.FillListOfFilteredPositions(RouteNumber);

            Tickets oTickets = new Tickets();
            oTickets.EndDate = EndDate;
            oTickets.StartDate = StartDate;
            oTickets.IsLiability = false;
            oTickets.BarCode = "%";
            oTickets.Type = "B";
            oTickets.UserNo = UserNo;

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgVoidcancelled.Value += 50;
            });

            List<TicketExceptions> lstVoidCancelled = objCashDeskManager.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay);

            if (lstVoidCancelled != null)
            {
                decimal ExceptionTotal = 0;
                TicketExceptions Total = new TicketExceptions();
                Total.PrintDate = "Total";
                foreach (TicketExceptions exep in lstVoidCancelled)
                {
                    ExceptionTotal += (decimal)exep.Value;
                }
                Total.Value = (double)Decimal.Round(ExceptionTotal, 2);
               // Total.Amount = Total.Value.ToString("###0.#0");
                Total.Amount = CurrencySymbol + "" + Convert.ToDecimal(ExceptionTotal).GetUniversalCurrencyFormat();
                lstVoidCancelled.Insert(0, Total);

                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                {
                    prgVoidcancelled.Value += 50;
                });
            }

            return lstVoidCancelled;
            
        }
        private List<TicketExceptions> LoadActiveTickets()
        {
            objCashDeskManager = CashDeskManagerBusinessObject.CreateInstance();

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
               {
                   lvActiveTickets.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 = false;
            oTickets.BarCode = "%";
            oTickets.Type = "U";
            oTickets.UserNo = UserNo;

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgActiveTickets.Value += 50;
            });
            List<TicketExceptions> lstTitoTicketsUnclaimed = objCashDeskManager.TitoTicketsUnclaimed(oTickets, lstPositionstoDisplay);
            if (lstTitoTicketsUnclaimed == null)
            {
                lstTitoTicketsUnclaimed = new List<TicketExceptions>();
            }

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgActiveTickets.Value += 50;
            });
            List<TicketExceptions> lstTicketsUnClaimed = objCashDeskManager.TicketsUnclaimed(oTicketsClaimed, lstPositionstoDisplay);

            if (lstTicketsUnClaimed != null)
            {
                foreach (TicketExceptions item in lstTicketsUnClaimed)
                {
                    lstTitoTicketsUnclaimed.Add(item);
                }
            }
            decimal ExceptionTotal = 0;
            TicketExceptions Total = new TicketExceptions();
            Total.PrintDate = string.Empty;
            Total.PrintDate = "Total";
            Total.PayDate = string.Empty;
            foreach (TicketExceptions exep in lstTitoTicketsUnclaimed)
            {
                ExceptionTotal += (decimal)exep.Value;
            }
            Total.Value = (double)Decimal.Round(ExceptionTotal, 2);
            Total.Amount = CurrencySymbol + "" + Convert.ToDecimal(ExceptionTotal).GetUniversalCurrencyFormat();
            lstTitoTicketsUnclaimed.Insert(0, Total);
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgActiveTickets.Value += 50;
            });

            return lstTitoTicketsUnclaimed;
        }
        public List<TicketExceptions> TITOTicketInExceptions(Tickets oTickets, List<string> lstPositions)
        {
            //            '
            //'
            //Dim oRs             As adodb.Recordset
            //Dim myItem          As ListItem
            //Dim cTicketTotal    As Currency
            //Dim currValue       As Currency
            string strTicketInException = string.Empty;
            List<TicketExceptions> lstTickets = null;
           
            try
            {
                DataTable dtTickets=cashdeskmanagerDataAccess.GetTickets(oTickets);
                if (dtTickets == null && dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                
                    lstTickets = new List<TicketExceptions>();
                    TicketExceptions excep = null;
                   // DataTable dtTickets = cashdeskmanagerDataAccess.GetTickets(oTickets);
                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.SEGM = row["PrintDevice"].ToString();
                        excep.Machine = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;

                        System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB");
                        DateTime dt = DateTime.Parse(row["dtPrinted"].ToString(),
                        System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat);

                        if (!string.IsNullOrEmpty(excep.SEGM) && DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions))
                        {
                            excep.bExceptionRecordFound = true;
                            excep.Type = "IN";
                            excep.Position = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString());

                           

                          //  excep.PrintDate = row["dtPrinted"].ToString().ReadDateTimeWithSeconds().ToString();
                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();
                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                           // excep.Amount = excep.Value.ToString("###0.#0");
                            excep.Amount = CurrencySymbol + " " + Convert.ToDecimal(excep.Value).GetUniversalCurrencyFormat();

                            excep.Asset = row["Asset"].ToString();
                            excep.PayDevice = row["PayDevice"].ToString();
                            excep.CreateCompleted = string.Empty;
                            excep.DeviceID = row["DeviceID"].ToString();

                            excep.cTicketTotal += excep.currValue;
                            excep.cExceptionsTotal += excep.currValue;
                        }
                        else if (DBCommon.IsMachineATicketWorkstation(row["PrintDevice"].ToString()))
                        {
                            excep.bExceptionRecordFound = true;
                            excep.Type = "IN";
                            excep.Position = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();
                           //  excep.PrintDate = dt.ToString().ReadDateTimeWithSeconds().ToString();

                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            excep.Amount = CurrencySymbol + " " + Convert.ToDecimal(excep.Value).GetUniversalCurrencyFormat();

                            //excep.Amount = excep.Value.ToString("###0.#0");
                            excep.Asset = row["Asset"].ToString();
                            excep.PayDevice = row["PayDevice"].ToString();
                            excep.CreateCompleted = string.Empty;

                            excep.cTicketTotal += excep.currValue;
                            excep.cExceptionsTotal += excep.currValue;
                        }
                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;

        }
        public static List<TicketExceptions> TitoTicketsClaimed(Tickets oTickets, List<string> lstPositionstoDisplay)
        {
            string strTicketInException = string.Empty;
            string sPosTer = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;

            try
            {
                DataTable dtTickets = DBBuilder.GetTickets(oTickets);
                if (dtTickets == null && dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.bExceptionRecordFound = false;
                        excep.SEGM = row["PayDevice"].ToString();
                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;
                        if (!string.IsNullOrEmpty(excep.SEGM) && row["strDeviceType"].ToString().Equals("EXTITO"))
                        {
                            if (DBCommon.IsMachineATicketWorkstation(excep.SEGM))
                            {
                                if (DBCommon.CheckPositionToDisplay(GetBarPositionFromAsset(row["PrintDevice"].ToString()), lstPositionstoDisplay))
                                {
                                    sPosTer = excep.SEGM;
                                    excep.Machine = GetBarPositionFromAsset(row["PrintDevice"].ToString());
                                    excep.CurrentCashDesk += excep.currValue;
                                    excep.CashDeskClaimedQty += 1;
                                    if (oTickets.IsClaimedInCashDesk == true)
                                    {
                                        excep.bExceptionRecordFound = true;
                                    }
                                }
                            }
                            else
                            {
                                sPosTer = string.Empty;
                                excep.Machine = GetBarPositionFromAsset(excep.SEGM);

                                if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositionstoDisplay))
                                {
                                    excep.currEGM += excep.currValue;
                                    excep.MachineClaimedQty += 1;
                                    if (oTickets.IsClaimedInMachine)
                                    {
                                        excep.bExceptionRecordFound = true;
                                    }
                                }
                            }
                        }
                        else
                        {
                            sPosTer = row["PrintDevice"].ToString();
                            excep.Machine = row["PayDevice"].ToString();
                            excep.CurrentCashDesk += excep.currValue;
                            excep.CashDeskClaimedQty += 1;
                            if (oTickets.IsClaimedInCashDesk)
                            {
                                excep.bExceptionRecordFound = true;
                            }
                        }
                        if (excep.bExceptionRecordFound)
                        {

                            string dPrintDate = row["dtPrinted"].ToString();
                            string dClaimDate = row["dtPaid"].ToString();


                            excep.Position = sPosTer;
                            excep.Machine = DBBuilder.GetBarPositionFromAsset(excep.Machine);
                           // excep.Machine = sPosTer;
                            excep.TransactionType="TITO Claimed";
                            excep.Zone = "n/a";

                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");

                            if (!(row["dtPaid"] == null))
                            {
                                excep.PayDate = Convert.ToDateTime(row["dtPaid"] != null ? row["dtPaid"] : string.Empty).ToString("dd MMM yyyy") + " " +
                                                Convert.ToDateTime(row["dtPaid"] != null ? row["dtPaid"] : string.Empty).ToString("hh:mm");
                            }


                            excep.PayDevice = (row["PayDevice"] != null ? GetBarPositionFromAsset(row["PayDevice"].ToString()) : string.Empty);

                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            excep.Value = -(Convert.ToDouble(row["iAmount"]) / 100);
                            excep.Amount = (-(excep.Value)).ToString();


                            if ((Convert.ToDateTime(dPrintDate) >= Convert.ToDateTime(oTickets.StartDate)) &&
                                (Convert.ToDateTime(dClaimDate) <= Convert.ToDateTime(oTickets.EndDate)))
                            {
                                excep.Status = "Printed in different category, Claimed within";
                            }
                            else
                            {
                                excep.Status = "Printed prior to period, Claimed within";
                            }
                            excep.Details = "";
                            excep.cExceptionsTotal += (float)excep.Value;
                            
                        }

                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
        public static List<TicketExceptions> TicketsClaimed(TicketsClaimed oTickets, List<string> lstPositionstoDisplay)
        {
            string strTicketInException = string.Empty;
            string sPosTer = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;

            try
            {
                DataTable dtTicketsClaimed = GetTicketsClaimed(oTickets);
                if (dtTicketsClaimed != null && dtTicketsClaimed.Rows.Count > 0)
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTicketsClaimed.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.currValue = (float)Convert.ToDouble(row["tbr_payout_value"]) / 100;
                        if (DBCommon.CheckPositionToDisplay(row["bar_pos_name"].ToString(), lstPositionstoDisplay))
                        {
                            if (Convert.ToDateTime(row["tbr_payout_time"].ToString()) <= Convert.ToDateTime(oTickets.TicketsClaimedFrom))
                            {
                                excep.Position = DBBuilder.GetBarPositionFromAsset(row["TBR_Payout_Machine_Serial"].ToString());

                                excep.PrintDate = Convert.ToDateTime(row["TBR_Payout_Print_Time"]).ToString("dd MMM yyyy") + " " +
                                    Convert.ToDateTime(row["TBR_Payout_Print_Time"]).ToString("HH:mm");

                                if (!(row["TBR_Payout_Time"] == null))
                                {
                                    excep.PayDate = Convert.ToDateTime(row["TBR_Payout_Time"] != null ? row["TBR_Payout_Time"] : string.Empty).ToString("dd MMM yyyy") + " " +
                                                    Convert.ToDateTime(row["TBR_Payout_Time"] != null ? row["TBR_Payout_Time"] : string.Empty).ToString("HH:mm");
                                }

                                excep.ClaimedTerminal = DBBuilder.GetBarPositionFromAsset(row["TBR_Payout_Claimed_Terminal"].ToString());
                                excep.Ticket = row["TBR_Payout_ExternalIndex"].ToString();
                                excep.Status = "Printed prior to period, Claimed within";

                                excep.Value = -(Convert.ToDouble(row["tbr_payout_value"]) / 100);
                                excep.Amount = "(" + excep.Value + ")";
                                excep.cTicketTotal += excep.currValue;

                            }
                        }

                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
        private List<TicketExceptions> LoadExceptions()
        {

            decimal ExceptionTotal = 0;

           
            List<string> lstPositionstoDisplay = objCashDeskManager.FillListOfFilteredPositions(RouteNumber);
            //FillListOfFilteredPositions
            Tickets oTickets = new Tickets();
            oTickets.EndDate = dtTo;
            oTickets.StartDate = dtFrom;
            oTickets.IsLiability = false;
            oTickets.BarCode = "%";
            oTickets.Type = "E";
            oTickets.UserNo = UserNo;
            
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                     {
                         prgExceptions.Value += 50;
                     });
            List<TicketExceptions> lstExceptions = objCashDeskManager.TITOTicketInExceptions(oTickets, lstPositionstoDisplay);
            if (lstExceptions == null)
            {
                lstExceptions = new List<TicketExceptions>();
                
            }
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgExceptions.Value += 50;
            });
            List<TicketExceptions> lstExceptionsOut = objCashDeskManager.TitoTicketOutExceptions(oTickets, lstPositionstoDisplay);



            if (lstExceptionsOut != null)
            {
                foreach (TicketExceptions exep in lstExceptionsOut)
                { 
                        lstExceptions.Add(exep);
                   
                }
            }

            //CreateTotals cExceptionsTotal
            foreach (TicketExceptions item in lstExceptions)
            {
                ExceptionTotal += (decimal) item.currValue;
            }

            TicketExceptions Total = new TicketExceptions();
            Total.Type = "Total";
            Total.Amount = CurrencySymbol + "" + Convert.ToDecimal(ExceptionTotal).GetUniversalCurrencyFormat();
            lstExceptions.Insert(0, Total);

          

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgExceptions.Value += 50;
            });
            return lstExceptions;
        }
        public static List<TicketExceptions> GetTreasuryItems(Tickets oTickets, List<string> lstPositions)
        {
            List<TicketExceptions> items = null;
            TicketExceptions treasury = null;

            try
            {
                DataTable dtTreasury = ExecuteTable(GetExchangeConnectionString(), oTickets, false);

                items = new List<TicketExceptions>();
                foreach (DataRow row in dtTreasury.Rows)
                {

                    if (DBCommon.CheckPositionToDisplay(row["bar_pos_name"].ToString(), lstPositions))
                    {
                        

                            treasury = new TicketExceptions();
                            treasury.PayDate = row["treasury_date"].ToString() + " " + row["treasury_time"].ToString();
                            treasury.PrintDate = row["treasury_date"].ToString() + " " + row["treasury_time"].ToString();
                            treasury.TransactionType = oTickets.Type;
                            treasury.Zone = row["Zone_name"].ToString();
                            treasury.Position = row["bar_pos_name"].ToString();
                            treasury.Machine = row["machine_name"].ToString();
                            treasury.Amount = row["treasury_amount"].ToString();
                            treasury.Details = "";
                       
                        switch (oTickets.Type)
                        {
                            case DBConstants.CONST_HANDPAYCREDIT:
                                {
                                    treasury.HandpayQty += 1;
                                    break;
                                }
                            case DBConstants.CONST_JACKPOT:
                                {
                                    treasury.JackPotQty += 1;
                                    break;
                                }
                            case DBConstants.CONST_PROG:
                                {
                                    treasury.ProgQty += 1;
                                    break;
                                }
                            case DBConstants.CONST_REFILL:
                                {
                                    treasury.RefillQty += 1;
                                    break;
                                }
                            case DBConstants.CONST_REFUND:
                                {
                                    treasury.RefundQty += 1;
                                    break;
                                }
                            case DBConstants.CONST_SHORTPAY:
                                {
                                    treasury.ShortQty += 1;
                                    break;
                                }
                            case DBConstants.CONST_FLOAT:
                                {
                                    treasury.FloatQty += 1;
                                    break;
                                }
                            default:
                                break;
                        }
                        items.Add(treasury);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }

            return items;
        }
        private List<TicketExceptions> LoadActiveTickets()
        {
            busTreasury = new TreasuryTransactions();
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
               {
                   lvActiveTickets.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 = false;
            oTickets.BarCode = "%";
            oTickets.Type = "U";

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgActiveTickets.Value += 50;
            });
            List<TicketExceptions> lstTitoTicketsUnclaimed = busTreasury.TitoTicketsUnclaimed(oTickets, lstPositionstoDisplay);
            if (lstTitoTicketsUnclaimed == null)
            {
                lstTitoTicketsUnclaimed = new List<TicketExceptions>();
            }

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgActiveTickets.Value += 50;
            });
            List<TicketExceptions> lstTicketsUnClaimed = busTreasury.TicketsUnclaimed(oTicketsClaimed, lstPositionstoDisplay);

            if (lstTicketsUnClaimed != null)
            {
                foreach (TicketExceptions item in lstTicketsUnClaimed)
                {
                    lstTitoTicketsUnclaimed.Add(item);
                }

                decimal ExceptionTotal = 0;
                TicketExceptions Total = new TicketExceptions();
                Total.PrintDate = "Total";
                Total.PayDate = "";
                foreach (TicketExceptions exep in lstTitoTicketsUnclaimed)
                {
                    ExceptionTotal += (decimal)exep.Value;
                }
                Total.Value = (double)Decimal.Round(ExceptionTotal, 2);
                lstTitoTicketsUnclaimed.Insert(0, Total);
                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                {
                    prgActiveTickets.Value += 50;
                });
            }

            return lstTitoTicketsUnclaimed;
        }
        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> 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;
        }
        public List<TicketExceptions> TITOTicketInExceptions(Tickets oTickets, List<string> lstPositions)
        {
            //            '
            //'
            //Dim oRs             As adodb.Recordset
            //Dim myItem          As ListItem
            //Dim cTicketTotal    As Currency
            //Dim currValue       As Currency
            string strTicketInException = string.Empty;
            List<TicketExceptions> lstTickets = null;
           
            try
            {
                if (DBBuilder.GetTickets(oTickets) == null && DBBuilder.GetTickets(oTickets).Rows.Count < 0)
                {
                }
                else
                {
                
                    lstTickets = new List<TicketExceptions>();
                    TicketExceptions excep = null;
                    DataTable dtTickets = DBBuilder.GetTickets(oTickets);
                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.SEGM = row["PrintDevice"].ToString();
                        excep.Machine = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;
                        if (!string.IsNullOrEmpty(excep.SEGM) && DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions))
                        {
                            excep.bExceptionRecordFound = true;
                            excep.Type = "IN";
                            excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");
                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            excep.Asset = row["PrintDevice"].ToString();
                            excep.PayDevice = row["PayDevice"].ToString();
                            excep.CreateCompleted = string.Empty;

                            excep.cTicketTotal += excep.currValue;
                            excep.cExceptionsTotal += excep.currValue;
                        }
                        else if (DBCommon.IsMachineATicketWorkstation(row["PrintDevice"].ToString()))
                        {
                            excep.bExceptionRecordFound = true;
                            excep.Type = "IN";
                            excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");
                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            excep.Asset = row["PrintDevice"].ToString();
                            excep.PayDevice = row["PayDevice"].ToString();
                            excep.CreateCompleted = string.Empty;

                            excep.cTicketTotal += excep.currValue;
                            excep.cExceptionsTotal += excep.currValue;
                        }
                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;

        }
        public List<TicketExceptions> GetPromoCashableTickets(TicketsClaimed oTickets, List<string> lstPositions)
        {

            string strTicketInException = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;


            try
            {
                DataTable dtTickets = DBBuilder.GetPromoTickets(oTickets);
                if (dtTickets == null && dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.SEGM = row["PrintDevice"].ToString();
                        excep.Machine = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());

                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;
                        if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions))
                        {
                            excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.TransactionType = "PROMO";
                            excep.Zone = row["GameTitle"].ToString();

                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");

                            excep.PayDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                             Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");

                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            excep.Amount = "(" + Convert.ToDouble(row["iAmount"]) / 100 + ")";

                            excep.Status = (row["StrVoucherStatus"] == "NA" ? "Auto Cancelled" : "Void");
                            excep.cExceptionsTotal += excep.currValue;
                        }
                        else if (DBCommon.IsMachineATicketWorkstation(row["PrintDevice"].ToString()))
                        {
                            excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.TransactionType = "PROMO";
                            excep.Zone = row["GameTitle"].ToString();

                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");

                            excep.PayDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                              Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");

                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            excep.Amount = "(" + Convert.ToDouble(row["iAmount"]) / 100 + ")";

                            excep.Status = (row["StrVoucherStatus"] == "NA" ? "Auto Cancelled" : "Void");
                            excep.cExceptionsTotal += excep.currValue;
                        }

                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
示例#14
0
        public static List<TicketExceptions> TicketsUnClaimed(TicketsClaimed oTickets, List<string> lstPositions)
        {
            string strTicketInException = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;


            try
            {
                DataTable dtTickets = ExecuteTable(DBConstants.CONST_SP_GET_TICKETS_UNCLAIMED, oTickets);
                if (dtTickets == null && dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.SEGM = row["bar_pos_name"].ToString();
                        excep.Machine = DBBuilder.GetBarPositionFromAsset(row["bar_pos_name"].ToString());

                        if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions))
                        {
                            excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.Machine = row["bar_pos_name"].ToString() + " - " + row["tbr_node_serial"].ToString();
                            excep.TransactionType = "Ticket";
                            excep.Zone = row["Zone_Name"] != null ? row["Zone_Name"].ToString() : string.Empty;

                            excep.PrintDate = Convert.ToDateTime(row["tbr_payout_time"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["tbr_payout_time"]).ToString("HH:mm");

                            excep.PayDate = Convert.ToDateTime(row["tbr_payout_time"]).ToString("dd MMM yyyy") + " " +
                             Convert.ToDateTime(row["tbr_payout_time"]).ToString("HH:mm");

                            excep.SEGM = row["machine_name"].ToString();

                            excep.Value = Convert.ToDouble(row["tbr_payout_value"]) / 100;
                            excep.Amount = "(" + Convert.ToDouble(row["tbr_payout_value"]) / 100 + ")";

                           excep.cExceptionsTotal += (float) excep.Value;
                        }
                        else if (DBCommon.IsMachineATicketWorkstation(row["PrintDevice"].ToString()))
                        {
                            excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.Machine = row["bar_pos_name"].ToString() + " - " + row["tbr_node_serial"].ToString();
                            excep.TransactionType = "Ticket";
                            excep.Zone = row["Zone_Name"] != null ? row["Zone_Name"].ToString() : string.Empty;

                            excep.PrintDate = Convert.ToDateTime(row["tbr_payout_time"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["tbr_payout_time"]).ToString("HH:mm");

                            excep.PayDate = Convert.ToDateTime(row["tbr_payout_time"]).ToString("dd MMM yyyy") + " " +
                             Convert.ToDateTime(row["tbr_payout_time"]).ToString("HH:mm");

                            excep.SEGM = row["machine_name"].ToString();

                            excep.Value = Convert.ToDouble(row["tbr_payout_value"]) / 100;
                            excep.Amount = "(" + Convert.ToDouble(row["tbr_payout_value"]) / 100 + ")";

                            excep.cExceptionsTotal += (float)excep.Value;
                        }

                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
        private List<TicketExceptions> LoadVoidCancelledTickets()
        {
            busTreasury = new TreasuryTransactions();
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
               {
                   lvVoidCancelled.Items.Clear();
               });
            List<string> lstPositionstoDisplay = busTreasury.FillListOfFilteredPositions(RouteNumber);

            Tickets oTickets = new Tickets();
            oTickets.EndDate = EndDate + " " + EndTime;
            oTickets.StartDate = StartDate + " " + StartTime;
            oTickets.IsLiability = false;
            oTickets.BarCode = "%";
            oTickets.Type = "B";

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgVoidcancelled.Value += 50;
            });

            List<TicketExceptions> lstVoidCancelled = busTreasury.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay);

            if (lstVoidCancelled != null)
            {
                decimal ExceptionTotal = 0;
                TicketExceptions Total = new TicketExceptions();
                Total.PrintDate = "Total";
                foreach (TicketExceptions exep in lstVoidCancelled)
                {
                    ExceptionTotal += (decimal)exep.Value;
                }
                Total.Value = (double)Decimal.Round(ExceptionTotal, 2);
                lstVoidCancelled.Insert(0, Total);

                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                {
                    prgVoidcancelled.Value += 50;
                });
            }

            return lstVoidCancelled;
            
        }
示例#16
0
        public static List<TicketExceptions> RetrieveTicketAnomalies(TicketsClaimed oTickets, List<string> lstPositions)
        {
           string strTicketInException = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;


            try
            {
                DataTable dtTickets = ExecuteTable(DBConstants.CONST_SP_RSP_TICKET_ANOMALIES, oTickets);
                if (dtTickets == null && dtTickets.Rows.Count < 0)
                {
                    return null;
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.SEGM = row["Machine"].ToString();
                        excep.Machine = DBBuilder.GetBarPositionFromAsset(row["Machine"].ToString());

                        if (!string.IsNullOrEmpty(excep.SEGM) &&
                            DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions))
                        {
                            excep.Reference = row["Reference"].ToString();
                            excep.Value = Convert.ToDouble(row["Amount"]);
                            excep.PrintDate = Convert.ToDateTime(row["dtDate"].ToString()).ToString("dd MMM yyyy");
                            excep.Details = row["Details"].ToString();
                        }
                        lstTickets.Add(excep);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
        private List<TicketExceptions> LoadExceptions()
        {

            busTreasury = new TreasuryTransactions();
            float ExceptionTotal = 0F;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  lvExceptions.Items.Clear();
              });
            List<string> lstPositionstoDisplay = busTreasury.FillListOfFilteredPositions(RouteNumber);
            //FillListOfFilteredPositions
            Tickets oTickets = new Tickets();
            oTickets.EndDate = dtTo + " " + TimeTo;
            oTickets.StartDate = dtFrom + " " + TimeFrom;
            oTickets.IsLiability = false;
            oTickets.BarCode = "%";
            oTickets.Type = "E";
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                     {
                         prgExceptions.Value += 50;
                     });
            List<TicketExceptions> lstExceptions = busTreasury.TITOTicketInExceptions(oTickets, lstPositionstoDisplay);
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgExceptions.Value += 50;
            });
            List<TicketExceptions> lstExceptionsOut = busTreasury.TitoTicketOutExceptions(oTickets, lstPositionstoDisplay);

            if (lstExceptionsOut.Count > 0)
            {
                if (lstExceptionsOut[0].bExceptionRecordFound)
                {
                    TicketExceptions Total = new TicketExceptions();
                    Total.Type = "Total";
                    foreach (TicketExceptions exep in lstExceptionsOut)
                    {
                        ExceptionTotal += exep.cExceptionsTotal;
                    }
                    Total.Value = Convert.ToDouble(ExceptionTotal.ToString("###0.00"));
                    lstExceptionsOut.Insert(0, Total);

                    //CreateTotals cExceptionsTotal
                }
            }
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgExceptions.Value += 50;
            });
            return lstExceptionsOut;
        }
示例#18
0
        public static List<TicketExceptions> TitoTicketOutExceptions(Tickets oTickets, List<string> lstPositionstoDisplay)
        {
            List<TicketExceptions> lstTickets = null;
            try
            {
                SqlParameter[] parameters = SqlHelperParameterCache.GetSpParameterSet(GetExchangeConnectionString(), "rsp_GetNonCompletedTicketPrints");
                foreach (SqlParameter param in parameters)
                {
                    if (param.ParameterName == "@StartDate")
                    {
                        param.Value = oTickets.StartDate;
                    }
                    if (param.ParameterName == "@EndDate")
                    {
                        param.Value = oTickets.EndDate;
                    }
                }
                SqlDataReader reader = SqlHelper.ExecuteReader(GetExchangeConnectionString(), "rsp_GetNonCompletedTicketPrints", parameters);

                lstTickets = new List<TicketExceptions>();
                TicketExceptions excep = null;

                while (reader.Read())
                {
                    excep = new TicketExceptions();
                    excep.SEGM = reader["bar_pos_name"].ToString();
                    excep.Machine = DBBuilder.GetBarPositionFromAsset(reader["bar_pos_name"].ToString());
                    excep.currValue = (float)Convert.ToDouble(reader["TE_Value"]) / 100;
                    if (!string.IsNullOrEmpty(excep.SEGM) && DBCommon.CheckPositionToDisplay(excep.Machine, lstPositionstoDisplay))
                    {
                        excep.bExceptionRecordFound = true;
                        excep.Type = "OUT";
                        excep.Position = DBBuilder.GetBarPositionFromAsset(reader["bar_pos_name"].ToString());
                        excep.PrintDate = Convert.ToDateTime(reader["TE_Date"]).ToString("dd MMM yyyy") + " " +
                            Convert.ToDateTime(reader["TE_Date"]).ToString("HH:mm");
                        if (!string.IsNullOrEmpty(reader["TE_TicketNumber"].ToString()))
                        {
                            excep.Ticket = reader["ActualBarcode"].ToString();
                        }
                        else
                        {
                            excep.Ticket = reader["TE_TicketNumber"].ToString();
                        }
                        excep.Value = Convert.ToDouble(reader["TE_Value"]) / 100;
                        excep.Asset = reader["stock_no"].ToString();
                        excep.COLINSTALLID = Convert.ToInt16(reader["TE_Installation_No"].ToString());
                        excep.CreateCompleted = reader["CreateExpected"].ToString();

                        excep.cTicketTotal += excep.currValue;
                        excep.cExceptionsTotal += excep.currValue;
                    }
                    else if (DBCommon.IsMachineATicketWorkstation(excep.Machine))
                    {
                        excep.bExceptionRecordFound = true;
                        excep.Type = "OUT";
                        excep.Position = DBBuilder.GetBarPositionFromAsset(reader["bar_pos_name"].ToString());
                        excep.PrintDate = Convert.ToDateTime(reader["TE_Date"]).ToString("dd MMM yyyy") + " " +
                            Convert.ToDateTime(reader["TE_Date"]).ToString("HH:mm");
                        if (!string.IsNullOrEmpty(reader["TE_TicketNumber"].ToString()))
                        {
                            excep.Ticket = reader["ActualBarcode"].ToString();
                        }
                        else
                        {
                            excep.Ticket = reader["TE_TicketNumber"].ToString();
                        }
                        excep.Value = Convert.ToDouble(reader["TE_Value"]) / 100;
                        excep.Asset = reader["stock_no"].ToString();
                        excep.COLINSTALLID = Convert.ToInt16(reader["TE_Installation_No"].ToString());
                        excep.CreateCompleted = reader["CreateExpected"].ToString();

                        excep.cTicketTotal += excep.currValue;
                        excep.cExceptionsTotal += excep.currValue;
                    }
                    lstTickets.Add(excep);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
        public  List<TicketExceptions> TicketsPrinted(TicketsClaimed oTickets, List<string> lstPositionstoDisplay)
        {
            string strTicketInException = string.Empty;
            string sPosTer = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;

            try
            {
                DataTable dtTicketsClaimed = GetTicketsPrinted(oTickets);
                if (dtTicketsClaimed != null || dtTicketsClaimed.Rows.Count > 0)
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTicketsClaimed.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.currValue = (float)Convert.ToDouble(row["tbr_payout_value"]) / 100;
                        if (DBCommon.CheckPositionToDisplay(row["bar_pos_name"].ToString(), lstPositionstoDisplay))
                        {
                            if (row["tbr_payout_claimed"].ToString().Equals("1"))
                            {
                                excep.Position = GetBarPositionFromAsset(row["TBR_Payout_Machine_Serial"].ToString());

                                excep.PrintDate = row["TBR_Payout_Print_Time"].ToString().ToShortDateTimeString();
                                
                                if (!(row["TBR_Payout_Time"] == null))
                                {
                                    if (Convert.ToDateTime(row["TBR_Payout_Time"]) != null)
                                    {
                                        excep.PayDate = row["TBR_Payout_Time"].ToString().ToShortDateTimeString();
                                    }
                                    else
                                    {
                                        excep.PayDate = string.Empty;
                                    } Convert.ToDateTime(row["TBR_Payout_Time"] != null ? row["TBR_Payout_Time"] : string.Empty).ToString("HH:mm");
                                }

                                excep.ClaimedTerminal = GetBarPositionFromAsset(row["TBR_Payout_Claimed_Terminal"].ToString());
                                excep.Ticket = row["TBR_Payout_ExternalIndex"].ToString();
                                excep.Status = "Printed prior to period, Claimed within";

                                excep.Value = Convert.ToDouble(row["tbr_payout_value"]) / 100;
                              //  excep.Amount = excep.Value.ToString("###0.#0") ;
                                excep.Amount = CurrencySymbol + " " + Convert.ToDecimal(excep.Value).GetUniversalCurrencyFormat();
                                excep.cTicketTotal += excep.currValue;

                            }
                        }

                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
示例#20
0
        public static List<TicketExceptions> TitoTicketsPrintedLiability(Tickets oTickets, List<string> lstPositionstoDisplay)
        {
            string strTicketInException = string.Empty;
            string sPosTer = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;

            try
            {
                DataTable dtTickets = DBBuilder.GetTickets(oTickets);
                if (dtTickets == null && dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.bExceptionRecordFound = false;
                        excep.SEGM = row["PrintDevice"].ToString();
                        excep.VoucherStatus = row["strVoucherStatus"].ToString();
                        excep.TicketAddedtoList = false;
                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;
                        if (!string.IsNullOrEmpty(excep.SEGM))
                        {
                            if (row["strDeviceType"].ToString().Equals("EXTITO") || string.IsNullOrEmpty(row["strDeviceType"].ToString()))
                            {
                                if (DBCommon.IsMachineATicketWorkstation(excep.SEGM))
                                {
                                    excep.TicketAddedtoList = true;
                                }
                                else
                                {
                                    sPosTer = string.Empty;
                                    excep.Machine = GetBarPositionFromAsset(excep.SEGM);
                                    if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositionstoDisplay))
                                    {

                                        excep.TicketAddedtoList = true;
                                    }
                                }
                            }
                            else
                            {  
                                excep.TicketAddedtoList = true;
                            }
                        }

                        if (excep.TicketAddedtoList)
                        {

                            string dPrintDate = row["dtPrinted"].ToString();
                            string dClaimDate = string.IsNullOrEmpty(row["dtPaid"].ToString()) ? "01/01/3100" : row["dtPaid"].ToString();

                            excep.TransactionType = "TITO Printed";
                            excep.Zone = "n/a";


                            if ((Convert.ToDateTime(dPrintDate) >= Convert.ToDateTime(oTickets.StartDate)) &&
                                (Convert.ToDateTime(dClaimDate) <= Convert.ToDateTime(oTickets.EndDate)))
                            {
                                excep.Status = "Printed within, Claimed in different category";
                            }
                            else if (string.IsNullOrEmpty(row["dtPaid"].ToString()))
                            {
                                excep.Status = "Active Ticket";
                            }
                            else
                            {
                                excep.Status = "Printed within period, claimed later";
                            }

                            excep.Position = DBBuilder.GetBarPositionFromAsset(row["PrintDevice"].ToString());

                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy") + " " +
                                Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");

                            if (!(row["dtPaid"] == null))
                            {
                                excep.PayDate = Convert.ToDateTime(row["dtPaid"] != null ? row["dtPaid"] : string.Empty).ToString("dd MMM yyyy") + " " +
                                                Convert.ToDateTime(row["dtPaid"] != null ? row["dtPaid"] : string.Empty).ToString("HH:mm");
                            }


                            excep.PayDevice = (row["PayDevice"] != null ? GetBarPositionFromAsset( row["PayDevice"].ToString() ): string.Empty);

                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            excep.Amount = "(" + excep.Value + ")";


                        }

                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
        public  List<TicketExceptions> GetTreasuryItems(Tickets oTickets, List<string> lstPositions)
        {
            List<TicketExceptions> items = null;
            TicketExceptions treasury = null;

            try
            {
                DataTable dtTreasury = ExecuteTable(oTickets, false);

                items = new List<TicketExceptions>();
                foreach (DataRow row in dtTreasury.Rows)
                {

                    if (DBCommon.CheckPositionToDisplay(row["bar_pos_name"].ToString(), lstPositions))
                    {


                        treasury = new TicketExceptions();
                        //treasury.PayDate = row["treasury_date"].ToString() + " " + row["treasury_time"].ToString();
                        //treasury.PrintDate = row["treasury_date"].ToString() + " " + row["treasury_time"].ToString();
                        //treasury.PayDate = Convert.ToDateTime(row["treasury_date"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();
                        //treasury.PrintDate = Convert.ToDateTime(row["treasury_date"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();

                        treasury.PayDate = row["treasury_date"].ToString().ToShortDateTimeString();
                        treasury.PrintDate = row["treasury_date"].ToString().ToShortDateTimeString();



                        treasury.TransactionType = oTickets.Type;
                        treasury.Zone = row["Zone_name"].ToString();
                        treasury.Position = row["bar_pos_name"].ToString();
                        treasury.Machine = row["machine_name"].ToString();
                        //treasury.Amount = Convert.ToDouble(row["treasury_amount"]).ToString("###0.#0");
                        treasury.Amount = CurrencySymbol + " " + Convert.ToDecimal(row["treasury_amount"]).GetUniversalCurrencyFormat();
                        treasury.currValue = Convert.ToInt64(row["treasury_amount"]);
                        treasury.Value = Convert.ToDouble(row["treasury_amount"]);
                        treasury.Reason = row["treasury_reason"].ToString();
                        treasury.ReasonCode = row["treasury_reason_code"].ToString();
                        treasury.Asset = row["Asset"].ToString();
						treasury.TreasuryTemp = Convert.ToBoolean(row["Treasury_Temp"].ToString());
                        treasury.Details = "";
                        

                        if (string.IsNullOrEmpty(treasury.Reason))
                        {
                            switch (oTickets.Type)
                            {
                                case DBConstants.CONST_HANDPAYCREDIT:
                                    {

                                        treasury.HandpayQty += 1;
                                        treasury.TransactionType = row["TreasuryTypeDisplayText"].ToString();
                                        break;
                                    }
                                case DBConstants.CONST_JACKPOT:
                                    {
                                        treasury.JackPotQty += 1;
                                        treasury.TransactionType = row["TreasuryTypeDisplayText"].ToString();
                                        break;
                                    }
                                case DBConstants.CONST_PROG:
                                    {
                                        treasury.ProgQty += 1;
                                        treasury.TransactionType = row["TreasuryTypeDisplayText"].ToString();
                                        break;
                                    }
                                case DBConstants.CONST_REFILL:
                                    {
                                        treasury.RefillQty += 1;
                                        break;
                                    }
                                case DBConstants.CONST_REFUND:
                                    {
                                        treasury.RefundQty += 1;
                                        break;
                                    }
                                case DBConstants.CONST_SHORTPAY:
                                    {
                                        treasury.ShortQty += 1;
                                        break;
                                    }
                                case DBConstants.CONST_FLOAT:
                                    {
                                        treasury.FloatQty += 1;
                                        break;
                                    }
                                default:
                                    break;
                            }
                        }
                        items.Add(treasury);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }

            return items;
        }
        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;
        }
        public  List<TicketExceptions> TitoTicketsClaimedLiability(Tickets oTickets, List<string> lstPositionstoDisplay)
        {
            string strTicketInException = string.Empty;
            string sPosTer = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;

            try
            {
                DataTable dtTickets = GetTickets(oTickets);
                if (dtTickets == null || dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.bExceptionRecordFound = false;
                        excep.SEGM = row["PayDevice"].ToString();
                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;
                        excep.VoucherStatus = row["strVoucherStatus"].ToString();
                        if (!string.IsNullOrEmpty(excep.SEGM) && row["strDeviceType"].ToString().Equals("EXTITO"))
                        {
                            if (DBCommon.IsMachineATicketWorkstation(excep.SEGM))
                            {
                                if (DBCommon.CheckPositionToDisplay(GetBarPositionFromAsset(row["PrintDevice"].ToString()), lstPositionstoDisplay))
                                {
                                    sPosTer = excep.SEGM;
                                    excep.Machine = GetBarPositionFromAsset(row["PrintDevice"].ToString());
                                    excep.bExceptionRecordFound = true;
                                }
                            }
                            else
                            {
                                sPosTer = string.Empty;
                                excep.Machine = GetBarPositionFromAsset(excep.SEGM);

                                if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositionstoDisplay))
                                {
                                    excep.bExceptionRecordFound = true;
                                }
                            }
                        }
                        else
                        {

                            excep.bExceptionRecordFound = true;
                        }
                        if (excep.bExceptionRecordFound)
                        {

                            string dPrintDate = row["dtPrinted"].ToString();
                            string dClaimDate = row["dtPaid"].ToString();
                            excep.VoucherStatus = row["strVoucherStatus"].ToString();


                            excep.Position = GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.TransactionType = "Voucher Claimed";
                            excep.Zone = "n/a";

                            excep.PrintDate = row["dtPrinted"].ToString().ToShortDateTimeString();
                               // + " " +           Convert.ToDateTime(row["dtPrinted"]).ToString("HH:mm");

                            if (!(row["dtPaid"] == null))
                            {
                                excep.PayDate = row["dtPaid"].ToString().ToShortDateTimeString();
                                    //+" " + Convert.ToDateTime(row["dtPaid"] != null ? row["dtPaid"] : string.Empty).ToString("HH:mm");
                            }


                            excep.PayDevice = (row["PayDevice"] != null ? GetBarPositionFromAsset(row["PayDevice"].ToString()) : string.Empty);

                            if (!string.IsNullOrEmpty(row["strBarCode"].ToString()))
                            {
                                excep.Ticket = row["ActualBarcode"].ToString();
                            }
                            else
                            {
                                excep.Ticket = row["strBarcode"].ToString();
                            }
                            excep.Value = -(Convert.ToDouble(row["iAmount"]) / 100);
                          //  excep.Amount = (-(excep.Value)).ToString("###0.#0");
                            excep.Amount = CurrencySymbol + " " + Convert.ToDecimal(-excep.Value).GetUniversalCurrencyFormat();

                            if ((Convert.ToDateTime(dPrintDate) >= Convert.ToDateTime(oTickets.StartDate)) &&
                                (Convert.ToDateTime(dClaimDate) <= Convert.ToDateTime(oTickets.EndDate)))
                            {
                                excep.Status = "Printed in different category, Claimed within";
                            }
                            else
                            {
                                excep.Status = "Printed prior to period, Claimed within";
                            }
                            excep.cExceptionsTotal += (float)excep.Value;
                            excep.Asset = row["Asset"].ToString();
                            lstTickets.Add(excep);
                        }
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }
        private List<TicketExceptions> LoadPromoTickets()
        {
            objCashDeskManager = CashDeskManagerBusinessObject.CreateInstance();

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
               {
                   lvPromoCashable.Items.Clear();
               });

            List<string> lstPositionstoDisplay = objCashDeskManager.FillListOfFilteredPositions(RouteNumber);

            TicketsClaimed oTicketsClaimed = new TicketsClaimed();
            oTicketsClaimed.TicketsClaimedFrom = StartDate;
            oTicketsClaimed.TicketsClaimedTo = EndDate;
            oTicketsClaimed.UserNo = UserNo;

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgPromo.Value += 50;
            });


            List<TicketExceptions> lstPromoTickets = objCashDeskManager.GetPromoCashableTickets(oTicketsClaimed, lstPositionstoDisplay);

            decimal ExceptionTotal = 0;
            TicketExceptions Total = new TicketExceptions();
            Total.PrintDate = "Total";
            if (lstPromoTickets != null)
            {
                foreach (TicketExceptions exep in lstPromoTickets)
                {
                    ExceptionTotal += (decimal)exep.Value;
                }
                Total.Value = (double)Decimal.Round(ExceptionTotal, 2);
                Total.Amount = CurrencySymbol + "" + Convert.ToDecimal(ExceptionTotal).GetUniversalCurrencyFormat();
                lstPromoTickets.Insert(0, Total);
                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                {
                    prgPromo.Value += 50;
                });
            }
            return lstPromoTickets;
        }
        public List<TicketExceptions> GetPromoCashableTickets(TicketsClaimed oTickets, List<string> lstPositions)
        {

            string strTicketInException = string.Empty;
            List<TicketExceptions> lstTickets = null;
            TicketExceptions excep = null;


            try
            {
                DataTable dtTickets = cashdeskmanagerDataAccess.GetPromoTickets(oTickets);
                if (dtTickets == null && dtTickets.Rows.Count < 0)
                {
                }
                else
                {
                    lstTickets = new List<TicketExceptions>();

                    foreach (DataRow row in dtTickets.Rows)
                    {
                        excep = new TicketExceptions();
                        excep.SEGM = row["PrintDevice"].ToString();
                        excep.Machine = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString());

                        excep.currValue = (float)Convert.ToDouble(row["iAmount"]) / 100;
                        if (DBCommon.CheckPositionToDisplay(excep.Machine, lstPositions))
                        {
                            excep.Position = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.TransactionType = "PROMO";
                            excep.Zone = row["GameTitle"].ToString();

                            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB");
                            DateTime dt = DateTime.Parse(row["dtPrinted"].ToString(),
                            System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat);


                            //excep.PrintDate = row["dtPrinted"].ToString().ReadDateTimeWithSeconds().ToString();

                            //excep.PayDate = row["dtPrinted"].ToString().ReadDateTimeWithSeconds().ToString();

                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();

                            excep.PayDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();

                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            excep.Amount = CurrencySymbol + " " + (Convert.ToDecimal(row["iAmount"]) / 100).GetUniversalCurrencyFormat();

                            excep.Status = (row["StrVoucherStatus"] == "NA" ? "Auto Cancelled" : "Void");
                            excep.cExceptionsTotal += excep.currValue;
                        }
                        else if (DBCommon.IsMachineATicketWorkstation(row["PrintDevice"].ToString()))
                        {
                            excep.Position = cashdeskmanagerDataAccess.GetBarPositionFromAsset(row["PrintDevice"].ToString());
                            excep.TransactionType = "PROMO";
                            excep.Zone = row["GameTitle"].ToString();

                            excep.PrintDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();

                            excep.PayDate = Convert.ToDateTime(row["dtPrinted"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();

                            excep.Value = Convert.ToDouble(row["iAmount"]) / 100;
                            //excep.Amount = (Convert.ToDouble(row["iAmount"]) / 100).ToString("###0.#0") ;
                            excep.Amount = CurrencySymbol + " " + (Convert.ToDecimal(row["iAmount"]) / 100).GetUniversalCurrencyFormat();

                            excep.Status = (row["StrVoucherStatus"] == "NA" ? "Auto Cancelled" : "Void");
                            excep.cExceptionsTotal += excep.currValue;
                        }

                        lstTickets.Add(excep);
                    }
                }

            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return lstTickets;
        }