Пример #1
0
        public redeemVoucherResponse1 redeemVoucher(redeemVoucherRequest request)
        {
            if (!CheckCageEnabled())
                return null;
            this.SetUser(request.redeemVoucher.arg0.employeeId);
            bool isValid = false;
            RTOnlineTicketDetail objTicketDetail = null;
            double redeemTicketAmount = 0;
            redeemVoucherResponse1 oReponse = new redeemVoucherResponse1();
            oReponse.redeemVoucherResponse = new redeemVoucherResponse();
            oReponse.redeemVoucherResponse.@return = request.redeemVoucher.arg0;
            try
            {
                IRedeemOnlineTicket objCashDeskOper = RedeemOnlineTicketBusinessObject.CreateInstance();
                objTicketDetail = new RTOnlineTicketDetail();
                objTicketDetail.TicketString = request.redeemVoucher.arg0.barcode;
                //int ticketStatus = 0;
                objTicketDetail = objCashDeskOper.GetRedeemTicketAmountCage(objTicketDetail);
                
                redeemTicketAmount = double.Parse ( objTicketDetail.RedeemedAmount.ToString()) / 100;
                objTicketDetail.CustomerId = Custid;

                int iResult = objCashDeskOper.CheckSDGTicketCage(objTicketDetail.TicketString);
                LogManager.WriteLog("redeemVoucher->CheckSDGTicketCage Return Value :" + iResult.ToString() , LogManager.enumLogLevel.Info);
                oReponse.redeemVoucherResponse.@return = objCashDeskOperator.redeemRequestVoucher(request.redeemVoucher.arg0);
                if (iResult == 0)
                {

                    isValid = objCashDeskOper.RedeemOnlineTicketCage(objTicketDetail);
                    if (isValid)
                    {
                        [email protected] = "REDEEMED";
                        [email protected] = 3;
                        [email protected] = 0;
                    }
                    else
                    {
                        [email protected] = objTicketDetail.TicketStatus;
                        [email protected] = -98;
                        [email protected] = -98;
                    }
                    
                }
                else
                {
                    if (iResult == -1)
                    {
                        [email protected] = "VOUCHER_ALREADY_REDEEEMED";
                        [email protected] = -1001;
                        [email protected] = -1001;
                    }
                    else if (iResult == -2)
                    {
                        [email protected] = "VOUCHER_BARCODE_NOT_EXIST";
                        [email protected] = -3;
                        [email protected] = -3;
                    }
                    else if (iResult == -3)
                    {
                        if (Settings.RedeemExpiredTicket)
                        {
                            objTicketDetail = new RTOnlineTicketDetail();
                            objTicketDetail.TicketString = request.redeemVoucher.arg0.barcode;
                            objTicketDetail.CustomerId = Custid;
                           
                            isValid = objCashDeskOper.RedeemOnlineTicketCage(objTicketDetail);
                            LogManager.WriteLog("Redeem Expired Voucher response:" + objTicketDetail.ValidTicket.ToString() + " " + ((objTicketDetail.TicketStatus!= null)?objTicketDetail.TicketStatus:string.Empty), LogManager.enumLogLevel.Info);
                            if (objTicketDetail.ValidTicket == true)
                            {
                                [email protected] = "REDEEMED";
                                [email protected] = 3;
                                [email protected] = 0;
                            }
                            else
                            {
                                
                                [email protected] = "GENERAL_VOUCHER_ERROR";
                                [email protected] = -2;
                                [email protected] = -2;
                            }
                        
                        }
                        else
                        {
                            [email protected] = "VOUCHER_EXPIRED";
                            [email protected] = -1005;
                            [email protected] = -1005;
                        }

                    }
                    else if (iResult == -12)
                    {
                        [email protected] = "REDEEM_REQ_ALREADY_VOIDED";
                        [email protected] = -1031;
                        [email protected] = -1031;
                    }
                    else if (iResult == -99)
                    {
                        [email protected] = "SITE CODE MISMATCH";
                        [email protected] = -99;
                        [email protected] = -99;
                    }
                    else
                    {
                        [email protected] = "GENERAL_VOUCHER_ERROR";
                        [email protected] = -1;
                        [email protected] = -1;
                    }
                }
            }
            catch (Exception ex)
            {
                BMC.Common.ExceptionManagement.ExceptionManager.Publish(ex);
                [email protected] = -1;
                [email protected] = -1;
            }
            return oReponse;
        }
