public List<TicketExceptions> GetTicketAnomalies(TicketsClaimed oTickets,List<string> lstPositions)
 {
     return cashdeskmanagerDataAccess.RetrieveTicketAnomalies(oTickets,lstPositions);
 }
        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;
        }
        private List<TicketExceptions> LoadTicketAnomalies()
        {
            objCashDeskManager = CashDeskManagerBusinessObject.CreateInstance();

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  lvTicketAnomalies.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
            {
                prgTicketAnomalies.Value += 75;
            });


            List<TicketExceptions> lstTicketAnomalies = objCashDeskManager.GetTicketAnomalies(oTicketsClaimed, lstPositionstoDisplay);
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgTicketAnomalies.Value += 50;
            });
            return lstTicketAnomalies;
        }
예제 #4
0
 private static DataTable ExecuteTable( TicketsClaimed oTickets)
 {
     return SqlHelper.ExecuteDataset(GetTicketingConnectionString(), DBConstants.CONST_SP_RSP_GETPROMOTICKETFORPERIODDETAILS, GetSpParameters(oTickets)).Tables[0];
 }
예제 #5
0
        private static object[] GetSpParameters(TicketsClaimed oTicketsClaimed)
        {
            SqlParameter[] ObjParams = new SqlParameter[2];
            ObjParams[0] = new SqlParameter(DBConstants.CONST_PARAM_STARTDATE, oTicketsClaimed.TicketsClaimedFrom);
            ObjParams[1] = new SqlParameter(DBConstants.CONST_PARAM_ENDDATE, oTicketsClaimed.TicketsClaimedTo);

            return ObjParams;
        }
예제 #6
0
        public static DataTable GetPromoTickets(TicketsClaimed oTickets)
        {

            DataTable dtTickets = null;
            try
            {
                
                dtTickets = ExecuteTable(oTickets);
                return dtTickets;
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
                return dtTickets;
            }
        }
예제 #7
0
        /// <summary>
        /// Method to get the tickets claimed.
        /// </summary>
        /// <param name=""></param>
        /// <returns>TicketsClaimed</returns>
        /// Method Revision History
        /// Author:    Anuradha
        /// Created:   28 April 2009
        /// 
        private static DataTable GetTicketsClaimed(TicketsClaimed oTickets)
        {

            return ExecuteTable(DBConstants.CONST_SP_GET_TICKETS_CLAIMED, oTickets);
        }
        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;
        }
        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;
        }
 public List<TicketExceptions> GetTicketAnomalies(TicketsClaimed oTickets,List<string> lstPositions)
 {
     return DBBuilder.RetrieveTicketAnomalies(oTickets,lstPositions);
 }
        private List<TicketExceptions> LoadTicketAnomalies()
        {
            busTreasury = new TreasuryTransactions();
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  lvTicketAnomalies.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
            {
                prgTicketAnomalies.Value += 75;
            });


            List<TicketExceptions> lstTicketAnomalies = busTreasury.GetTicketAnomalies(oTicketsClaimed, lstPositionstoDisplay);
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
            {
                prgTicketAnomalies.Value += 50;
            });
            return lstTicketAnomalies;
        }
        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;
        }
 public List<TicketExceptions> TicketsUnclaimed(TicketsClaimed oTickets, List<string> lstPositions)
 {
     return DBBuilder.TicketsUnClaimed(oTickets, lstPositions);
 }
 public List<TicketExceptions> TicketsPrinted(TicketsClaimed oTickets, List<string> lstPositionstoDisplay)
 {
     return DBBuilder.TicketsPrinted(oTickets, lstPositionstoDisplay);
 }
        private object[] GetSpParameters(TicketsClaimed oTicketsClaimed)
        {
            try
            {
                SqlParameter[] ObjParams = new SqlParameter[2];
                ObjParams[0] = new SqlParameter(DBConstants.CONST_PARAM_STARTDATE, oTicketsClaimed.TicketsClaimedFrom);
                ObjParams[1] = new SqlParameter(DBConstants.CONST_PARAM_ENDDATE, oTicketsClaimed.TicketsClaimedTo);

                return ObjParams;
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return null;

            }
        }
        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;
        }
