Ejemplo n.º 1
0
        public ActionResult Index(FormCollection collection)
        {
            HotelRateDescriptionRS priceBreakup = null;
            HotelSelectDto         select       = new HotelSelectDto();

            select.StartDate       = Request.QueryString["startDate"];
            select.EndDate         = Request.QueryString["endDate"];
            select.TotalTravellers = Request.QueryString["totalTravellers"];
            select.HotelCode       = Request.QueryString["hotelCode"];
            select.RPHNumber       = Request.QueryString["propertyRphNumber"];

            var session = SabreSessionManager.Create();

            select.SessionId = session.SecurityValue.BinarySecurityToken;
            var hotelDesc = new HotelPropertyDescription()
                            .HotelDescription(select);

            //Get pricing information
            if (hotelDesc.RoomStay != null && hotelDesc.RoomStay.RoomRates != null)
            {
                HotelPricing pricing = new HotelPricing();
                select.RPHNumber = select.RPHNumber;
                priceBreakup     = pricing.GetPricing(select);
            }

            SessionClose closeSession = new SessionClose();

            closeSession.Close(select.SessionId);

            return(View(priceBreakup));
        }
        public JsonResult GetHotelPricingById(int hotelPricingId)
        {
            _serviceEndPoint = new ServicesEndPoint.GeneralSevices.ServicesEndPoint(_simbaToursUnitOfWork, _emailService);
            HotelPricing result = _serviceEndPoint.GetHotelPricingById(hotelPricingId);

            return(Json(result));
        }
        public IActionResult UpdateHotelPricing([FromBody] HotelPricing hotelPricing)
        {
            _serviceEndPoint = new ServicesEndPoint.GeneralSevices.ServicesEndPoint(_simbaToursUnitOfWork, _emailService);
            bool result = _serviceEndPoint.UpdateHotelPricing(hotelPricing);

            return(Json(new { Result = result }));
        }
 public bool UpdateHotelPricing(HotelPricing hotelPricing)
 {
     try
     {
         _simbaToursUnitOfWork._hotelPricingRepository.Update(hotelPricing);
         _simbaToursUnitOfWork.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         throw;
     }
 }
        public bool PostHotelPricing(HotelPricing hotelPricing)
        {
            try
            {
                _simbaToursUnitOfWork._hotelPricingRepository.Insert(hotelPricing);

                _simbaToursUnitOfWork.SaveChanges();
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
    public static HotelBookingPaymentAllocation[] GetPaymentAllocations(HotelPricing[] objHotelPricing)
    {
        HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocation = new HotelBookingPaymentAllocation[objHotelPricing.Length];

        for (int i = 0; i < objHotelPricing.Length; i++)
        {
            objHotelBookingPaymentAllocation[i] = new HotelBookingPaymentAllocation();
            objHotelBookingPaymentAllocation[i].SegmentRefID = objHotelPricing[i].SegmentRefID;
            objHotelBookingPaymentAllocation[i].Amount = objHotelPricing[i].TotalDeposit;
        }

        return objHotelBookingPaymentAllocation;
    }
    private void ConfigureBookingSummaryControl()
    {
        HotelAvailabilityRS objHotelAvailabilityRS = (HotelAvailabilityRS)Session["HotelAvailabilityRS"];
        HotelDescriptiveInfoRS objHotelDescriptiveInfoRS = (HotelDescriptiveInfoRS)Session["HotelDescriptiveInfoRS"];

        StayCriteriaSelection objStayCriteriaSelection = (StayCriteriaSelection)Session[Constants.Sessions.StayCriteriaSelection];
        RoomRateSelection[] objRoomRateSelections = (RoomRateSelection[])Session["RoomRateSelections"];
        AddOnPackageSelection[] objAddOnPackageSelections = (AddOnPackageSelection[])Session["AddOnPackageSelections"];

        HotelDescriptiveInfo objHotelDescriptiveInfo = new HotelDescriptiveInfo();

        if (objHotelDescriptiveInfoRS.HotelDescriptiveInfos.Length != 0)
        {
            objHotelDescriptiveInfo = objHotelDescriptiveInfoRS.HotelDescriptiveInfos[0];
        }

        HotelPricing[] objHotelPricings = HotelPricingHelper.GetHotelPricing(objStayCriteriaSelection, objRoomRateSelections, objAddOnPackageSelections, objHotelAvailabilityRS.HotelRoomAvailInfos, objHotelDescriptiveInfo.CurrencyCode);

        int intNumberStayNights = ((TimeSpan)objStayCriteriaSelection.DepartureDate.Subtract(objStayCriteriaSelection.ArrivalDate)).Days;

        string strBookingSummaryRoomItemControlPath = ConfigurationManager.AppSettings["BookingSummaryRoomItemControl.ascx"];
        string strBookingSummaryAddOnPackageItemControlPath = ConfigurationManager.AppSettings["BookingSummaryAddOnPackageItemControl.ascx"];

        ucBookingSummaryControl.Clear();

        ucBookingSummaryControl.ID = "BookingSummaryControl";
        ucBookingSummaryControl.HotelDescriptiveInfo = objHotelDescriptiveInfo;
        ucBookingSummaryControl.StayCriteriaSelection = objStayCriteriaSelection;
        ucBookingSummaryControl.GuestDetailsEntryInfo = null;
        ucBookingSummaryControl.HotelPricings = objHotelPricings;
        ucBookingSummaryControl.PaymentReceipt = null;
        ucBookingSummaryControl.MasterConfirmationNumber = "";

        for (int ri = 0; ri < objStayCriteriaSelection.RoomOccupantSelections.Length; ri++)
        {
            RoomRateSelection objRoomRateSelection = new RoomRateSelection();

            for (int i = 0; i < objRoomRateSelections.Length; i++)
            {
                if (objRoomRateSelections[i].RoomRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    objRoomRateSelection = objRoomRateSelections[i];
                    break;
                }

            }

            HotelDescRoomType objHotelDescRoomType = new HotelDescRoomType();

            for (int i = 0; i < objHotelDescriptiveInfo.RoomTypes.Length; i++)
            {
                if (objHotelDescriptiveInfo.RoomTypes[i].Code == objRoomRateSelection.RoomTypeCode)
                {
                    objHotelDescRoomType = objHotelDescriptiveInfo.RoomTypes[i];
                    break;
                }

            }

            HotelRoomAvailInfo objHotelRoomAvailInfo = new HotelRoomAvailInfo();

            for (int i = 0; i < objHotelAvailabilityRS.HotelRoomAvailInfos.Length; i++)
            {
                if (objHotelAvailabilityRS.HotelRoomAvailInfos[i].SegmentRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    objHotelRoomAvailInfo = objHotelAvailabilityRS.HotelRoomAvailInfos[i];
                    break;
                }

            }

            HotelAvailRatePlan objHotelAvailRatePlan = new HotelAvailRatePlan();

            for (int i = 0; i < objHotelRoomAvailInfo.RatePlans.Length; i++)
            {
                if (objHotelRoomAvailInfo.RatePlans[i].Code == objRoomRateSelection.RatePlanCode)
                {
                    objHotelAvailRatePlan = objHotelRoomAvailInfo.RatePlans[i];
                    break;
                }

            }

            HotelAvailRoomRate objHotelAvailRoomRate = new HotelAvailRoomRate();

            for (int i = 0; i < objHotelRoomAvailInfo.RoomRates.Length; i++)
            {
                if (objHotelRoomAvailInfo.RoomRates[i].RoomTypeCode == objRoomRateSelection.RoomTypeCode && objHotelRoomAvailInfo.RoomRates[i].RatePlanCode == objRoomRateSelection.RatePlanCode)
                {
                    objHotelAvailRoomRate = objHotelRoomAvailInfo.RoomRates[i];
                    break;
                }

            }

            HotelPricing objHotelPricing = new HotelPricing();

            for (int i = 0; i < objHotelPricings.Length; i++)
            {
                if (objHotelPricings[i].SegmentRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    objHotelPricing = objHotelPricings[i];
                    break;
                }

            }

            BookingSummaryRoomItemControl ucBookingSummaryRoomItemControl = (BookingSummaryRoomItemControl)LoadControl(strBookingSummaryRoomItemControlPath);
            ucBookingSummaryControl.AddRoomSummaryItem(ucBookingSummaryRoomItemControl);

            ucBookingSummaryRoomItemControl.Clear();

            ucBookingSummaryRoomItemControl.ID = "BookingSummaryRoomItem" + ((int)(ri + 1)).ToString();
            ucBookingSummaryRoomItemControl.RoomRefID = objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID;
            ucBookingSummaryRoomItemControl.RoomOccupantSelection = objStayCriteriaSelection.RoomOccupantSelections[ri];
            ucBookingSummaryRoomItemControl.RoomType = objHotelDescRoomType;
            ucBookingSummaryRoomItemControl.RatePlan = objHotelAvailRatePlan;
            ucBookingSummaryRoomItemControl.RoomRate = objHotelAvailRoomRate;
            ucBookingSummaryRoomItemControl.HotelPricing = objHotelPricing;
            ucBookingSummaryRoomItemControl.ConfirmationNumber = "";

            for (int pi = 0; pi < objAddOnPackageSelections.Length; pi++)
            {
                if (objAddOnPackageSelections[pi].RoomRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    HotelDescPackage objHotelDescPackage = new HotelDescPackage();

                    for (int i = 0; i < objHotelDescriptiveInfo.Packages.Length; i++)
                    {
                        if (objHotelDescriptiveInfo.Packages[i].Code == objAddOnPackageSelections[pi].PackageCode)
                        {
                            objHotelDescPackage = objHotelDescriptiveInfo.Packages[i];
                            break;
                        }

                    }

                    HotelAvailPackage objHotelAvailPackage = new HotelAvailPackage();

                    for (int i = 0; i < objHotelAvailRatePlan.Packages.Length; i++)
                    {
                        if (objHotelAvailRatePlan.Packages[i].Code == objAddOnPackageSelections[pi].PackageCode)
                        {
                            if (objHotelAvailRatePlan.Packages[i].RoomTypeCode == "" || objHotelAvailRatePlan.Packages[i].RoomTypeCode == objRoomRateSelection.RoomTypeCode)
                            {
                                objHotelAvailPackage = objHotelAvailRatePlan.Packages[i];
                                break;
                            }

                        }

                    }

                    BookingSummaryAddOnPackageItemControl ucBookingSummaryAddOnPackageItemControl = (BookingSummaryAddOnPackageItemControl)LoadControl(strBookingSummaryAddOnPackageItemControlPath);
                    ucBookingSummaryRoomItemControl.AddAddOnPackageSummaryItem(ucBookingSummaryAddOnPackageItemControl);

                    ucBookingSummaryAddOnPackageItemControl.ID = "BookingSummaryAddOnPackageItem" + ((int)(pi + 1)).ToString();
                    ucBookingSummaryAddOnPackageItemControl.RoomRefID = objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID;
                    ucBookingSummaryAddOnPackageItemControl.NumberStayNights = intNumberStayNights;
                    ucBookingSummaryAddOnPackageItemControl.PackageQuantity = objAddOnPackageSelections[pi].Quantity;
                    ucBookingSummaryAddOnPackageItemControl.PackageDescription = objHotelDescPackage;
                    ucBookingSummaryAddOnPackageItemControl.PackageRate = objHotelAvailPackage;
                }

            }

        }

        return;
    }
    private void ConfigureBookingSummaryControl()
    {
        HotelAvailabilityRS objHotelAvailabilityRS = (HotelAvailabilityRS)Session["HotelAvailabilityRS"];
        HotelDescriptiveInfoRS objHotelDescriptiveInfoRS = (HotelDescriptiveInfoRS)Session["HotelDescriptiveInfoRS"];
        HotelBookingRS objHotelBookingRS = (HotelBookingRS)Session["HotelBookingRS"];

        StayCriteriaSelection objStayCriteriaSelection = (StayCriteriaSelection)Session[Constants.Sessions.StayCriteriaSelection];
        RoomRateSelection[] objRoomRateSelections = (RoomRateSelection[])Session["RoomRateSelections"];
        AddOnPackageSelection[] objAddOnPackageSelections = (AddOnPackageSelection[])Session["AddOnPackageSelections"];
        GuestDetailsEntryInfo objGuestDetailsEntryInfo = (GuestDetailsEntryInfo)Session["GuestDetailsEntryInfo"];
        PaymentGatewayInfo objPaymentGatewayInfo = (PaymentGatewayInfo)Session[Constants.Sessions.PaymentGatewayInfo];
        HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations = (HotelBookingPaymentAllocation[])Session[Constants.Sessions.HotelBookingPaymentAllocations];
        HotelPaymentRS objHotelPaymentRS = (HotelPaymentRS)Session["HotelPaymentRS"];

        HotelDescriptiveInfo objHotelDescriptiveInfo = new HotelDescriptiveInfo();

        if (objHotelDescriptiveInfoRS.HotelDescriptiveInfos.Length != 0)
        {
            objHotelDescriptiveInfo = objHotelDescriptiveInfoRS.HotelDescriptiveInfos[0];
        }

        HotelPricing[] objHotelPricings = HotelPricingHelper.GetHotelPricing(objStayCriteriaSelection, objRoomRateSelections, objAddOnPackageSelections, objHotelAvailabilityRS.HotelRoomAvailInfos, objHotelDescriptiveInfo.CurrencyCode);

        OnlinePaymentReceipt objOnlinePaymentReceipt = null;

        decimal decTotalPaymentCardPayment = WBSPGHelper.GetTotalPaymentCardPayment(objHotelBookingPaymentAllocations);

        if (objPaymentGatewayInfo != null && decTotalPaymentCardPayment != 0)
        {
            objOnlinePaymentReceipt = new OnlinePaymentReceipt();

            objOnlinePaymentReceipt.PaymentCard = objHotelPaymentRS.PaymentCard;
            objOnlinePaymentReceipt.PaymentGatewayCardType = objHotelPaymentRS.PaymentGatewayCardType;
            objOnlinePaymentReceipt.PaymentDateTime = TZNet.ToLocal(WbsUiHelper.GetTimeZone(objStayCriteriaSelection.HotelCode), DateTime.UtcNow).Date;
            objOnlinePaymentReceipt.AuthCode = objHotelPaymentRS.PaymentAuthCode;
            objOnlinePaymentReceipt.TransRefID = objHotelPaymentRS.PaymentTransRefID;
            objOnlinePaymentReceipt.Amount = decTotalPaymentCardPayment;
            objOnlinePaymentReceipt.CurrencyCode = objHotelDescriptiveInfo.CurrencyCode;
        }

        string strMasterConfirmationNumber = "";

        if (objHotelBookingRS.Segments.Length != 0)
        {
            strMasterConfirmationNumber = objHotelBookingRS.Segments[0].MasterConfirmationNumber;
        }

        int intNumberStayNights = ((TimeSpan)objStayCriteriaSelection.DepartureDate.Subtract(objStayCriteriaSelection.ArrivalDate)).Days;

        string strBookingSummaryRoomItemControlPath = ConfigurationManager.AppSettings["BookingSummaryRoomItemControl.ascx"];
        string strBookingSummaryAddOnPackageItemControlPath = ConfigurationManager.AppSettings["BookingSummaryAddOnPackageItemControl.ascx"];

        ucBookingSummaryControl.Clear();

        ucBookingSummaryControl.ID = "BookingSummaryControl";
        ucBookingSummaryControl.HotelDescriptiveInfo = objHotelDescriptiveInfo;
        ucBookingSummaryControl.StayCriteriaSelection = objStayCriteriaSelection;
        ucBookingSummaryControl.GuestDetailsEntryInfo = objGuestDetailsEntryInfo;
        ucBookingSummaryControl.HotelPricings = objHotelPricings;
        ucBookingSummaryControl.PaymentReceipt = objOnlinePaymentReceipt;
        ucBookingSummaryControl.MasterConfirmationNumber = strMasterConfirmationNumber;

        for (int ri = 0; ri < objStayCriteriaSelection.RoomOccupantSelections.Length; ri++)
        {
            RoomRateSelection objRoomRateSelection = new RoomRateSelection();

            for (int i = 0; i < objRoomRateSelections.Length; i++)
            {
                if (objRoomRateSelections[i].RoomRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    objRoomRateSelection = objRoomRateSelections[i];
                    break;
                }

            }

            HotelDescRoomType objHotelDescRoomType = new HotelDescRoomType();

            for (int i = 0; i < objHotelDescriptiveInfo.RoomTypes.Length; i++)
            {
                if (objHotelDescriptiveInfo.RoomTypes[i].Code == objRoomRateSelection.RoomTypeCode)
                {
                    objHotelDescRoomType = objHotelDescriptiveInfo.RoomTypes[i];
                    break;
                }

            }

            HotelRoomAvailInfo objHotelRoomAvailInfo = new HotelRoomAvailInfo();

            for (int i = 0; i < objHotelAvailabilityRS.HotelRoomAvailInfos.Length; i++)
            {
                if (objHotelAvailabilityRS.HotelRoomAvailInfos[i].SegmentRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    objHotelRoomAvailInfo = objHotelAvailabilityRS.HotelRoomAvailInfos[i];
                    break;
                }

            }

            HotelAvailRatePlan objHotelAvailRatePlan = new HotelAvailRatePlan();

            for (int i = 0; i < objHotelRoomAvailInfo.RatePlans.Length; i++)
            {
                if (objHotelRoomAvailInfo.RatePlans[i].Code == objRoomRateSelection.RatePlanCode)
                {
                    objHotelAvailRatePlan = objHotelRoomAvailInfo.RatePlans[i];
                    break;
                }

            }

            HotelAvailRoomRate objHotelAvailRoomRate = new HotelAvailRoomRate();

            for (int i = 0; i < objHotelRoomAvailInfo.RoomRates.Length; i++)
            {
                if (objHotelRoomAvailInfo.RoomRates[i].RoomTypeCode == objRoomRateSelection.RoomTypeCode && objHotelRoomAvailInfo.RoomRates[i].RatePlanCode == objRoomRateSelection.RatePlanCode)
                {
                    objHotelAvailRoomRate = objHotelRoomAvailInfo.RoomRates[i];
                    break;
                }

            }

            HotelPricing objHotelPricing = new HotelPricing();

            for (int i = 0; i < objHotelPricings.Length; i++)
            {
                if (objHotelPricings[i].SegmentRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    objHotelPricing = objHotelPricings[i];
                    break;
                }

            }

            BookingSummaryRoomItemControl ucBookingSummaryRoomItemControl = (BookingSummaryRoomItemControl)LoadControl(strBookingSummaryRoomItemControlPath);
            ucBookingSummaryControl.AddRoomSummaryItem(ucBookingSummaryRoomItemControl);

            ucBookingSummaryRoomItemControl.Clear();

            ucBookingSummaryRoomItemControl.ID = "BookingSummaryRoomItem" + ((int)(ri + 1)).ToString();
            ucBookingSummaryRoomItemControl.RoomRefID = objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID;
            ucBookingSummaryRoomItemControl.RoomOccupantSelection = objStayCriteriaSelection.RoomOccupantSelections[ri];
            ucBookingSummaryRoomItemControl.RoomType = objHotelDescRoomType;
            ucBookingSummaryRoomItemControl.RatePlan = objHotelAvailRatePlan;
            ucBookingSummaryRoomItemControl.RoomRate = objHotelAvailRoomRate;
            ucBookingSummaryRoomItemControl.HotelPricing = objHotelPricing;
            ucBookingSummaryRoomItemControl.ConfirmationNumber = "";

            for (int pi = 0; pi < objAddOnPackageSelections.Length; pi++)
            {
                if (objAddOnPackageSelections[pi].RoomRefID == objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID)
                {
                    HotelDescPackage objHotelDescPackage = new HotelDescPackage();

                    for (int i = 0; i < objHotelDescriptiveInfo.Packages.Length; i++)
                    {
                        if (objHotelDescriptiveInfo.Packages[i].Code == objAddOnPackageSelections[pi].PackageCode)
                        {
                            objHotelDescPackage = objHotelDescriptiveInfo.Packages[i];
                            break;
                        }

                    }

                    HotelAvailPackage objHotelAvailPackage = new HotelAvailPackage();

                    for (int i = 0; i < objHotelAvailRatePlan.Packages.Length; i++)
                    {
                        if (objHotelAvailRatePlan.Packages[i].Code == objAddOnPackageSelections[pi].PackageCode)
                        {
                            if (objHotelAvailRatePlan.Packages[i].RoomTypeCode == "" || objHotelAvailRatePlan.Packages[i].RoomTypeCode == objRoomRateSelection.RoomTypeCode)
                            {
                                objHotelAvailPackage = objHotelAvailRatePlan.Packages[i];
                                break;
                            }

                        }

                    }

                    BookingSummaryAddOnPackageItemControl ucBookingSummaryAddOnPackageItemControl = (BookingSummaryAddOnPackageItemControl)LoadControl(strBookingSummaryAddOnPackageItemControlPath);
                    ucBookingSummaryRoomItemControl.AddAddOnPackageSummaryItem(ucBookingSummaryAddOnPackageItemControl);

                    ucBookingSummaryAddOnPackageItemControl.ID = "BookingSummaryAddOnPackageItem" + ((int)(pi + 1)).ToString();
                    ucBookingSummaryAddOnPackageItemControl.RoomRefID = objStayCriteriaSelection.RoomOccupantSelections[ri].RoomRefID;
                    ucBookingSummaryAddOnPackageItemControl.NumberStayNights = intNumberStayNights;
                    ucBookingSummaryAddOnPackageItemControl.PackageQuantity = objAddOnPackageSelections[pi].Quantity;
                    ucBookingSummaryAddOnPackageItemControl.PackageDescription = objHotelDescPackage;
                    ucBookingSummaryAddOnPackageItemControl.PackageRate = objHotelAvailPackage;
                }

            }

        }

        return;
    }
    public static HotelPricing[] GetHotelPricing(StayCriteriaSelection objStayCriteriaSelection, RoomRateSelection[] objRoomRateSelections, AddOnPackageSelection[] objAllAddOnPackageSelections, HotelRoomAvailInfo[] objHotelRoomAvailInfos, string strCurrenyCode)
    {
        HotelPricing[] objHotelPricing = new HotelPricing[objStayCriteriaSelection.RoomOccupantSelections.Length];

        int intNumberStayNights = ((TimeSpan)objStayCriteriaSelection.DepartureDate.Subtract(objStayCriteriaSelection.ArrivalDate)).Days;

        for (int i = 0; i < objStayCriteriaSelection.RoomOccupantSelections.Length; i++)
        {
            RoomOccupantSelection objRoomOccupantSelection = objStayCriteriaSelection.RoomOccupantSelections[i];
            RoomRateSelection objRoomRateSelection = HotelPricingHelper.GetRoomRateSelection(objRoomOccupantSelection, objRoomRateSelections);
            HotelAvailRatePlan objHotelAvailRatePlan = HotelPricingHelper.GetHotelAvailRatePlan(objRoomRateSelection, objHotelRoomAvailInfos);
            HotelAvailRoomRate objHotelAvailRoomRate = HotelPricingHelper.GetHotelAvailRoomRate(objRoomRateSelection, objHotelRoomAvailInfos);
            AddOnPackageSelection[] objAddOnPackageSelections = HotelPricingHelper.GetAddOnPackageSelections(objRoomRateSelection, objAllAddOnPackageSelections);

            decimal decTotalRoomAmount = 0;
            decimal decTotalRoomTaxes = 0; // Exclusive taxes only
            decimal decTotalRoomFees = 0; // Exclusive fees only

            for (int j = 0; j < objHotelAvailRoomRate.Rates.Length; j++)
            {
                decTotalRoomAmount += objRoomOccupantSelection.NumberRooms * objHotelAvailRoomRate.Rates[j].Amount * objHotelAvailRoomRate.Rates[j].NumNights;

                for (int k = 0; k < objHotelAvailRoomRate.Rates[j].PerNightTaxesFees.Length; k++)
                {
                    if (objHotelAvailRoomRate.Rates[j].PerNightTaxesFees[k].CategoryType == TaxFeeCategoryType.Tax && objHotelAvailRoomRate.Rates[j].PerNightTaxesFees[k].Type == TaxFeeType.Exclusive)
                    {
                        decTotalRoomTaxes += objHotelAvailRoomRate.Rates[j].PerNightTaxesFees[k].Amount;
                    }

                    else if (objHotelAvailRoomRate.Rates[j].PerNightTaxesFees[k].CategoryType == TaxFeeCategoryType.Fee && objHotelAvailRoomRate.Rates[j].PerNightTaxesFees[k].Type == TaxFeeType.Exclusive)
                    {
                        decTotalRoomFees += objHotelAvailRoomRate.Rates[j].PerNightTaxesFees[k].Amount;
                    }

                }

            }

            decTotalRoomAmount += decTotalRoomTaxes + decTotalRoomFees;

            decimal decTotalPackageAmount = 0;
            decimal decTotalPackageDeposit = 0;
            decimal decTotalPackageTaxes = 0; // Exclusive taxes only
            decimal decTotalPackageFees = 0; // Exclusive fees only

            for (int j = 0; j < objAddOnPackageSelections.Length; j++)
            {
                HotelAvailPackage objHotelAvailPackage = HotelPricingHelper.GetHotelAvailPackage(objAddOnPackageSelections[j], objRoomRateSelection, objHotelAvailRatePlan);

                if (objHotelAvailPackage.PriceType == PackagePriceType.PerStayPerNight || objHotelAvailPackage.PriceType == PackagePriceType.PerPersonPerNight)
                {
                    decTotalPackageAmount += objAddOnPackageSelections[j].Quantity * objHotelAvailPackage.Price * intNumberStayNights;
                    decTotalPackageDeposit += objAddOnPackageSelections[j].Quantity * objHotelAvailPackage.Deposit * intNumberStayNights;
                }

                else
                {
                    decTotalPackageAmount += objAddOnPackageSelections[j].Quantity * objHotelAvailPackage.Price;
                    decTotalPackageDeposit += objAddOnPackageSelections[j].Quantity * objHotelAvailPackage.Deposit;
                }

            }

            decimal decDepositTaxFactor = 0;

            if (decTotalPackageAmount != 0)
                decDepositTaxFactor = decTotalPackageDeposit / decTotalPackageAmount;

            decTotalPackageAmount += decTotalPackageTaxes + decTotalPackageFees;
            decTotalPackageDeposit += decimal.Round(((decTotalPackageTaxes + decTotalPackageFees) * decDepositTaxFactor), 2);

            decimal decTotalAdditionalTaxes = 0; // Exclusive taxes only
            decimal decTotalAdditionalFees = 0; // Exclusive fees only

            for (int j = 0; j < objHotelAvailRoomRate.PerStayTaxesFees.Length; j++)
            {
                if (objHotelAvailRoomRate.PerStayTaxesFees[j].CategoryType == TaxFeeCategoryType.Tax && objHotelAvailRoomRate.PerStayTaxesFees[j].Type == TaxFeeType.Exclusive)
                {
                    decTotalAdditionalTaxes += objHotelAvailRoomRate.PerStayTaxesFees[j].Amount;
                }

                else if (objHotelAvailRoomRate.PerStayTaxesFees[j].CategoryType == TaxFeeCategoryType.Fee && objHotelAvailRoomRate.PerStayTaxesFees[j].Type == TaxFeeType.Exclusive)
                {
                    decTotalAdditionalFees += objHotelAvailRoomRate.PerStayTaxesFees[j].Amount;
                }

            }

            objHotelPricing[i] = new HotelPricing();
            objHotelPricing[i].SegmentRefID = objRoomOccupantSelection.RoomRefID;
            objHotelPricing[i].CurrencyCode = strCurrenyCode;

            objHotelPricing[i].TotalRoomTaxes = decTotalRoomTaxes;
            objHotelPricing[i].TotalRoomFees = decTotalRoomFees;
            objHotelPricing[i].TotalRoomAmount = decTotalRoomAmount;

            objHotelPricing[i].TotalPackageTaxes = decTotalPackageTaxes;
            objHotelPricing[i].TotalPackageFees = decTotalPackageFees;
            objHotelPricing[i].TotalPackageAmount = decTotalPackageAmount;

            objHotelPricing[i].TotalAdditionalTaxes = decTotalAdditionalTaxes;
            objHotelPricing[i].TotalAdditionalFees = decTotalAdditionalFees;

            if (ConfigurationManager.AppSettings["HotelPricing.IncludeAddOnPackageAmountsInTotal"] == "1")
                objHotelPricing[i].TotalAmount = decTotalRoomAmount + decTotalPackageAmount + decTotalAdditionalTaxes + decTotalAdditionalFees;
            else
                objHotelPricing[i].TotalAmount = decTotalRoomAmount + decTotalAdditionalTaxes + decTotalAdditionalFees;

            //objHotelPricing[i].TotalDeposit = HotelPricingHelper.GetDepositAmount(objHotelAvailRatePlan, decTotalRoomAmount + decTotalPackageDeposit + decTotalAdditionalTaxes + decTotalAdditionalFees, intNumberStayNights);
            objHotelPricing[i].TotalDeposit = HotelPricingHelper.GetDepositAmount(objHotelAvailRatePlan, objHotelPricing[i].TotalAmount, intNumberStayNights);
        }

        return objHotelPricing;
    }