コード例 #1
0
        private void SaveDetails_EventsFromConnexus(bool IsVoid)
        {
            string strTreasuryType = string.Empty;
            float  fTreasuryAmount = 0.00F;

            try
            {
                Treasury    objHandpayEntity    = new Treasury();
                IHandpay    objCashDeskOperator = HandpayBusinessObject.CreateInstance();
                DataRowView objHandpays         = null;

                if (lvUnprocessedHandpays.SelectedItem != null)
                {
                    objHandpays     = (DataRowView)lvUnprocessedHandpays.SelectedItem;
                    strTreasuryType = objHandpays.Row["Type"].ToString();

                    if (strTreasuryType.ToUpper() == "HANDPAY")
                    {
                        strTreasuryType = TREASURY_HANDPAY_CREDIT;;
                    }
                    else if (strTreasuryType.ToUpper() == "JACKPOT")
                    {
                        strTreasuryType = TREASURY_HANDPAY_JACKPOT;
                    }
                    else if (strTreasuryType.ToUpper() == "PROG")
                    {
                        strTreasuryType = TREASURY_PROG;
                    }

                    objHandpayEntity.TreasuryType = strTreasuryType;

                    objHandpayEntity.CollectionNumber      = 0;
                    objHandpayEntity.InstallationNumber    = int.Parse(objHandpays.Row["Installation_No"].ToString());
                    objHandpayEntity.UserID                = BMC.Common.clsSecurity.UserID;
                    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  = BMC.Common.clsSecurity.UserID;
                    objHandpayEntity.TreasuryMembershipNo  = "0";

                    objHandpayEntity.TreasuryAmount = float.Parse(objHandpays.Row["Amount"].ToString());
                    fTreasuryAmount = objHandpayEntity.TreasuryAmount;

                    iTreasuryID = objCashDeskOperator.ProcessHandPay(objHandpayEntity);

                    string strTEID = string.Empty;
                    strTEID = objHandpays.Row["TE_Id"].ToString();
                    if (objCashDeskOperator.UpdateTicketException(strTEID) == false)
                    {
                        BMC.Common.LogManagement.LogManager.WriteLog("Error while updating ticket exception table", BMC.Common.LogManagement.LogManager.enumLogLevel.Info);
                    }

                    if (IsVoid == true)
                    {
                        fTreasuryAmount = -fTreasuryAmount;
                    }

                    //MachineDetails.TreasuryNo = iTreasuryID.ToString();
                    //MachineDetails.Value = objHandpayEntity.TreasuryAmount.ToString();

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

                    objCashDeskOperator.ClearHandpayLock(int.Parse(objHandpays.Row["Installation_No"].ToString()));

                    if (IsVoid == false)
                    {
                        MessageBox.showBox("Data is now saved", BMC_Icon.Information);
                    }
                    txtSelectedValue.Text = string.Empty;

                    FillHandpays();
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
            }
        }
コード例 #2
0
        void EXClas_ACK(ComExchangeLib.MessageAck MessageAck)
        {
            if (MessageAck.ACK)
            {
                bool   IsVoid          = false;
                string strTEID         = string.Empty;
                string strTreasuryType = string.Empty;
                //float fTreasuryAmount = 0.00F;
                double fTreasuryAmount;
                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.


                    //MachineDetails.TreasuryNo = iTreasuryID.ToString();
                    //MachineDetails.Value = objHandpayEntity.TreasuryAmount.ToString();

                    if (strTreasuryType == TREASURY_HANDPAY_CREDIT)
                    {
                        strTreasuryType = "Handpay";
                    }
                    (oCommonUtilities.CreateInstance()).PrintCommonReceipt(false, strTreasuryType, "");
                    if (IsVoid == false)
                    {
                        MessageBox.ShowBox("MessageID57", BMC_Icon.Information);
                    }

                    this.Visibility = Visibility.Hidden;
                }
                catch (Exception ex)
                {
                    MessageBox.ShowBox("MessageID59", BMC_Icon.Error);
                    ExceptionManager.Publish(ex);
                }
            }
            else
            {
                MessageBox.ShowBox("MessageID59", BMC_Icon.Error);
            }
        }