Exemplo n.º 1
0
        private static List <WildernessAvailability> GetAvailabilityByProperty(WildernessProperty wildernessProperty, int numberOfDays, DateTime startDate)
        {
            GetAvailabilityByDay Availability = new GetAvailabilityByDay(); // define function you want to use and fill in parameters

            Availability.NumberOfDays = numberOfDays;
            Availability.PropertyList = wildernessProperty.SupplierCode;
            Availability.StartDate    = startDate;

            GetAvailabilityByDayResponse AvailabilityResponse = api.GetAvailabilityByDay(Availability); //initialise response

            List <WildernessAvailability> ReturnList         = new List <WildernessAvailability>();
            WildernessAvailability        ReturnAvailability = new WildernessAvailability();

            foreach (var ResponseObject in AvailabilityResponse.AvailabilityByDay.AvailabilityByDay_Response)
            {
                ReturnAvailability.Date         = ResponseObject.Date;
                ReturnAvailability.PropertyCode = ResponseObject.PropertyCode;
                ReturnAvailability.RoomType     = ResponseObject.RoomType;
                ReturnAvailability.RoomsAvail   = ResponseObject.RoomsAvail;

                ReturnList.Add(ReturnAvailability);

                ReturnAvailability = new WildernessAvailability();
            }

            return(ReturnList);
        }
Exemplo n.º 2
0
        private static List <WildernessProperty> GetPropertyList()
        {
            GetWildernessProperties         Properties       = new GetWildernessProperties();
            GetWildernessPropertiesResponse PropertyResponse = api.GetWildernessProperties(Properties);

            List <WildernessProperty> ReturnList     = new List <WildernessProperty>();
            WildernessProperty        ReturnProperty = new WildernessProperty();

            foreach (var ResponseObject in PropertyResponse.Response.WildernessSuppliers_Response)
            {
                ReturnProperty.SupplierCode     = ResponseObject.SupplierCode;
                ReturnProperty.SupplierLocation = ResponseObject.SupplierLocation;
                ReturnProperty.SupplierName     = ResponseObject.SupplierName;
                ReturnProperty.Country          = ResponseObject.Country;

                ReturnList.Add(ReturnProperty);

                ReturnProperty = new WildernessProperty();
            }

            return(ReturnList);
        }