Exemplo n.º 1
0
        private void SaveDetails_EventsFromConnexus(bool IsVoid)
        {
            string strTEID         = string.Empty;
            string strTreasuryType = string.Empty;
            //float fTreasuryAmount = 0.00F;
            double fTreasuryAmount;

            Clearhandpay(_POSDetail.InstallationNo);
            try
            {
                Treasury objHandpayEntity    = new Treasury();
                IHandpay objCashDeskOperator = HandpayBusinessObject.CreateInstance();

                strTreasuryType = TREASURY_HANDPAY_CREDIT;

                //Get the type of treasury event
                if (_POSDetail.HandPayType == "HandPay")
                {
                    strTreasuryType = TREASURY_HANDPAY_CREDIT;;
                }
                else if (_POSDetail.HandPayType == "Jackpot")
                {
                    strTreasuryType = TREASURY_HANDPAY_JACKPOT;
                }
                else if (_POSDetail.HandPayType == "Progressive")
                {
                    strTreasuryType = TREASURY_PROG;
                }

                //Save the treasury details in treasury table.
                objHandpayEntity.TreasuryType = strTreasuryType;

                objHandpayEntity.CollectionNumber      = 0;
                objHandpayEntity.InstallationNumber    = _POSDetail.InstallationNo;
                objHandpayEntity.UserID                = Security.SecurityHelper.CurrentUser.SecurityUserID;
                objHandpayEntity.TreasuryReason        = "";
                objHandpayEntity.TreasuryReasonCode    = 0;
                objHandpayEntity.TreasuryAllocated     = 0;
                objHandpayEntity.TreasuryBreakdown100p = 0;
                objHandpayEntity.TreasuryBreakdown10p  = 0;
                objHandpayEntity.TreasuryBreakdown200p = 0;
                objHandpayEntity.TreasuryBreakdown20p  = 0;
                objHandpayEntity.TreasuryBreakdown2p   = 0;
                objHandpayEntity.TreasuryBreakdown50p  = 0;
                objHandpayEntity.TreasuryBreakdown5p   = 0;
                objHandpayEntity.TreasuryIssuerUserNo  = Security.SecurityHelper.CurrentUser.SecurityUserID;
                objHandpayEntity.TreasuryMembershipNo  = "0";

                objHandpayEntity.TreasuryAmount = double.Parse(_POSDetail.HandPayValue.ToString());
                fTreasuryAmount = objHandpayEntity.TreasuryAmount;

                iTreasuryID = objCashDeskOperator.ProcessHandPay(objHandpayEntity);

                DataTable dt = new DataTable();
                dt = analysisBusinessObject.GetTicketException(_POSDetail.InstallationNo);

                foreach (DataRow dr in dt.Rows)
                {
                    strTEID = BMC.Presentation.Helper_classes.Common.GetRowValue <int>(dr, "TE_ID").ToString();
                    break;
                }


                if (objCashDeskOperator.UpdateTicketException(strTEID) == false)
                {
                    BMC.Common.LogManagement.LogManager.WriteLog("Error while updating ticket exception table", BMC.Common.LogManagement.LogManager.enumLogLevel.Info);
                }

                //Create a receipt with -ve amount incase of a void transaction
                if (IsVoid == true)
                {
                    fTreasuryAmount = -fTreasuryAmount;
                }
                //Print the receipt for handpay.

                if (strTreasuryType == TREASURY_HANDPAY_CREDIT)
                {
                    strTreasuryType = "Handpay";
                }
                (oCommonUtilities.CreateInstance()).PrintCommonReceipt(false, strTreasuryType, "");

                if (IsVoid == false)
                {
                    MessageBox.ShowBox("MessageID57", BMC_Icon.Information);
                }

                if (Exit != null)
                {
                    Exit.Invoke(this, new CancelEventArgs());
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }