Exemple #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            bool isValid = false;
            RTOnlineTicketDetail objTicketDetail = null;

            double redeemTicketAmount = 0;

            bool IsCashDispenseError = false;

            try
            {
                if (isScannerFired) //check done not to fire the verify event twice while verifying a ticket using scanner
                {
                    isScannerFired = false;
                    return;
                }
                ClearAll(true);
                TextBlock_11.Text   = string.Empty;
                txtAmount.Text      = string.Empty;
                btnVerify.IsEnabled = false;
                if ((sender is System.Windows.Controls.TextBox))
                {
                    isScannerFired = true;
                }
                else
                {
                    isScannerFired = false;
                }

                if (this.ucValueCalc.txtDisplay.Text.Trim().Length > 0)
                {
                    if (this.ucValueCalc.txtDisplay.Text.Trim().Length < 4)
                    {
                        MessageBox.ShowBox("MessageID403", BMC_Icon.Error);
                        this.txtStatus.Visibility        = Visibility.Hidden;
                        this.ucValueCalc.txtDisplay.Text = String.Empty;
                        return;
                    }

                    IRedeemOnlineTicket objCashDeskOper = RedeemOnlineTicketBusinessObject.CreateInstance();
                    objTicketDetail = new RTOnlineTicketDetail();

                    objTicketDetail.ClientSiteCode  = Settings.SiteCode;
                    objTicketDetail.TicketString    = this.ucValueCalc.txtDisplay.Text.Trim();
                    objTicketDetail.HostSiteCode    = objTicketDetail.TicketString.Substring(0, 4);
                    objTicketDetail.RedeemedMachine = System.Environment.MachineName;

                    objTicketDetail = objCashDeskOper.GetRedeemTicketAmount(objTicketDetail);

                    if (objTicketDetail.TicketStatusCode == -990) //TIS Error (If any)
                    {
                        MessageBox.ShowBox(objTicketDetail.TicketErrorMessage, BMC_Icon.Error, true);
                        disptimerRedeem.Stop();
                        this.txtStatus.Visibility = Visibility.Hidden;
                        return;
                    }

                    if (objTicketDetail.TicketStatusCode == -234) //Exception Occured
                    {
                        MessageBox.ShowBox("MessageID425", BMC_Icon.Error);
                        disptimerRedeem.Stop();
                        this.txtStatus.Visibility = Visibility.Hidden;
                        return;
                    }

                    if (objTicketDetail.TicketStatusCode == -99) //Included for Cross Ticketing
                    {
                        MessageBox.ShowBox("MessageID403", BMC_Icon.Error);
                        disptimerRedeem.Stop();
                        this.txtStatus.Visibility        = Visibility.Hidden;
                        this.ucValueCalc.txtDisplay.Text = String.Empty;
                        return;
                    }



                    if (objTicketDetail.TicketStatusCode == 250)     //Any/specific player card required for TIS
                    {
                        bool ValidCard       = false;
                        int  PlayerCardClose = 0;



                        if (objTicketDetail.CardRequired == 2)
                        {
                            PlayerCardValidation objPlayerCardValidation = new PlayerCardValidation(objTicketDetail.CardRequired);
                            objPlayerCardValidation.ShowDialogEx(this);
                            ValidCard       = objPlayerCardValidation.valid;
                            PlayerCardClose = objPlayerCardValidation.Close;

                            if (PlayerCardClose == 1)
                            {
                                this.ucValueCalc.txtDisplay.Text = String.Empty;
                                this.ucValueCalc.txtDisplay.Focus();
                                return;
                            }

                            else if (!ValidCard)
                            {
                                MessageBox.ShowBox("PlayerCardRedeem6", BMC_Icon.Error);
                                this.ucValueCalc.txtDisplay.Text = String.Empty;
                                this.ucValueCalc.txtDisplay.Focus();
                                return;
                            }
                        }
                        else if (objTicketDetail.CardRequired == 1)
                        {
                            PlayerCardValidation objPlayerCardValidation = new PlayerCardValidation(objTicketDetail.CardRequired, objTicketDetail.PlayerCardNumber);
                            objPlayerCardValidation.ShowDialogEx(this);
                            ValidCard       = objPlayerCardValidation.valid;
                            PlayerCardClose = objPlayerCardValidation.Close;
                            if (PlayerCardClose == 1)
                            {
                                this.ucValueCalc.txtDisplay.Text = String.Empty;
                                this.ucValueCalc.txtDisplay.Focus();
                                return;
                            }
                            else if (!ValidCard)
                            {
                                MessageBox.ShowBox("PlayerCardRedeem6", BMC_Icon.Error);
                                this.ucValueCalc.txtDisplay.Text = String.Empty;
                                this.ucValueCalc.txtDisplay.Focus();
                                return;
                            }
                        }

                        objTicketDetail.TicketStatusCode = 0;
                    }


                    int ticketAmount = Convert.ToInt32(objTicketDetail.RedeemedAmount);

                    redeemTicketAmount = ticketAmount / 100;

                    objTicketDetail.CustomerId = Custid;

                    this.txtStatus.Visibility = Visibility.Visible;
                    this.txtStatus.Text       = "VALIDATING.";
                    disptimerRedeem.IsEnabled = true;
                    disptimerRedeem.Start();


                    //if ((objCashDeskOper.CheckSDGTicket(objTicketDetail.TicketString) == 0) && (Settings.RedeemConfirm))
                    if (objTicketDetail.TicketStatusCode == 0 && (Settings.RedeemConfirm))
                    {
                        disptimerRedeem.Stop();
                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                        {
                            _diagResult = MessageBox.ShowBox("MessageID225", BMC_Icon.Question, BMC_Button.YesNo);
                        }
                        else
                        {
                            _diagResult = System.Windows.Forms.DialogResult.Yes;
                        }
                        if (_diagResult == System.Windows.Forms.DialogResult.Yes)
                        {
                            #region ITALY CODE COMMENTED
                            //if (Settings.RegulatoryEnabled == true && Settings.RegulatoryType == "AAMS")
                            //{
                            //    ProcessCancelled = false;
                            //    if (ticketStatus == 0)
                            //    {
                            //        if (redeemTicketAmount >= Settings.RedeemTicketCustomer_Min && redeemTicketAmount <= Settings.RedeemTicketCustomer_Max)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails();
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }
                            //        else if (redeemTicketAmount >= Settings.RedeemTicketCustomer_BankAcctNo)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(true);
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }

                            //        if (ProcessCancelled)
                            //        {
                            //            MessageBox.ShowBox("MessageID299", BMC_Icon.Information);
                            //            this.ucValueCalc.txtDisplay.Text = string.Empty;
                            //            return;
                            //        }
                            //    }
                            //}
                            #endregion

                            objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail);
                            isValid         = objTicketDetail.ValidTicket;
                        }
                        else
                        {
                            disptimerRedeem.Start();
                            this.txtStatus.Visibility = Visibility.Hidden;
                            return;
                        }
                        disptimerRedeem.Start();
                    }
                    //else if ((objCashDeskOper.CheckSDGTicket(objTicketDetail.TicketString) == -3) && (Settings.RedeemConfirm)
                    else if (objTicketDetail.TicketStatusCode == -3 && (Settings.RedeemConfirm) && Settings.RedeemExpiredTicket)
                    {
                        disptimerRedeem.Stop();

                        CAuthorize objAuthorize = null;
                        //Manoj 26th Aug 2010. CR383384
                        //RedeemExpiredTicket functionality has been implmented for Winchells.
                        //So, in settings RedeemExpiredTicket will be True for Winchells, for rest it will be False.
                        //So we dont need the following if condition.
                        //if (Settings.Client != null && Settings.Client.ToLower() == "winchells")
                        //{
                        objAuthorize      = new CAuthorize("CashdeskOperator.Authorize.cs.ReedemExpiredTicket");
                        objAuthorize.User = Security.SecurityHelper.CurrentUser;
                        string Cur_User_Name = Security.SecurityHelper.CurrentUser.Last_Name + ", " + Security.SecurityHelper.CurrentUser.First_Name;
                        objTicketDetail.RedeemedUser = Cur_User_Name;

                        if (!Security.SecurityHelper.HasAccess("CashdeskOperator.Authorize.cs.ReedemExpiredTicket"))
                        {
                            objAuthorize.ShowDialogEx(this);

                            string Auth_User_Name = objAuthorize.User.UserName;
                            if (objAuthorize.User.Last_Name != null && objAuthorize.User.First_Name != null)
                            {
                                Auth_User_Name = objAuthorize.User.Last_Name + ", " + objAuthorize.User.First_Name;
                            }
                            else
                            {
                                Auth_User_Name = objAuthorize.User.UserName;
                            }

                            objTicketDetail.RedeemedUser = Auth_User_Name;

                            if (!objAuthorize.IsAuthorized)
                            {
                                ClearAll(false);
                                return;
                            }
                        }
                        else
                        {
                            objAuthorize.IsAuthorized = true;
                        }
                        //}

                        if (objAuthorize != null && objAuthorize.IsAuthorized)
                        {
                            objTicketDetail.AuthorizedUser_No = objAuthorize.User.SecurityUserID;
                            objTicketDetail.Authorized_Date   = DateTime.Now;

                            AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                            {
                                AuditModuleName    = ModuleName.Voucher,
                                Audit_Screen_Name  = "Vouchers|RedeemVoucher",
                                Audit_Desc         = "Voucher Number-" + objTicketDetail.TicketString,
                                AuditOperationType = OperationType.MODIFY,
                                Audit_Field        = "AuthorizedUser_No",
                                Audit_New_Vl       = Security.SecurityHelper.CurrentUser.SecurityUserID.ToString()
                            });
                        }
                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                        {
                            _diagResult = MessageBox.ShowBox("MessageID225", BMC_Icon.Question, BMC_Button.YesNo);
                        }
                        else
                        {
                            _diagResult = System.Windows.Forms.DialogResult.Yes;
                        }
                        if (_diagResult == System.Windows.Forms.DialogResult.Yes)
                        {
                            #region ITALY CODE COMMENTED
                            //if (Settings.RegulatoryEnabled == true && Settings.RegulatoryType == "AAMS")
                            //{
                            //    ProcessCancelled = false;
                            //    if (ticketStatus == 0)
                            //    {
                            //        if (redeemTicketAmount >= Settings.RedeemTicketCustomer_Min && redeemTicketAmount <= Settings.RedeemTicketCustomer_Max)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails();
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }
                            //        else if (redeemTicketAmount >= Settings.RedeemTicketCustomer_BankAcctNo)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(true);
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }

                            //        if (ProcessCancelled)
                            //        {
                            //            MessageBox.ShowBox("MessageID299", BMC_Icon.Information);
                            //            this.ucValueCalc.txtDisplay.Text = string.Empty;
                            //            return;
                            //        }
                            //    }
                            //}

                            #endregion
                            objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail);
                            isValid         = objTicketDetail.ValidTicket;
                        }
                        else
                        {
                            disptimerRedeem.Start();
                            this.txtStatus.Visibility = Visibility.Hidden;
                            return;
                        }
                        disptimerRedeem.Start();
                    }
                    else
                    {
                        objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail);
                        isValid         = objTicketDetail.ValidTicket;
                    }

                    if (objTicketDetail.TicketStatus == "MessageID210")
                    {
                        objTicketDetail.TicketStatus = Application.Current.FindResource(objTicketDetail.TicketStatus).ToString() +
                                                       "(" + CommonUtilities.GetCurrency(Convert.ToDouble(objTicketDetail.TicketValue / 100)) + ")";
                    }
                    else
                    {
                        objTicketDetail.TicketStatus = Application.Current.FindResource(objTicketDetail.TicketStatus).ToString();
                    }

                    IsCashDispenseError = true;
                    if (isValid && objTicketDetail.RedeemedMachine != null && objTicketDetail.RedeemedMachine != string.Empty)
                    {
                        try
                        {
                            //DateTime PrintDate;
                            //string strbar_pos = objCashDeskOper.GetTicketPrintDevice(objTicketDetail.TicketString, out PrintDate);
                            DateTime PrintDate  = DateTime.Now;
                            string   strbar_pos = objCashDeskOper.GetTicketPrintDevice(objTicketDetail.TicketString, out PrintDate);
                            //TextBlock_11.Text = "#" + strbar_pos + PrintDate.ToString().Replace("/", "").Replace(":", "").Replace("AM", "0").Replace("PM", "1").Replace(" ", "");
                            //TextBlock_11.Text = "#" + objTicketDetail.PrintedDevice + objTicketDetail.PrintedDate.ToString().Replace("/", "").Replace(":", "").Replace("AM", "0").Replace("PM", "1").Replace(" ", "");
                            if (objTicketDetail.RedeemedDate == null || objTicketDetail.RedeemedDate.ToString().Trim().Equals(string.Empty))
                            {
                                TextBlock_11.Text = string.Empty;
                            }
                            else
                            {
                                TextBlock_11.Text = "#" + strbar_pos + objTicketDetail.RedeemedDate.ToString("ddMMyyyyHHmmss");
                            }

                            txtAmount.Text = objTicketDetail.RedeemedAmount.GetUniversalCurrencyFormat();
                            if (!objTicketDetail.TicketStatus.Trim().ToUpper().Equals("ALREADY CLAIMED"))
                            {
                                #region GCD
                                if (Settings.IsGloryCDEnabled && Settings.CashDispenserEnabled)
                                {
                                    LogManager.WriteLog(string.Format("Process Redeem Voucher: {2} for Bar Postion: {0} - Amount: {1} in cents", strbar_pos, ticketAmount, objTicketDetail.TicketString), LogManager.enumLogLevel.Info);

                                    //implement Cash Dispenser
                                    LogManager.WriteLog(string.Format("Amount: {0:0.00} Sending to Cash Dispenser ", ticketAmount), LogManager.enumLogLevel.Info);
                                    LoadingWindow ld = new LoadingWindow(Window.GetWindow(this), ModuleName.Voucher, TextBlock_11.Text, strbar_pos, ticketAmount);
                                    ld.Topmost = true;
                                    ld.ShowDialogEx(this);
                                    Result res = ld.Result;
                                    if (!res.IsSuccess)
                                    {
                                        IsCashDispenseError = false;
                                        this.txtStatus.Text = res.error.Message;
                                        LogManager.WriteLog(string.Format("Unable to Dispense Cash - Amount: {0}", ticketAmount), LogManager.enumLogLevel.Info);
                                        LogManager.WriteLog("Rollback Redeem Voucher Process", LogManager.enumLogLevel.Info);
                                        AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                                        {
                                            AuditModuleName    = ModuleName.Voucher,
                                            Audit_Screen_Name  = "Vouchers|RedeemVoucher",
                                            Audit_Desc         = "Rollback redeem voucher:" + objTicketDetail.TicketString + " due to cash dispenser error",
                                            AuditOperationType = OperationType.MODIFY,
                                            Audit_Old_Vl       = "iPayDeviceid:" + objTicketDetail.RedeemedDevice + ";dtPaid:" + objTicketDetail.RedeemedDate.GetUniversalDateTimeFormat() + ";Customerid:" + objTicketDetail.CustomerId.ToString()
                                        });
                                        objCashDeskOper.RollbackRedeemTicket(objTicketDetail.TicketString);
                                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                                        {
                                            BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true);
                                        }
                                    }
                                    else
                                    {
                                        LogManager.WriteLog(string.Format("Cash Dispensed Successfully - Amount: {0}", ticketAmount), LogManager.enumLogLevel.Info);

                                        IsCashDispenseError = true;
                                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                                        {
                                            BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true);
                                        }
                                    }
                                }
                                #endregion
                            }
                        }
                        catch (Exception Ex)
                        {
                            LogManager.WriteLog("Error showing Voucher Info :" + Ex.Message, LogManager.enumLogLevel.Error);
                        }
                    }

                    if (objTicketDetail.ShowOfflineTicketScreen)
                    {
                        int result;

                        if (objTicketDetail.HostSiteCode == Settings.SiteCode) // Offline Tickets redemption is valid only for local site code
                        {
                            result = objCashDeskOper.CheckSDGOfflineTicket(objTicketDetail.TicketString);
                        }
                        else
                        {
                            result = -14;
                        }

                        if (result == -14)// Site Code Mismatch
                        {
                            this.txtStatus.Visibility = Visibility.Visible;
                            this.txtStatus.Text       = Application.Current.FindResource("MessageID312") as string;
                            this.txtStatus.Background = System.Windows.Media.Brushes.Red;
                            return;
                        }
                        else
                        {
                            frmRedeemOffline = new BMC.Presentation.POS.Views.CRedeemOfflineTicket();
                            frmRedeemOffline.TicketNumber = ucValueCalc.txtDisplay.Text.Trim();
                            frmRedeemOffline.ShowDialogEx(this);
                            if (frmRedeemOffline.IsSuccessfull)
                            {
                                this.ucValueCalc.txtDisplay.Text = frmRedeemOffline.TicketNumber;
                                button_Click(sender, e);
                            }
                            else
                            {
                                this.ucValueCalc.txtDisplay.Text = string.Empty;
                                this.txtStatus.Clear();
                            }
                        }
                    }
                    else
                    {
                        if (Settings.IsGloryCDEnabled && (!IsCashDispenseError))
                        {
                            disptimerRedeem.Stop();
                            this.txtStatus.Visibility = Visibility.Visible;
                            this.txtStatus.Background = System.Windows.Media.Brushes.Red;
                            TextBlock_11.Text         = string.Empty;
                            txtAmount.Text            = string.Empty;
                            System.Threading.Thread.Sleep(100);
                            //System.Threading.Thread.CurrentThread
                            disptimerRedeem.Start();
                        }
                        else
                        {
                            this.txtStatus.Text = objTicketDetail.TicketStatus;
                            //"(" + CommonUtilities.GetCurrency(Convert.ToDouble(TicketDetail.TicketValue / 100)) + ")";
                            if (Application.Current.FindResource("MessageID219").ToString() == objTicketDetail.TicketStatus)
                            {
                                bisTicketExpired = true;
                            }
                            this.txtWarning.Text = objTicketDetail.TicketWarning;
                            if (!objTicketDetail.ValidTicket)
                            {
                                this.txtStatus.Background = System.Windows.Media.Brushes.Red;

                                AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                                {
                                    AuditModuleName    = ModuleName.Voucher,
                                    Audit_Screen_Name  = "Vouchers|RedeemVoucher",
                                    Audit_Desc         = "Invalid Voucher Redemption Attempt",
                                    AuditOperationType = OperationType.MODIFY,
                                    Audit_Field        = "Voucher Number",
                                    Audit_New_Vl       = objTicketDetail.TicketString
                                });
                            }
                            else
                            {
                                this.txtStatus.Background = System.Windows.Media.Brushes.White;

                                AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                                {
                                    AuditModuleName    = ModuleName.Voucher,
                                    Audit_Screen_Name  = "Vouchers|RedeemVoucher",
                                    Audit_Desc         = "Voucher Number-" + objTicketDetail.TicketString,
                                    AuditOperationType = OperationType.ADD,
                                    Audit_Field        = "Voucher Status",
                                    Audit_New_Vl       = objTicketDetail.TicketStatus
                                });

                                //Cross Ticketing- Insert Local Record
                                if (!string.IsNullOrEmpty(objTicketDetail.VoucherXMLData))
                                {
                                    objTicketDetail.RedeemedUser = Security.SecurityHelper.CurrentUser.UserName;
                                    objCashDeskOper.ImportVoucherDetails(objTicketDetail);
                                }

                                if (objTicketDetail.TicketStatus.Contains(Application.Current.FindResource("MessageID210").ToString()))
                                {
                                    //disptimerRedeem.Stop();

                                    Action act = new Action(() =>
                                    {
                                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                                        {
                                            if (IsCashDispenseError)
                                            {
                                                if (Settings.IsGloryCDEnabled)
                                                {
                                                    disptimerRedeem.Stop();
                                                    this.txtStatus.Visibility = Visibility.Visible;
                                                }
                                                else
                                                {
                                                    this.ClearAll(false);
                                                }
                                                MessageBox.ShowBox("MessageID377", BMC_Icon.Information);
                                            }
                                        }
                                        else
                                        {
                                            this.txtStatus.Text       = Application.Current.FindResource("MessageID377").ToString();
                                            txtAmount.Text            = Convert.ToDecimal(objTicketDetail.TicketValue / 100).GetUniversalCurrencyFormat();
                                            bisTicketExpired          = false;
                                            this.txtStatus.Background = System.Windows.Media.Brushes.GreenYellow;
                                        }
                                        if (!Settings.IsGloryCDEnabled)
                                        {
                                            this.dispenserStatus.LoadItemsAysnc();
                                        }
                                    });

                                    if (!Settings.IsGloryCDEnabled)
                                    {
                                        _worker.Dispense("Voucher Number", objTicketDetail.TicketString, objTicketDetail.RedeemedAmount, act);
                                    }
                                    else
                                    {
                                        act();
                                        disptimerRedeem.Start();
                                    }
                                }
                            }
                            if (objTicketDetail.EnableTickerPrintDetails)
                            {
                                this.gridRedeemedTicket.Visibility = Visibility.Visible;
                                this.txtPrintedMachine.Text        = objTicketDetail.RedeemedMachine;
                                this.txtClaimedDevice.Text         = objTicketDetail.RedeemedDevice;
                                this.txtTickAmount.Text            = objTicketDetail.RedeemedAmount.GetUniversalCurrencyFormatWithSymbol();
                                this.txtClaimedDate.Text           = objTicketDetail.RedeemedDate.GetUniversalDateTimeFormat();
                            }
                            else
                            {
                                this.gridRedeemedTicket.Visibility = Visibility.Hidden;
                            }
                            this.ucValueCalc.txtDisplay.Focus();
                        }
                    }
                }
                else
                {
                    MessageBox.ShowBox("MessageID105", BMC_Icon.Warning);
                    this.ucValueCalc.txtDisplay.Focus();
                }
            }
            catch (Exception ex)
            {
                BMC.Common.ExceptionManagement.ExceptionManager.Publish(ex);
            }
            finally
            {
                btnVerify.IsEnabled = true;
            }
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            bool isValid = false;
            RTOnlineTicketDetail objTicketDetail = null;
           
            double redeemTicketAmount = 0;

            bool IsCashDispenseError = false;
            try
            {

                if (isScannerFired) //check done not to fire the verify event twice while verifying a ticket using scanner
                {
                    isScannerFired = false;
                    return;
                }
                ClearAll(true);
                TextBlock_11.Text = string.Empty;
                txtAmount.Text = string.Empty;               
                btnVerify.IsEnabled = false;
                if ((sender is System.Windows.Controls.TextBox))
                    isScannerFired = true;
                else
                    isScannerFired = false;

                if (this.ucValueCalc.txtDisplay.Text.Trim().Length > 0)
                {
                    if (this.ucValueCalc.txtDisplay.Text.Trim().Length < 4 )
                    {
                        MessageBox.ShowBox("MessageID403", BMC_Icon.Error);
                        this.txtStatus.Visibility = Visibility.Hidden;
                        this.ucValueCalc.txtDisplay.Text = String.Empty;
                        return;
                    }

                    IRedeemOnlineTicket objCashDeskOper = RedeemOnlineTicketBusinessObject.CreateInstance();
                    objTicketDetail = new RTOnlineTicketDetail();

                    objTicketDetail.ClientSiteCode = Settings.SiteCode;
                    objTicketDetail.TicketString = this.ucValueCalc.txtDisplay.Text.Trim();
                    objTicketDetail.HostSiteCode = objTicketDetail.TicketString.Substring(0, 4);
                    objTicketDetail.RedeemedMachine = System.Environment.MachineName;

                    objTicketDetail = objCashDeskOper.GetRedeemTicketAmount(objTicketDetail);

                    if (objTicketDetail.TicketStatusCode == -990) //TIS Error (If any)
                    {
                        MessageBox.ShowBox(objTicketDetail.TicketErrorMessage, BMC_Icon.Error, true);
                        disptimerRedeem.Stop();
                        this.txtStatus.Visibility = Visibility.Hidden;
                        return;
                    }

                    if (objTicketDetail.TicketStatusCode == -234) //Exception Occured
                    {
                        MessageBox.ShowBox("MessageID425", BMC_Icon.Error);
                        disptimerRedeem.Stop();
                        this.txtStatus.Visibility = Visibility.Hidden;
                        return;
                    }

                    if (objTicketDetail.TicketStatusCode == -99) //Included for Cross Ticketing
                    {
                        MessageBox.ShowBox("MessageID403", BMC_Icon.Error);
                        disptimerRedeem.Stop();
                        this.txtStatus.Visibility = Visibility.Hidden;
                        this.ucValueCalc.txtDisplay.Text = String.Empty;
                        return;
                    }

                   
                   
                        if (objTicketDetail.TicketStatusCode == 250) //Any/specific player card required for TIS
                        {
                            bool ValidCard = false;
                            int PlayerCardClose = 0;
                            


                            if (objTicketDetail.CardRequired == 2)
                            {
                                PlayerCardValidation objPlayerCardValidation = new PlayerCardValidation(objTicketDetail.CardRequired);
                                objPlayerCardValidation.ShowDialogEx(this);
                                ValidCard = objPlayerCardValidation.valid;
                                PlayerCardClose = objPlayerCardValidation.Close;

                                if (PlayerCardClose == 1)
                                {
                                    this.ucValueCalc.txtDisplay.Text = String.Empty;
                                    this.ucValueCalc.txtDisplay.Focus();
                                    return;
                                }

                                else if (!ValidCard)
                                {
                                    MessageBox.ShowBox("PlayerCardRedeem6", BMC_Icon.Error);
                                    this.ucValueCalc.txtDisplay.Text = String.Empty;
                                    this.ucValueCalc.txtDisplay.Focus();
                                    return;
                                }

                            }
                            else if (objTicketDetail.CardRequired == 1)
                            {
                                PlayerCardValidation objPlayerCardValidation = new PlayerCardValidation(objTicketDetail.CardRequired, objTicketDetail.PlayerCardNumber);
                                objPlayerCardValidation.ShowDialogEx(this);
                                ValidCard = objPlayerCardValidation.valid;
                                PlayerCardClose = objPlayerCardValidation.Close;
                                if (PlayerCardClose == 1)
                                {
                                    this.ucValueCalc.txtDisplay.Text = String.Empty;
                                    this.ucValueCalc.txtDisplay.Focus();
                                    return;
                                }
                                else if (!ValidCard)
                                {
                                    MessageBox.ShowBox("PlayerCardRedeem6", BMC_Icon.Error);
                                    this.ucValueCalc.txtDisplay.Text = String.Empty;
                                    this.ucValueCalc.txtDisplay.Focus();
                                    return;
                                }
                            }

                            objTicketDetail.TicketStatusCode = 0;
                        }
                    

                    int ticketAmount = Convert.ToInt32(objTicketDetail.RedeemedAmount);

                    redeemTicketAmount = ticketAmount / 100;

                    objTicketDetail.CustomerId = Custid;

                    this.txtStatus.Visibility = Visibility.Visible;
                    this.txtStatus.Text = "VALIDATING.";
                    disptimerRedeem.IsEnabled = true;
                    disptimerRedeem.Start();


                    //if ((objCashDeskOper.CheckSDGTicket(objTicketDetail.TicketString) == 0) && (Settings.RedeemConfirm))
                    if (objTicketDetail.TicketStatusCode == 0 && (Settings.RedeemConfirm))
                    {
                        disptimerRedeem.Stop();
                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                        {
                            _diagResult = MessageBox.ShowBox("MessageID225", BMC_Icon.Question, BMC_Button.YesNo);
                        }
                        else
                        {
                            _diagResult = System.Windows.Forms.DialogResult.Yes;
                        }
                        if (_diagResult == System.Windows.Forms.DialogResult.Yes)
                        {
                            #region ITALY CODE COMMENTED
                            //if (Settings.RegulatoryEnabled == true && Settings.RegulatoryType == "AAMS")
                            //{
                            //    ProcessCancelled = false;
                            //    if (ticketStatus == 0)
                            //    {
                            //        if (redeemTicketAmount >= Settings.RedeemTicketCustomer_Min && redeemTicketAmount <= Settings.RedeemTicketCustomer_Max)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails();
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }
                            //        else if (redeemTicketAmount >= Settings.RedeemTicketCustomer_BankAcctNo)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(true);
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }

                            //        if (ProcessCancelled)
                            //        {
                            //            MessageBox.ShowBox("MessageID299", BMC_Icon.Information);
                            //            this.ucValueCalc.txtDisplay.Text = string.Empty;
                            //            return;
                            //        }
                            //    }
                            //} 
                            #endregion

                            objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail);
                            isValid = objTicketDetail.ValidTicket;
                        }
                        else
                        {
                            disptimerRedeem.Start();
                            this.txtStatus.Visibility = Visibility.Hidden;
                            return;
                        }
                        disptimerRedeem.Start();
                    }
                    //else if ((objCashDeskOper.CheckSDGTicket(objTicketDetail.TicketString) == -3) && (Settings.RedeemConfirm)
                    else if (objTicketDetail.TicketStatusCode == -3 && (Settings.RedeemConfirm) && Settings.RedeemExpiredTicket)
                    {
                        disptimerRedeem.Stop();

                        CAuthorize objAuthorize = null;
                        //Manoj 26th Aug 2010. CR383384
                        //RedeemExpiredTicket functionality has been implmented for Winchells.
                        //So, in settings RedeemExpiredTicket will be True for Winchells, for rest it will be False.
                        //So we dont need the following if condition.
                        //if (Settings.Client != null && Settings.Client.ToLower() == "winchells")
                        //{
                        objAuthorize = new CAuthorize("CashdeskOperator.Authorize.cs.ReedemExpiredTicket");
                        objAuthorize.User = Security.SecurityHelper.CurrentUser;
                        string Cur_User_Name = Security.SecurityHelper.CurrentUser.Last_Name + ", " + Security.SecurityHelper.CurrentUser.First_Name;
                        objTicketDetail.RedeemedUser = Cur_User_Name;
                        
                        if (!Security.SecurityHelper.HasAccess("CashdeskOperator.Authorize.cs.ReedemExpiredTicket"))
                        {
                            objAuthorize.ShowDialogEx(this);
                            
                            string Auth_User_Name = objAuthorize.User.UserName;
                            if (objAuthorize.User.Last_Name != null && objAuthorize.User.First_Name != null)
                            {
                                Auth_User_Name = objAuthorize.User.Last_Name + ", " + objAuthorize.User.First_Name;
                            }
                            else
                            {
                                Auth_User_Name = objAuthorize.User.UserName;
                            }

                            objTicketDetail.RedeemedUser = Auth_User_Name;
                            
                            if (!objAuthorize.IsAuthorized)
                            {
                                ClearAll(false);
                                return;
                            }
                        }
                        else
                        {
                            objAuthorize.IsAuthorized = true;
                        }
                        //}

                        if (objAuthorize != null && objAuthorize.IsAuthorized)
                        {
                            objTicketDetail.AuthorizedUser_No = objAuthorize.User.SecurityUserID;
                            objTicketDetail.Authorized_Date = DateTime.Now;

                            AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                            {

                                AuditModuleName = ModuleName.Voucher,
                                Audit_Screen_Name = "Vouchers|RedeemVoucher",
                                Audit_Desc = "Voucher Number-" + objTicketDetail.TicketString,
                                AuditOperationType = OperationType.MODIFY,
                                Audit_Field = "AuthorizedUser_No",
                                Audit_New_Vl = Security.SecurityHelper.CurrentUser.SecurityUserID.ToString()
                            });

                        }
                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                        {
                            _diagResult = MessageBox.ShowBox("MessageID225", BMC_Icon.Question, BMC_Button.YesNo);
                        }
                        else
                        {
                            _diagResult = System.Windows.Forms.DialogResult.Yes;
                        }
                        if (_diagResult == System.Windows.Forms.DialogResult.Yes)
                        {
                            #region ITALY CODE COMMENTED
                            //if (Settings.RegulatoryEnabled == true && Settings.RegulatoryType == "AAMS")
                            //{
                            //    ProcessCancelled = false;
                            //    if (ticketStatus == 0)
                            //    {
                            //        if (redeemTicketAmount >= Settings.RedeemTicketCustomer_Min && redeemTicketAmount <= Settings.RedeemTicketCustomer_Max)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails();
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }
                            //        else if (redeemTicketAmount >= Settings.RedeemTicketCustomer_BankAcctNo)
                            //        {
                            //            customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(true);
                            //            customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated);
                            //            customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled);
                            //            Owner = Window.GetWindow(this);
                            //            customerDetails.ShowDialog();
                            //        }

                            //        if (ProcessCancelled)
                            //        {
                            //            MessageBox.ShowBox("MessageID299", BMC_Icon.Information);
                            //            this.ucValueCalc.txtDisplay.Text = string.Empty;
                            //            return;
                            //        }
                            //    }
                            //}

                            #endregion
                            objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail);
                            isValid = objTicketDetail.ValidTicket;
                        }
                        else
                        {
                            disptimerRedeem.Start();
                            this.txtStatus.Visibility = Visibility.Hidden;
                            return;
                        }
                        disptimerRedeem.Start();
                    }
                    else
                    {
                        objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail);
                        isValid = objTicketDetail.ValidTicket;
                    }

                    if (objTicketDetail.TicketStatus == "MessageID210")
                        objTicketDetail.TicketStatus = Application.Current.FindResource(objTicketDetail.TicketStatus).ToString() +
                            "(" + CommonUtilities.GetCurrency(Convert.ToDouble(objTicketDetail.TicketValue / 100)) + ")";
                    else
                        objTicketDetail.TicketStatus = Application.Current.FindResource(objTicketDetail.TicketStatus).ToString();

                    IsCashDispenseError = true;
                    if (isValid && objTicketDetail.RedeemedMachine != null && objTicketDetail.RedeemedMachine != string.Empty)
                    {
                        try
                        {
                            //DateTime PrintDate;
                            //string strbar_pos = objCashDeskOper.GetTicketPrintDevice(objTicketDetail.TicketString, out PrintDate);
                            DateTime PrintDate = DateTime.Now;
                            string strbar_pos = objCashDeskOper.GetTicketPrintDevice(objTicketDetail.TicketString, out PrintDate);
                            //TextBlock_11.Text = "#" + strbar_pos + PrintDate.ToString().Replace("/", "").Replace(":", "").Replace("AM", "0").Replace("PM", "1").Replace(" ", "");
                            //TextBlock_11.Text = "#" + objTicketDetail.PrintedDevice + objTicketDetail.PrintedDate.ToString().Replace("/", "").Replace(":", "").Replace("AM", "0").Replace("PM", "1").Replace(" ", "");
                            if (objTicketDetail.RedeemedDate == null || objTicketDetail.RedeemedDate.ToString().Trim().Equals(string.Empty))
                            {
                                TextBlock_11.Text = string.Empty;
                            }
                            else
                            {
                                TextBlock_11.Text = "#" + strbar_pos + objTicketDetail.RedeemedDate.ToString("ddMMyyyyHHmmss");
                            }

                            txtAmount.Text = objTicketDetail.RedeemedAmount.GetUniversalCurrencyFormat();
                            if (!objTicketDetail.TicketStatus.Trim().ToUpper().Equals("ALREADY CLAIMED"))
                            {
                                #region GCD
                                if (Settings.IsGloryCDEnabled && Settings.CashDispenserEnabled)
                                {
                                    LogManager.WriteLog(string.Format("Process Redeem Voucher: {2} for Bar Postion: {0} - Amount: {1} in cents", strbar_pos, ticketAmount, objTicketDetail.TicketString), LogManager.enumLogLevel.Info);

                                    //implement Cash Dispenser
                                    LogManager.WriteLog(string.Format("Amount: {0:0.00} Sending to Cash Dispenser ", ticketAmount), LogManager.enumLogLevel.Info);
                                    LoadingWindow ld = new LoadingWindow(Window.GetWindow(this), ModuleName.Voucher, TextBlock_11.Text , strbar_pos, ticketAmount);
                                    ld.Topmost = true;
                                    ld.ShowDialogEx(this);
                                    Result res = ld.Result;
                                    if (!res.IsSuccess)
                                    {
                                        IsCashDispenseError = false;
                                        this.txtStatus.Text = res.error.Message;
                                        LogManager.WriteLog(string.Format("Unable to Dispense Cash - Amount: {0}", ticketAmount), LogManager.enumLogLevel.Info);
                                        LogManager.WriteLog("Rollback Redeem Voucher Process", LogManager.enumLogLevel.Info);
                                        AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                                        {
                                            AuditModuleName = ModuleName.Voucher,
                                            Audit_Screen_Name = "Vouchers|RedeemVoucher",
                                            Audit_Desc = "Rollback redeem voucher:" + objTicketDetail.TicketString + " due to cash dispenser error",
                                            AuditOperationType = OperationType.MODIFY,
                                            Audit_Old_Vl = "iPayDeviceid:" + objTicketDetail.RedeemedDevice + ";dtPaid:" + objTicketDetail.RedeemedDate.GetUniversalDateTimeFormat() + ";Customerid:" + objTicketDetail.CustomerId.ToString()
                                        });
                                        objCashDeskOper.RollbackRedeemTicket(objTicketDetail.TicketString);
                                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                                        {
                                            BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true);
                                        }
                                    }
                                    else
                                    {
                                        LogManager.WriteLog(string.Format("Cash Dispensed Successfully - Amount: {0}", ticketAmount), LogManager.enumLogLevel.Info);

                                        IsCashDispenseError = true;
                                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                                        {
                                            BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true);
                                        }

                                    }
                                }
                                #endregion
                            }

                        }
                        catch (Exception Ex)
                        {
                            LogManager.WriteLog("Error showing Voucher Info :" + Ex.Message, LogManager.enumLogLevel.Error);
                        }
                    }

                    if (objTicketDetail.ShowOfflineTicketScreen)
                    {
                        int result;

                        if (objTicketDetail.HostSiteCode == Settings.SiteCode) // Offline Tickets redemption is valid only for local site code
                            result = objCashDeskOper.CheckSDGOfflineTicket(objTicketDetail.TicketString);
                        else
                            result = -14;

                        if (result == -14)// Site Code Mismatch
                        {
                            this.txtStatus.Visibility = Visibility.Visible;
                            this.txtStatus.Text = Application.Current.FindResource("MessageID312") as string;
                            this.txtStatus.Background = System.Windows.Media.Brushes.Red;
                            return;
                        }
                        else
                        {
                            frmRedeemOffline = new BMC.Presentation.POS.Views.CRedeemOfflineTicket();
                            frmRedeemOffline.TicketNumber = ucValueCalc.txtDisplay.Text.Trim();
                            frmRedeemOffline.ShowDialogEx(this);
                            if(frmRedeemOffline.IsSuccessfull)
                            {
                                this.ucValueCalc.txtDisplay.Text = frmRedeemOffline.TicketNumber;
                                button_Click(sender, e);
                            }
                            else
                            {
                                this.ucValueCalc.txtDisplay.Text = string.Empty;
                                this.txtStatus.Clear();
                            }
                        }
                    }
                    else
                    {
                        if (Settings.IsGloryCDEnabled && (!IsCashDispenseError))
                        {
                            disptimerRedeem.Stop();
                            this.txtStatus.Visibility = Visibility.Visible;
                            this.txtStatus.Background = System.Windows.Media.Brushes.Red;
                            TextBlock_11.Text = string.Empty;
                            txtAmount.Text = string.Empty;
                            System.Threading.Thread.Sleep(100);
                            //System.Threading.Thread.CurrentThread
                            disptimerRedeem.Start();
                        }
                        else
                        {
                            this.txtStatus.Text = objTicketDetail.TicketStatus;
                            //"(" + CommonUtilities.GetCurrency(Convert.ToDouble(TicketDetail.TicketValue / 100)) + ")";
                            if (Application.Current.FindResource("MessageID219").ToString() == objTicketDetail.TicketStatus)
                            {
                                bisTicketExpired = true;
                            }
                            this.txtWarning.Text = objTicketDetail.TicketWarning;
                            if (!objTicketDetail.ValidTicket)
                            {
                                this.txtStatus.Background = System.Windows.Media.Brushes.Red;

                                AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                                {

                                    AuditModuleName = ModuleName.Voucher,
                                    Audit_Screen_Name = "Vouchers|RedeemVoucher",
                                    Audit_Desc = "Invalid Voucher Redemption Attempt",
                                    AuditOperationType = OperationType.MODIFY,
                                    Audit_Field = "Voucher Number",
                                    Audit_New_Vl = objTicketDetail.TicketString
                                });

                            }
                            else
                            {
                                this.txtStatus.Background = System.Windows.Media.Brushes.White;

                                AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History
                                {

                                    AuditModuleName = ModuleName.Voucher,
                                    Audit_Screen_Name = "Vouchers|RedeemVoucher",
                                    Audit_Desc = "Voucher Number-" + objTicketDetail.TicketString,
                                    AuditOperationType = OperationType.ADD,
                                    Audit_Field = "Voucher Status",
                                    Audit_New_Vl = objTicketDetail.TicketStatus
                                });

                                //Cross Ticketing- Insert Local Record 
                                if (!string.IsNullOrEmpty(objTicketDetail.VoucherXMLData))
                                {
                                    objTicketDetail.RedeemedUser = Security.SecurityHelper.CurrentUser.UserName;
                                    objCashDeskOper.ImportVoucherDetails(objTicketDetail);
                                }

                                if (objTicketDetail.TicketStatus.Contains(Application.Current.FindResource("MessageID210").ToString()))
                                {
                                    //disptimerRedeem.Stop();

                                    Action act = new Action(() =>
                                    {
                                        if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY))
                                        {
                                            if (IsCashDispenseError)
                                            {
                                                if (Settings.IsGloryCDEnabled)
                                                {
                                                    disptimerRedeem.Stop();
                                                    this.txtStatus.Visibility = Visibility.Visible;
                                                }
                                                else
                                                {
                                                    this.ClearAll(false);
                                                }
                                                MessageBox.ShowBox("MessageID377", BMC_Icon.Information);
                                            }


                                        }
                                        else
                                        {
                                            this.txtStatus.Text = Application.Current.FindResource("MessageID377").ToString();
                                            txtAmount.Text = Convert.ToDecimal(objTicketDetail.TicketValue / 100).GetUniversalCurrencyFormat();
                                            bisTicketExpired = false;
                                            this.txtStatus.Background = System.Windows.Media.Brushes.GreenYellow;
                                        }
                                        if (!Settings.IsGloryCDEnabled)
                                        {
                                            this.dispenserStatus.LoadItemsAysnc();
                                        }
                                    });

                                    if (!Settings.IsGloryCDEnabled)
                                    {
                                        _worker.Dispense("Voucher Number", objTicketDetail.TicketString, objTicketDetail.RedeemedAmount, act);

                                    }
                                    else
                                    {
                                        act();
                                        disptimerRedeem.Start();
                                    }

                                }
                            }
                            if (objTicketDetail.EnableTickerPrintDetails)
                            {
                                this.gridRedeemedTicket.Visibility = Visibility.Visible;
                                this.txtPrintedMachine.Text = objTicketDetail.RedeemedMachine;
                                this.txtClaimedDevice.Text = objTicketDetail.RedeemedDevice;
                                this.txtTickAmount.Text = objTicketDetail.RedeemedAmount.GetUniversalCurrencyFormatWithSymbol();
                                this.txtClaimedDate.Text = objTicketDetail.RedeemedDate.GetUniversalDateTimeFormat();
                            }
                            else
                            {
                                this.gridRedeemedTicket.Visibility = Visibility.Hidden;
                            }
                            this.ucValueCalc.txtDisplay.Focus();
                        }
                    }
                }
                else
                {
                    MessageBox.ShowBox("MessageID105", BMC_Icon.Warning);
                    this.ucValueCalc.txtDisplay.Focus();
                }
            }
            catch (Exception ex)
            {
                BMC.Common.ExceptionManagement.ExceptionManager.Publish(ex);
            }
            finally
            {
                btnVerify.IsEnabled = true;
            }
        }