예제 #17
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> LoadCashDeskDetails()
        {
            string szErrDesc = string.Empty;
            double cTicketClaimedTotalCashdesk = 0, cTicketPrintedTotalCashdesk = 0, cTicketPrintedTotalEGM = 0,
                cTicketClaimedTotalEGM = 0, cTicketsUnclaimed = 0, cTicketInExceptions = 0, cTicketOutExceptions = 0;
            double currEGM = 0, currCashdesk = 0, cTicketsVoid = 0, cTicketsExpired = 0, cTicketCancelled = 0;

            double cRefundTotal = 0, cRefillTotal = 0, cShortpayTotal = 0, cHandPayTotal = 0, cCashDeskFloatTotal = 0,
                cProgressiveTotal = 0, cJackpotTotal = 0;

            double RefillQty = 0, RefundQty = 0, ShortpayQty = 0, HandpayQty = 0, CashDeskFloatQty = 0,
                ProgressiveQty = 0, JackpotQty = 0, CashDeskClaimedQty = 0, MachineClaimedQty = 0, CashDeskPrintedQty = 0, MachinePrintedQty = 0;


            busTreasury = new TreasuryTransactions();
            RouteNumber = "0";


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

            if (string.IsNullOrEmpty(StartDate) || string.IsNullOrEmpty(EndDate))
            {
                
                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                  {
                      BMC.Presentation.CashDeskManager.MessageBox.showBox("Not a valid Date Range");
                      //prgViewAll.Value = 0;
                  });
                return null;
            }

            if (!Business.CashDeskManager.Common.isValidDateRange((StartDate + " " + StartTime), (EndDate + " " + EndTime)))
            {
                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                {
                    BMC.Presentation.CashDeskManager.MessageBox.showBox("Not a valid Date Range");
                   // prgViewAll.Value = 0;
                });
                return null;
            }

            TicketsClaimed oTicketsClaimed = new TicketsClaimed();
            oTicketsClaimed.TicketsClaimedTo = EndDate + " " + EndTime;
            oTicketsClaimed.TicketsClaimedFrom = StartDate + " " + StartTime;

            szErrDesc = "pre tickets claimed";
            List<TicketExceptions> lstTicketsClaimed = busTreasury.TicketsClaimed(oTicketsClaimed, lstPositionstoDisplay);
            if (lstTicketsClaimed != null)
            {
                foreach (TicketExceptions exep in lstTicketsClaimed)
                {
                    cTicketClaimedTotalCashdesk += (float)exep.Value;
                }
            }
            else
            {
                lstTicketsClaimed = new List<TicketExceptions>();
            }


            szErrDesc = "pre tickets printed";
            List<TicketExceptions> lstTicketsPrinted = busTreasury.TicketsPrinted(oTicketsClaimed, lstPositionstoDisplay);
            if (lstTicketsPrinted != null)
            {
                foreach (TicketExceptions exep in lstTicketsPrinted)
                {
                    cTicketPrintedTotalEGM += (float)exep.Value;
                }
                foreach (TicketExceptions item in lstTicketsPrinted)
                {
                    lstTicketsClaimed.Add(item);
                }
            }
            

            szErrDesc = "pre TiTo claimed";

            Tickets oTickets = new Tickets();
            oTickets.EndDate = EndDate + " " + EndTime;
            oTickets.StartDate = StartDate + " " + StartTime;
            oTickets.IsLiability = false;
            oTickets.BarCode = "%";
            oTickets.Type = "C";
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
               {
                   oTickets.IsClaimedInCashDesk = (bool)chkCashDeskTicketIn.IsChecked;
                   oTickets.IsClaimedInMachine = (bool)chkTicketIn.IsChecked;
                   prgViewAll.Value += 20;

               }
              
           );
           
           
                List<TicketExceptions> lstTitoClaimed = busTreasury.TitoTicketsClaimed(oTickets, lstPositionstoDisplay);

                if (lstTitoClaimed != null)
                {
                    foreach (TicketExceptions exep in lstTitoClaimed)
                    {
                        currEGM += exep.currEGM;
                        currCashdesk += exep.CurrentCashDesk;
                        CashDeskClaimedQty += exep.CashDeskClaimedQty;
                        MachineClaimedQty += exep.MachineClaimedQty;
                    }
                    System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                      {
                          if ((bool)chkCashDeskTicketIn.IsChecked && (bool)chkTicketIn.IsChecked)
                          {
                              foreach (TicketExceptions item in lstTitoClaimed)
                              {
                                  lstTicketsClaimed.Add(item);
                              }
                          }
                          prgViewAll.Value += 20;
                      });
                    cTicketClaimedTotalCashdesk = cTicketClaimedTotalCashdesk + currCashdesk;
                    cTicketClaimedTotalEGM = cTicketClaimedTotalEGM + currEGM;
                }
           

            oTickets.Type = "U";
            List<TicketExceptions> lstTicketsUnclaimed = busTreasury.TitoTicketsUnclaimed(oTickets, lstPositionstoDisplay);
            if (lstTicketsUnclaimed != null)
            {
                foreach (TicketExceptions exep in lstTicketsUnclaimed)
                {
                    cTicketsUnclaimed += (float)exep.Value;
                    lstTicketsClaimed.Add(exep);
                }
            }

            oTickets.Type = "E";
            List<TicketExceptions> lstTicketInExceptions = busTreasury.TITOTicketInExceptions(oTickets, lstPositionstoDisplay);
            if (lstTicketInExceptions != null)
            {
                foreach (TicketExceptions exep in lstTicketInExceptions)
                {
                    cTicketInExceptions += (double)exep.currValue;
                    lstTicketsClaimed.Add(exep);
                }
            }

            oTickets.Type = "E";
            List<TicketExceptions> lstTicketOutExceptions = busTreasury.TitoTicketOutExceptions(oTickets, lstPositionstoDisplay);
            if (lstTicketOutExceptions != null)
            {
                foreach (TicketExceptions exep in lstTicketOutExceptions)
                {
                    cTicketOutExceptions += (float)exep.cTicketTotal;
                   // lstTicketsClaimed.Add(exep);
                }
            }

            //cTicketOutExceptions = lstTicketOutExceptions[0].cTicketTotal;

            oTickets.Type = "V";
            List<TicketExceptions> lstTicketsVoid = busTreasury.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay);
            if (lstTicketsVoid != null)
            {
                foreach (TicketExceptions exep in lstTicketsVoid)
                {
                    lstTicketsClaimed.Add(exep);
                    cTicketsVoid += (float)exep.cTicketTotal;
                }
            }
            //cTicketsVoid = lstTicketsVoid[0].cTicketTotal;

            oTickets.Type = "D";
            List<TicketExceptions> lstTicketsExpired = busTreasury.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay);
            if (lstTicketsExpired != null)
            {
                foreach (TicketExceptions exep in lstTicketsExpired)
                {
                    lstTicketsClaimed.Add(exep);
                    cTicketsExpired += (float)exep.currValue;
                }
            }


            oTickets.Type = "B";
            List<TicketExceptions> lstTicketsCancelled = busTreasury.GetTicket_VoidnExpired(oTickets, lstPositionstoDisplay);
            if (lstTicketsCancelled != null)
            {
                foreach (TicketExceptions exep in lstTicketsCancelled)
                {
                    lstTicketsClaimed.Add(exep);
                    cTicketCancelled += (float)exep.cTicketTotal;
                }
            }



            oTickets.Type = "P";
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
               {

                   oTickets.IsPrintedInCashDesk = (bool)chkCashDeskTicketOut.IsChecked;
                   oTickets.IsPrintedInMachine = (bool)chkTicketOut.IsChecked;
                   prgViewAll.Value += 20;
               });
            
                List<TicketExceptions> lstTitoTicketsPrinted = busTreasury.TitoTicketsPrinted(oTickets, lstPositionstoDisplay);
                if (lstTitoTicketsPrinted != null)
                {
                    foreach (TicketExceptions exep in lstTitoTicketsPrinted)
                    {
                        System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                          {
                              if ((bool)chkCashDeskTicketOut.IsChecked && (bool)chkTicketOut.IsChecked)
                              {
                                  lstTicketsClaimed.Add(exep);
                              }
                          });

                       
                        CashDeskPrintedQty += exep.CashDeskPrintedQty;
                        MachinePrintedQty += exep.MachinePrintedQty;
                    }
                    if (lstTitoTicketsPrinted != null && lstTitoTicketsPrinted.Count > 0)
                    {
                        currEGM = lstTitoTicketsPrinted[0].currEGM;
                        currCashdesk = lstTitoTicketsPrinted[0].CurrentCashDesk;
                        cTicketPrintedTotalCashdesk += currCashdesk;
                        cTicketPrintedTotalEGM += currEGM;
                    }
                }
            

            szErrDesc = "pre refunds";
            oTickets.Type = TREASURY_REFUND;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  oTickets.IsLiability = (bool)chkRefunds.IsChecked;
                  prgViewAll.Value += 20;
              });
            List<TicketExceptions> RefundItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay);
            if (RefundItems != null)
            {
                foreach (TicketExceptions item in RefundItems)
                {
                    lstTicketsClaimed.Add(item);
                    cRefundTotal += item.TreasuryAmount;
                    RefundQty += item.HandpayQty;
                }
            }

            szErrDesc = "pre refill";
            oTickets.Type = TREASURY_REFILL;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  oTickets.IsLiability = (bool)chkRefills.IsChecked;
              });
            List<TicketExceptions> RefillItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay);
            if (RefillItems != null)
            {
                foreach (TicketExceptions item in RefillItems)
                {
                    lstTicketsClaimed.Add(item);
                    cRefillTotal += item.TreasuryAmount;
                    RefillQty += item.HandpayQty;
                }
            }

            szErrDesc = "pre shortpay";
            oTickets.Type = TREASURY_SHORTPAY;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  oTickets.IsLiability = (bool)chkShortPays.IsChecked;
              });
            List<TicketExceptions> ShortpayItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay);
            if (ShortpayItems != null)
            {
                foreach (TicketExceptions item in ShortpayItems)
                {
                    lstTicketsClaimed.Add(item);
                    cShortpayTotal += item.TreasuryAmount;
                    ShortpayQty += item.HandpayQty;
                }
            }

            szErrDesc = "Handpays";
            oTickets.Type = TREASURY_HANDPAY_CREDIT;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  oTickets.IsLiability = (bool)chkHandpays.IsChecked;
                  prgViewAll.Value += 20;
              });
            List<TicketExceptions> Handpays = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay);
            if (Handpays != null)
            {
                foreach (TicketExceptions item in Handpays)
                {
                    lstTicketsClaimed.Add(item);
                    cHandPayTotal += Convert.ToDouble(item.Amount);
                    HandpayQty += item.HandpayQty;
                }
            }

            szErrDesc = "pre cash desk float";
            oTickets.Type = TREASURY_CASH_DESK_FLOAT;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  oTickets.IsLiability = (bool)chkCashDeskFloat.IsChecked;
              });
            List<TicketExceptions> CashDeskFloatItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay);
            if (CashDeskFloatItems != null)
            {
                foreach (TicketExceptions item in CashDeskFloatItems)
                {
                    lstTicketsClaimed.Add(item);
                    cCashDeskFloatTotal += item.TreasuryAmount;
                    CashDeskFloatQty += item.HandpayQty;
                }
            }

            szErrDesc = "Progressive";
            oTickets.Type = TREASURY_PROGRESSIVE;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  oTickets.IsLiability = (bool)chkProghandpays.IsChecked;
              });
            List<TicketExceptions> ProgItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay);
            if (ProgItems != null)
            {
                foreach (TicketExceptions item in ProgItems)
                {
                    lstTicketsClaimed.Add(item);
                    cProgressiveTotal += item.TreasuryAmount;
                    ProgressiveQty += item.HandpayQty;
                }
            }

            szErrDesc = "Jackpot";
            oTickets.Type = TREASURY_JACKPOT;
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
              {
                  oTickets.IsLiability = (bool)chkjackpot.IsChecked;
              });
            List<TicketExceptions> JackPotItems = busTreasury.GetTreasuryItems(oTickets, lstPositionstoDisplay);
            if (JackPotItems != null)
            {
                foreach (TicketExceptions item in JackPotItems)
                {
                    lstTicketsClaimed.Add(item);
                    cJackpotTotal += item.TreasuryAmount;
                    JackpotQty += item.HandpayQty;
                }
            }

                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                  {
                      prgViewAll.Value += 20;
                      txtCashDeskTicketInVal.Text = cTicketClaimedTotalCashdesk.ToString(MYFORMAT);
                      txtMachineTicketInVal.Text = cTicketClaimedTotalEGM.ToString(MYFORMAT);
                      txtMachineTicketOutVal.Text = cTicketPrintedTotalEGM.ToString(MYFORMAT);
                      txtCashDeskTicketOutVal.Text = cTicketPrintedTotalCashdesk.ToString(MYFORMAT);
                      txtLiabilityVal.Text = ((cTicketPrintedTotalEGM + cTicketPrintedTotalCashdesk) -
                          (cTicketClaimedTotalEGM + cTicketClaimedTotalCashdesk)).ToString(MYFORMAT);

                      txtExcepVal.Text = cTicketInExceptions.ToString(MYFORMAT) + "/" + cTicketOutExceptions.ToString(MYFORMAT);
                      txtActiveVal.Text = cTicketsUnclaimed.ToString(MYFORMAT);
                      txtVoidval.Text = cTicketsVoid.ToString(MYFORMAT) + "/" + cTicketCancelled.ToString(MYFORMAT);
                      txtExpiredVal.Text = cTicketsExpired.ToString(MYFORMAT);

                      txtRefundVal.Text = cRefundTotal.ToString(MYFORMAT);
                      txtFillsVal.Text = cRefillTotal.ToString(MYFORMAT);
                      txtCashDeskShortPaysVal.Text = cShortpayTotal.ToString(MYFORMAT);
                      txtHandpayVal.Text = cHandPayTotal.ToString(MYFORMAT);
                      txtCashDeskFloatVal.Text = cCashDeskFloatTotal.ToString(MYFORMAT);
                      txtProgHandpayVal.Text = cProgressiveTotal.ToString(MYFORMAT);
                      txtJackpotVal.Text = cJackpotTotal.ToString(MYFORMAT);
                  });
                  double promoTotal = 0;
                  List<TicketExceptions> lstPromo = busTreasury.GetPromoCashableTickets(oTicketsClaimed, lstPositionstoDisplay);
                  if (lstPromo != null)
                  {
                      foreach (TicketExceptions item in lstPromo)
                      {
                          promoTotal += item.Value;
                      }
                  }
                  System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart)delegate
                  {
                      txtPromoCashableVal.Text = promoTotal.ToString(MYFORMAT);

                      txtHandpayQty.Text = HandpayQty.ToString();
                      txtProgHandpayQty.Text = ProgressiveQty.ToString();
                      txtJackPotQty.Text = JackpotQty.ToString();
                      txtRefundQty.Text = RefundQty.ToString();
                      txtFillsQty.Text = RefillQty.ToString();
                      txtCashDeskShortPayQty.Text = ShortpayQty.ToString();
                      txtCashDeskFloatQty.Text = CashDeskFloatQty.ToString();
                      txtCashDeskTicketInQty.Text = CashDeskClaimedQty.ToString();
                      txtMachineTicketInQty.Text = MachineClaimedQty.ToString();
                      txtCashDeskTicketOutQty.Text = CashDeskPrintedQty.ToString();
                      txtMachineTicketOutQty.Text = MachinePrintedQty.ToString();
                  });
            HandpayQty = 0;
            ProgressiveQty = 0;
            JackpotQty = 0;
            RefundQty = 0;
            RefillQty = 0;
            ShortpayQty = 0;
            CashDeskFloatQty = 0;
            CashDeskClaimedQty = 0;
            CashDeskPrintedQty = 0;
            MachineClaimedQty = 0;
            MachinePrintedQty = 0;

            return lstTicketsClaimed;
        }
