private HotelPropertyProviderRes TransformHotelPropertyDescriptionResponse(TWS_HotelDetailsV3 response, DateTime checkInDate, DateTime checkOutDate)
        {
            var hotelPropertyProviderRes = new HotelPropertyProviderRes();

            hotelPropertyProviderRes.HotelDetails = TransformHotelPropertyDetails(response);
            hotelPropertyProviderRes.HotelInfo    = TransformHotelPropertyInfo(response);

            return(hotelPropertyProviderRes);
        }
Beispiel #2
0
        //public ActionResult SearchDestination()
        //{
        //    //Auth Header
        //    Common.hotelDestSvc.LoginHeader loginHdr = new Common.hotelDestSvc.LoginHeader();
        //    loginHdr.username = "******";
        //    loginHdr.password = "******";
        //    loginHdr.culture = Common.hotelDestSvc.Culture.en_US;
        //    loginHdr.version = "7.123";

        //              //DestinationRequest drq = new DestinationRequest();
        //    //drq.LoginHeader = loginHdr;
        //    //drq.Destination = new Destination() { Continent = "North America" };

        //    //Search Destination Request
        //    DestinationContractsClient dclient = new DestinationContractsClient();

        //    Destination dst = new Destination();
        //    dst.Continent = "North America";
        //    dst.Country = "United States";
        //    dst.State = "New York";
        //    dst.City = "New York City";

        //    try
        //    {
        //                DestinationResult destResult = dclient.GetDestination(loginHdr, dst);
        //                dclient.Close();
        //    }
        //    catch (Exception ex)
        //    {


        //    }

        //    return View();
        //}

        //NOTE: skipped using this method in POC - GetHotelDetailsV3 could be combined with CheckAvailabilityAndPrices to show more details
        public ActionResult GetHotelInfo(FormCollection collection)
        {
            //AuthHeader
            Common.hotelflowSvc.AuthenticationHeader auth = new AuthenticationHeader();
            auth.LoginName = "Tra105";
            auth.Password  = "******";

            var hotelIds = new HotelID[] { new HotelID {
                                               id = Convert.ToInt32(collection["hotelCode"])
                                           } };

            HotelFlowClient    client = new HotelFlowClient();
            TWS_HotelDetailsV3 sreq   = client.GetHotelDetailsV3(auth, hotelIds, new Feature[] { new Feature {
                                                                                                     name = "OriginalImageSize", value = "true"
                                                                                                 } });

            client.Close();

            ViewBag.StartDate = collection["startDate"];
            ViewBag.EndDate   = collection["endDate"];

            //return View("HotelInfo", sreq);
            return(View("HotelDisplay", sreq));
        }
        private HotelDetail TransformHotelPropertyDetails(TWS_HotelDetailsV3 response)
        {
            var hotelDetail = new HotelDetail();


            //Basic Property Information
            var basicPropertyInfo = response.Location.FirstOrDefault();

            hotelDetail.Latitude  = basicPropertyInfo.latitude;
            hotelDetail.Longitude = basicPropertyInfo.longitude;

            //Total No-of floors / Rooms - in Tourico - msanka ?
            hotelDetail.NumberOfFloors
                = basicPropertyInfo.HotelRow.rooms;

            //Hotel Address Information
            hotelDetail.HotelFullAddress.Add(basicPropertyInfo.address);
            hotelDetail.HotelFullAddress.Add(basicPropertyInfo.zip);


            //Hotel Award Providers
            //None for Tourico

            //Hotel Contact Information
            hotelDetail.HotelFaxNumber
                = basicPropertyInfo.HotelRow.hotelFax;

            //Hotel Property Option   -- Aminities from Tourico
            foreach (var aminity in basicPropertyInfo.HotelRow.GetAmenitiesRows())
            {
                hotelDetail.HotelOptions = Helper.GetAvailablePropertyOptions(aminity.GetAmenityRows());
            }

            //Hotel Property Types
            //var propertyType = basicPropertyInfo.HotelRow.GetHomeRows();


            //Hotel Attractions

            //Cancellation Info

            //Location/Facilities/Food/Payment info
            foreach (var descRow in basicPropertyInfo.HotelRow.GetDescriptionsRows())
            {
                foreach (var longdescRow in descRow.GetLongDescriptionRows())
                {
                    hotelDetail.Description.Add(longdescRow.FreeTextLongDescription);     //description row

                    foreach (var dRow in longdescRow.GetDescriptionRows())
                    {
                        switch (dRow.category)
                        {
                        case "Location":
                            hotelDetail.LocationDetails.Add(dRow.value);
                            break;

                        case "Facilities":
                            hotelDetail.HotelFacilities.Add(dRow.value);         //Hotel Facilities
                            break;

                        case "Rooms":
                            hotelDetail.HotelRoomServices.Add(dRow.value);         //Available Room Service
                            break;

                        case "Sports/Entertainment":
                            hotelDetail.HotelRecreationServices.Add(dRow.value);
                            break;

                        case "Meals":
                            hotelDetail.DiningDetails.Add(dRow.value);         //Dining Info
                            break;

                        case "Payment":
                            hotelDetail.DepositPolicies.Add(dRow.value);         //Deposit policy
                            break;
                        }
                    }
                }
            }

            //Direction Details
            var directionInfo = response.RefPoints[0];

            hotelDetail.Directions.Add(directionInfo.type);
            hotelDetail.Directions.Add(directionInfo.name);
            hotelDetail.Directions.Add(directionInfo.direction);
            hotelDetail.Directions.Add(directionInfo.distance.ToString());
            hotelDetail.Directions.Add(directionInfo.unit);

            //Hotel Guarantee Details
            //Marketing Info
            //Miscellaneous Services
            //HotelPolicies
            //Available Safety Services
            //Hotel Services
            //Available Transportation details



            return(hotelDetail);
        }
        private TE.Core.ServiceCatalogues.HotelCatalog.Dtos.HotelInfo TransformHotelPropertyInfo(TWS_HotelDetailsV3 response)
        {
            var hotelInfo = new TE.Core.ServiceCatalogues.HotelCatalog.Dtos.HotelInfo();

            var basicPropertyInfo = response.Hotel[0];

            //Hotel code
            hotelInfo.HotelCode = basicPropertyInfo.hotelID.ToString();

            //Hotel Name
            hotelInfo.HotelName = basicPropertyInfo.name;

            //Chain Code
            hotelInfo.HotelChainCode = (!basicPropertyInfo.IsbrandIdNull()) ? basicPropertyInfo.brandId.ToString() : "";

            //description
            hotelInfo.Description = basicPropertyInfo.GetDescriptionsRows()[0].GetLongDescriptionRows()[0].FreeTextLongDescription;

            //image url
            hotelInfo.HeroImageUrl = (!basicPropertyInfo.IsthumbNull()) ? basicPropertyInfo.thumb : "";

            //City Code
            hotelInfo.CityCode = basicPropertyInfo.GetLocationRows()[0].destinationCode;

            //Hotel Award Provider
            hotelInfo.Rating = Convert.ToInt16(basicPropertyInfo.starLevel);


            //Hotel Contact Information
            hotelInfo.PhoneNumber = basicPropertyInfo.hotelPhone;

            //Address
            var hotelAddress = new Core.Shared.Dtos.AddressDto()
            {
                Address1 = response.Location[0].address,
                Address2 = "",
                City     = response.Location[0].city,
                Zip      = response.Location[0].zip
            };

            hotelInfo.Address = hotelAddress;

            //Geo Code

            hotelInfo.Location = new GeoLocation()
            {
                Latitude  = response.Location[0].latitude,
                Longitude = response.Location[0].longitude
            };


            return(hotelInfo);
        }
        private TE.Core.ServiceCatalogues.HotelCatalog.Dtos.HotelInfo TransformHotelPropertyInfo(TWS_HotelDetailsV3 response)
        {
            var hotelInfo = new TE.Core.ServiceCatalogues.HotelCatalog.Dtos.HotelInfo();

            var basicPropertyInfo = response.Hotel[0];

            //Hotel code
            hotelInfo.HotelCode = basicPropertyInfo.hotelID.ToString();

            //Hotel Name
            hotelInfo.HotelName = basicPropertyInfo.name;

            //Chain Code
#pragma warning disable CS0472             // The result of the expression is always the same since a value of this type is never equal to 'null'
            //if (!(basicPropertyInfo.brandId == null))
#pragma warning restore CS0472             // The result of the expression is always the same since a value of this type is never equal to 'null'
            hotelInfo.HotelChainCode = ""; // basicPropertyInfo.brandId.ToString();

            //description
            hotelInfo.Description = basicPropertyInfo.GetDescriptionsRows()[0].GetLongDescriptionRows()[0].FreeTextLongDescription;

            //image url
            hotelInfo.HeroImageUrl = basicPropertyInfo.thumb;

            //City Code
            hotelInfo.CityCode = basicPropertyInfo.GetLocationRows()[0].destinationCode;

            //Hotel Award Provider
            hotelInfo.Rating = Convert.ToInt16(basicPropertyInfo.starLevel);


            //Hotel Contact Information
            hotelInfo.PhoneNumber = basicPropertyInfo.hotelPhone;

            //Address

            var hotelAddress = new Core.Shared.Dtos.AddressDto()
            {
                Address1 = response.Location[0].address,
                Address2 = "",
                City     = response.Location[0].city,
                Zip      = response.Location[0].zip
            };

            hotelInfo.Address = hotelAddress;

            //Geo Code

            hotelInfo.Location = new GeoLocation()
            {
                Latitude  = response.Location[0].latitude,
                Longitude = response.Location[0].longitude
            };

            return(hotelInfo);
        }