Ejemplo n.º 1
0
        /// <summary>
        /// Set Configuration on AIG product
        /// </summary>
        /// <param name="roomType">Room Type</param>        
        /// <param name="interfaceProduct">AIG Product</param>
        private void SetAigProductConfiguration(RoomType roomType, ref AIGProduct interfaceProduct)
        {
            var rooms = ExtractProductsAndThierAvailabiltyByProductType(roomType);

            if (interfaceProduct == null)
            {
                interfaceProduct = AIGProduct.CreateProductInventoryConfigurationOnly(roomType.ProductId, rooms);
            }
            else
            {
                interfaceProduct.Inventory = rooms;
            }

            CheckAssociatedInventoryExists(interfaceProduct);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Validate maximum occupancy is set
 /// </summary>
 /// <param name="interfaceProduct">Interfaced Product</param>        
 private static void CheckValidMaximumOccupancyIsSet(AIGProduct interfaceProduct)
 {
     if (interfaceProduct.MaxCapacity <= 0)
     {
         Logger.InfoFormat("RoomType Setup Incomplete: Room type with id {0} has been setup with invalid capacity of {1}", interfaceProduct.ProductTypeId, interfaceProduct.MaxCapacity);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// This method create a CreateProductAttributeChangeMessage object
        /// </summary>
        /// <param name="interfaceProduct">AIG Product</param>
        /// <param name="subscriberId">Subscriber Id</param>
        /// <param name="providerId">Provider Id</param>        
        /// <returns>CreateProductAttributeChangeMessage object</returns>
        private static ProductModification CreateProductAttributeChangeMessage(AIGProduct interfaceProduct, Guid subscriberId, Guid providerId)
        {
            try
            {

                return ProductModification.CreateUpdateProductAttributesMessage(subscriberId.ToString(),
                                                                                providerId.ToString(),
                                                                                interfaceProduct);
            }
            catch (Exception ex)
            {
                Logger.Error(string.Format("Unable to create ProductModification CreateProductAttributeChangeMessage message for business {0}, opted into distribution channel {1} with room type {2}", providerId, subscriberId, interfaceProduct.ProductTypeId), ex);
                return null;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Make sure price rates exist
 /// </summary>
 /// <param name="interfaceProduct">AIG Product</param>
 /// <param name="providerId">Provider Id</param>
 /// <returns>RatesRestrictionsDateRangeEntry object</returns>
 private static void CheckPriceRatesExists(AIGProduct interfaceProduct, Guid providerId)
 {
     if (interfaceProduct.RatesRestrictionsDateRange == null)
     {
         Logger.Info(String.Format("RoomType Setup Incomplete: No rate information found for business {0} and room type {1}", providerId, interfaceProduct.ProductTypeId));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Validate associated inventory exists
 /// </summary>
 /// <param name="interfaceProduct">Interfaced Product</param>
 private static void CheckAssociatedInventoryExists(AIGProduct interfaceProduct)
 {
     if (((interfaceProduct.Inventory == null) || interfaceProduct.Inventory.Length == 0))
     {
         Logger.InfoFormat("RoomType Setup Incomplete: No available rooms were found for room type {0} and room type name {1}", interfaceProduct.ProductTypeId, interfaceProduct.Name);
     }
 }