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; }