private void ClearTicketStatus()
        {
            string sTicket   = string.Empty;
            string sDeviceID = string.Empty;

            TicketExceptions item = (TicketExceptions)lvExceptions.SelectedItem;

            sTicket   = item.Ticket;
            sDeviceID = item.DeviceID;

            DialogResult dr = MessageBox.ShowBox("MessageID132",
                                                 BMC_Icon.Information, BMC_Button.YesNo, sTicket);

            if (dr.ToString() == "Yes")
            {
                Dictionary <string, bool> dResult = objCashDeskManager.ActivateSDGTicket(sTicket, sDeviceID, false);

                foreach (KeyValuePair <string, bool> KeyValue in dResult)
                {
                    if ((bool)KeyValue.Value)
                    {
                        List <TicketExceptions> result = LoadExceptions();
                        lvExceptions.ItemsSource = result;
                    }
                    else
                    {
                        MessageBox.ShowBox(KeyValue.Key, BMC_Icon.Information, BMC_Button.OK);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public List <TicketExceptions> GetTicket_VoidnExpired(Tickets oTickets, List <string> lstPositions)
        {
            string strTicketInException        = string.Empty;
            List <TicketExceptions> lstTickets = null;
            TicketExceptions        excep      = null;


            try
            {
                DataTable dtTickets = cashdeskmanagerDataAccess.GetTickets(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 = "Voucher";
                            excep.Zone            = "n/a";

                            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.Asset = row["Asset"].ToString();

                            //  excep.PrintDate = 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["dtExpire"]).ToString("dd MMM yyyy HH:mm:ss").ReadDateTimeWithSeconds().ToString();
                            excep.Value   = Convert.ToDouble(row["iAmount"]) / 100;
                            //excep.Amount = (Convert.ToDouble().ToString("###0.#0") +")";
                            excep.Amount = CurrencySymbol + " " + (Convert.ToDecimal(row["iAmount"]) / 100).GetUniversalCurrencyFormat();

                            excep.Status = (row["StrVoucherStatus"].ToString().Trim().ToUpper() == "NA" ? "Auto Cancelled" :
                                            row["StrVoucherStatus"].ToString().Trim().ToUpper() == "VD" ? "Void" : row["StrVoucherStatus"].ToString().Trim().ToUpper() == "EXP" ? "Expired" : "Expired");
                            excep.cExceptionsTotal += excep.currValue;
                        }

                        lstTickets.Add(excep);
                    }
                }
            }

            catch (Exception ex)
            {
                LogManager.WriteLog(ex.Message, LogManager.enumLogLevel.Info);
                ExceptionManager.Publish(ex);
            }
            return(lstTickets);
        }
Ejemplo n.º 3
0
        public List <TicketExceptions> GetTicket_VoidnExpired(Tickets oTickets, List <string> lstPositions)
        {
            string strTicketInException        = 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.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 = "TITO";
                            excep.Zone            = "n/a";

                            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"].ToString() == "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);
        }
        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);
        }
        private List <TicketExceptions> LoadVoidExpiredTickets()
        {
            objCashDeskManager = CashDeskManagerBusinessObject.CreateInstance();

            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
            {
                lvVoidExpired.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        = "D";
            oTickets.UserNo      = UserNo;

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

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


            decimal          ExceptionTotal = 0;
            TicketExceptions Total          = new TicketExceptions();

            Total.PrintDate = "Total";

            if (lstVoidExpired != null)
            {
                foreach (TicketExceptions exep in lstVoidExpired)
                {
                    ExceptionTotal += (decimal)exep.Value;
                }

                Total.Value  = (double)Decimal.Round(ExceptionTotal, 2);
                Total.Amount = CurrencySymbol + "" + Convert.ToDecimal(ExceptionTotal).GetUniversalCurrencyFormat();
                lstVoidExpired.Insert(0, Total);
                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
                {
                    prgVoidExpiredState.Value += 50;
                });
            }

            return(lstVoidExpired);
        }
 private void lvExceptions_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (lvExceptions.Items.Count > 0)
     {
         TicketExceptions item = (TicketExceptions)lvExceptions.SelectedItem;
         if (item.Type == "IN")
         {
             btnActivate.Visibility = Visibility.Visible;
         }
         else
         {
             btnActivate.Visibility = Visibility.Hidden;
         }
     }
 }
Ejemplo n.º 7
0
        private List <TicketExceptions> LoadVoidExpiredTickets()
        {
            busTreasury = new TreasuryTransactions();
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
            {
                lvVoidExpired.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        = "D";
            System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
            {
                prgVoidExpiredState.Value += 75;
            });

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


            decimal          ExceptionTotal = 0;
            TicketExceptions Total          = new TicketExceptions();

            Total.PrintDate = "Total";

            if (lstVoidExpired != null)
            {
                foreach (TicketExceptions exep in lstVoidExpired)
                {
                    ExceptionTotal += (decimal)exep.Value;
                }

                Total.Value = (double)Decimal.Round(ExceptionTotal, 2);
                lstVoidExpired.Insert(0, Total);
                System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, (ThreadStart) delegate
                {
                    prgVoidExpiredState.Value += 50;
                });
            }

            return(lstVoidExpired);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
        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);
        }
Ejemplo n.º 13
0
        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);
        }
        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()
        {
            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);
        }
Ejemplo n.º 16
0
        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);
        }