当前位置: 首页>>代码示例>>C#>>正文


C# Guid.ToLong方法代码示例

本文整理汇总了C#中System.Guid.ToLong方法的典型用法代码示例。如果您正苦于以下问题:C# Guid.ToLong方法的具体用法?C# Guid.ToLong怎么用?C# Guid.ToLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Guid的用法示例。


在下文中一共展示了Guid.ToLong方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExtractAndConvertRoomTypesByProvider

        /// <summary>
        /// Get all Room Types for a Provider and Convert to AIG product
        /// </summary>
        /// <param name="providerId">Provider Id</param>        
        /// <param name="checkinTime">Checkin Time</param>
        /// <param name="checkoutTime">Checkout Time</param>
        /// <returns>Array of AIGProduct</returns>
        private AIGProduct[] ExtractAndConvertRoomTypesByProvider(Guid providerId, string checkinTime, string checkoutTime)
        {
            var roomTypes = roomTypeManager.GetAllActiveWithRatePlansForBusiness(providerId.ToLong(), RatePlanTypeEnum.Base);

            if (roomTypes != null && roomTypes.Count != default(int))
            {
                return roomTypes.Select(roomType => ConvertRoomTypeToAigProduct(roomType, checkinTime, checkoutTime)).ToArray();
            }

            Logger.InfoFormat("No rooms found for business {0}", providerId);
            return new AIGProduct[0];            
        }
开发者ID:ognjenm,项目名称:egle,代码行数:19,代码来源:AIGIntegratorService.cs

示例2: ExtractRoomTypesByProvider

        /// <summary>
        /// Get all Room Types for a Provider
        /// </summary>
        /// <param name="providerId">Provider Id</param>        
        /// <param name="checkinTime">Checkin Time</param>
        /// <param name="checkoutTime">Checkout Time</param>
        /// <returns>Array of AIGProduct</returns>
        private AIGProduct[] ExtractRoomTypesByProvider(Guid providerId, string checkinTime, string checkoutTime)
        {
            var extractedAigProductsByProviderId = ExtractAndConvertRoomTypesByProvider(providerId, checkinTime, checkoutTime);
            var interfaceProductsWithPricingList = new List<AIGProduct>();

            //only handling Serviced Accommodation at the moment
            foreach (var interfaceProduct in extractedAigProductsByProviderId)
            {
                interfaceProduct.RatesRestrictionsDateRange = ExtractRateRestrictions(providerId.ToLong(), new Guid(interfaceProduct.ProductTypeId));
                CheckPriceRatesExists(interfaceProduct, providerId);
                interfaceProductsWithPricingList.Add(interfaceProduct);
            }

            return interfaceProductsWithPricingList.ToArray();
        }
开发者ID:ognjenm,项目名称:egle,代码行数:22,代码来源:AIGIntegratorService.cs

示例3: CreateProviderAvailabilityResetMessage

        /// <summary>
        /// This method create a ProviderAvailabilityReset object
        /// </summary>
        /// <param name="subscriberId">Subscriber Id</param>
        /// <param name="providerId">Provider Id</param>        
        /// <returns>ProviderAvailabilityReset object</returns>
        private ProviderAvailabilityReset CreateProviderAvailabilityResetMessage(Guid subscriberId, Guid providerId)
        {
            var provider = businessManager.GetBusinessInformationForIntegration(providerId.ToLong());

            var interfaceProductsList = ExtractRoomTypesByProvider(providerId, provider.CheckinTime, provider.CheckoutTime);

            try
            {
                return
                    ProviderAvailabilityReset.CreateProviderAvailabilityResetMessage(subscriberId.ToString(), providerId.ToString(), interfaceProductsList);
            }
            catch (Exception ex)
            {
                Logger.Error(string.Format("Unable to create ProviderAvailabilityReset message for business {0}, opted into distribution channel {1}", providerId, subscriberId), ex);
            }
            return null;
        }
开发者ID:ognjenm,项目名称:egle,代码行数:23,代码来源:AIGIntegratorService.cs