예제 #19
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;
        }
        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;
        }
예제 #21
0
 private static DataTable ExecuteTable(string ProcedureName, TicketsClaimed oTickets)
 {
     return SqlHelper.ExecuteDataset(GetExchangeConnectionString(), ProcedureName, GetSpParameters(oTickets)).Tables[0];
 }
 private  DataTable GetTicketsPrinted(TicketsClaimed oTickets)
 {
     return ExecuteTable(DBConstants.CONST_SP_GET_TICKETS_PRINTED, oTickets);
 }
예제 #23
0
 private static SqlDataReader ExecuteReader(string StoredProcedure, TicketsClaimed oTickets)
 {
     return SqlHelper.ExecuteReader(SQLConnection(), StoredProcedure, CommandType.StoredProcedure, GetSpParameters(oTickets));
 }
 private  DataTable ExecuteTable(string ProcedureName, TicketsClaimed oTickets)
 {
     try
     {
         return SqlHelper.ExecuteDataset(SQLConnection(), ProcedureName, GetSpParameters(oTickets)).Tables[0];
     }
     catch (Exception ex)
     {
         ExceptionManager.Publish(ex);
         return null;
        
     }
 }
예제 #25
0
        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 DataTable ExecuteTable(TicketsClaimed oTickets)
        {
            try
            {
                return SqlHelper.ExecuteDataset(GetTicketingConnectionString(), DBConstants.CONST_SP_RSP_GETPROMOTICKETFORPERIODDETAILS, GetSpParameters(oTickets)).Tables[0];
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return null;

            }
        }
        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;
        }
        private SqlDataReader ExecuteReader(string StoredProcedure, TicketsClaimed oTickets)
        {
            try
            {
                return SqlHelper.ExecuteReader(SQLConnection(), StoredProcedure, CommandType.StoredProcedure, GetSpParameters(oTickets));
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                return null;

            }
        }
        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;
        }