當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。