示例4: CreateProviderDistributionChangeMessage

        /// <summary>
        /// This method create a ProviderDistributionChange object
        /// </summary>
        /// <param name="subscriberId">Subscriber Id</param>
        /// <param name="providerId">Provider Id</param>        
        /// <param name="changeType">Type of change</param>
        /// <returns>ProductAvailabilityChange object</returns>
        private ProviderDistributionChange CreateProviderDistributionChangeMessage(Guid subscriberId, Guid providerId, ChangeType changeType)
        {
            switch (changeType)
            {
                case ChangeType.Insert:
                case ChangeType.Update:
                {
                    var businessId = providerId.ToLong();
                    var provider = businessManager.GetBusinessInformationForIntegration(businessId);
                    var providerDetail = businessManager.GetProviderInformation(businessId);
                    var distributor = distributorChannelDao.GetDistributorChannelInformation(subscriberId);

                    var interfaceProductsList = ExtractRoomTypesByProvider(providerId, provider.CheckinTime, provider.CheckoutTime);    //Need to add subscriberId (channelId) when rates etc are by channel

                    try
                    {
                        return ProviderDistributionChange.CreateProviderAddedDistributorMessage(
                            distributor.Id.ToString(),
                            distributor.ShortName,
                            supplyPartnerId.ToString(),
                            supplyPartnerShortName,
                            provider.Id.ToGuid().ToString(),
                            providerDetail.ContentId,
                            provider.ShortName,
                            provider.Id.ToString(CultureInfo.InvariantCulture),
                            provider.Name,
                            string.Empty,   //ConditionsOfUse??
                            interfaceProductsList);
                    }
                    catch (Exception ex)
                    {
                        Logger.Error(string.Format("Unable to create ProviderDistributionChange.CreateProviderAddedDistributorMessage message for business {0}, opted into distribution channel {1}", provider.ShortName, distributor.ShortName), ex);
                    }
                    break;
                }                    
                case ChangeType.Delete:
                    try
                    {
                        return ProviderDistributionChange.CreateProviderRemovedDistributorMessage(providerId.ToString());
                    }
                    catch (Exception ex)
                    {
                        Logger.Error(string.Format("Unable to create ProviderDistributionChange.CreateProviderRemovedDistributorMessage message for business {0}, opted into distribution channel {1}", providerId, subscriberId), ex);
                    }
                    break;
            }

            Logger.Warn(string.Format("No ProviderDistributionChange message will be sent for business {0}, opted into distribution channel {1} as there is no rooms set up that are bookable online", providerId, subscriberId));

            return null;
        }
开发者ID:ognjenm,项目名称:egle,代码行数:58,代码来源:AIGIntegratorService.cs

示例5: CreateProviderResetMessage

        private ProviderReset CreateProviderResetMessage(Guid subscriberId, Guid providerId)
        {
            var businessId = providerId.ToLong();
            var provider = businessManager.GetBusinessInformationForIntegration(businessId);
            var providerDetail = businessManager.GetProviderInformation(businessId);
            var distributor = distributorChannelDao.GetDistributorChannelInformation(subscriberId);

            var interfaceProductsList = ExtractRoomTypesByProvider(providerId, provider.CheckinTime, provider.CheckoutTime);    //Need to add subscriberId (channelId) when rates etc are by channel

            try
            {
                return ProviderReset.CreateProviderResetMessage(
                    distributor.Id.ToString(),
                    distributor.ShortName,
                    supplyPartnerId.ToString(),
                    supplyPartnerShortName,
                    provider.Id.ToGuid().ToString(),
                    providerDetail.ContentId,
                    provider.ShortName,
                    provider.Id.ToString(CultureInfo.InvariantCulture),
                    provider.Name,
                    string.Empty,   //ConditionsOfUse??
                    interfaceProductsList);
            }
            catch (Exception ex)
            {
                Logger.Error(string.Format("Unable to create ProviderReset message for business {0}, opted into distribution channel {1}", providerId, subscriberId), ex);
            }

            return null;
        }
开发者ID:ognjenm,项目名称:egle,代码行数:31,代码来源:AIGIntegratorService.cs


注:本文中的System.Guid.ToLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。