Пример #2
0
        public redeemVoucherResponse1 redeemVoucher(redeemVoucherRequest request)
        {
            if (!CheckCageEnabled())
            {
                return(null);
            }
            this.SetUser(request.redeemVoucher.arg0.employeeId);
            bool isValid = false;
            RTOnlineTicketDetail objTicketDetail = null;
            double redeemTicketAmount            = 0;
            redeemVoucherResponse1 oReponse      = new redeemVoucherResponse1();

            oReponse.redeemVoucherResponse         = new redeemVoucherResponse();
            oReponse.redeemVoucherResponse.@return = request.redeemVoucher.arg0;
            try
            {
                IRedeemOnlineTicket objCashDeskOper = RedeemOnlineTicketBusinessObject.CreateInstance();
                objTicketDetail = new RTOnlineTicketDetail();
                objTicketDetail.TicketString = request.redeemVoucher.arg0.barcode;
                //int ticketStatus = 0;
                objTicketDetail = objCashDeskOper.GetRedeemTicketAmountCage(objTicketDetail);

                redeemTicketAmount         = double.Parse(objTicketDetail.RedeemedAmount.ToString()) / 100;
                objTicketDetail.CustomerId = Custid;

                int iResult = objCashDeskOper.CheckSDGTicketCage(objTicketDetail.TicketString);
                LogManager.WriteLog("redeemVoucher->CheckSDGTicketCage Return Value :" + iResult.ToString(), LogManager.enumLogLevel.Info);
                oReponse.redeemVoucherResponse.@return = objCashDeskOperator.redeemRequestVoucher(request.redeemVoucher.arg0);
                if (iResult == 0)
                {
                    isValid = objCashDeskOper.RedeemOnlineTicketCage(objTicketDetail);
                    if (isValid)
                    {
                        [email protected]   = "REDEEMED";
                        [email protected] = 3;
                        [email protected] = 0;
                    }
                    else
                    {
                        [email protected]   = objTicketDetail.TicketStatus;
                        [email protected] = -98;
                        [email protected] = -98;
                    }
                }
                else
                {
                    if (iResult == -1)
                    {
                        [email protected]   = "VOUCHER_ALREADY_REDEEEMED";
                        [email protected] = -1001;
                        [email protected] = -1001;
                    }
                    else if (iResult == -2)
                    {
                        [email protected]   = "VOUCHER_BARCODE_NOT_EXIST";
                        [email protected] = -3;
                        [email protected] = -3;
                    }
                    else if (iResult == -3)
                    {
                        if (Settings.RedeemExpiredTicket)
                        {
                            objTicketDetail = new RTOnlineTicketDetail();
                            objTicketDetail.TicketString = request.redeemVoucher.arg0.barcode;
                            objTicketDetail.CustomerId   = Custid;

                            isValid = objCashDeskOper.RedeemOnlineTicketCage(objTicketDetail);
                            LogManager.WriteLog("Redeem Expired Voucher response:" + objTicketDetail.ValidTicket.ToString() + " " + ((objTicketDetail.TicketStatus != null)?objTicketDetail.TicketStatus:string.Empty), LogManager.enumLogLevel.Info);
                            if (objTicketDetail.ValidTicket == true)
                            {
                                [email protected]   = "REDEEMED";
                                [email protected] = 3;
                                [email protected] = 0;
                            }
                            else
                            {
                                [email protected]   = "GENERAL_VOUCHER_ERROR";
                                [email protected] = -2;
                                [email protected] = -2;
                            }
                        }
                        else
                        {
                            [email protected]   = "VOUCHER_EXPIRED";
                            [email protected] = -1005;
                            [email protected] = -1005;
                        }
                    }
                    else if (iResult == -12)
                    {
                        [email protected]   = "REDEEM_REQ_ALREADY_VOIDED";
                        [email protected] = -1031;
                        [email protected] = -1031;
                    }
                    else if (iResult == -99)
                    {
                        [email protected]   = "SITE CODE MISMATCH";
                        [email protected] = -99;
                        [email protected] = -99;
                    }
                    else
                    {
                        [email protected]   = "GENERAL_VOUCHER_ERROR";
                        [email protected] = -1;
                        [email protected] = -1;
                    }
                }
            }
            catch (Exception ex)
            {
                BMC.Common.ExceptionManagement.ExceptionManager.Publish(ex);
                [email protected] = -1;
                [email protected] = -1;
            }
            return(oReponse);
        }