Exemple #1
0
        /// <summary>
        /// Builds the service call
        /// </summary>
        /// <param name="callName">Type of call</param>
        /// <returns></returns>
        public eBayAPIInterfaceClient EbayServiceContext(ServiceCallType callName)
        {
            var endpoint = string.Format("{0}?callname={1}&appid={2}&version={3}&routing=default",
                                         Properties.SigninUrl, callName, Properties.AppId, Properties.ServiceVersion);

            return(new eBayAPIInterfaceClient("eBayAPI", endpoint));
        }
        public IEnumerable<IServiceCharge> GetServiceChargesSupportedBy(string phoneNumber, ServiceCallType callType)
        {
            var servicesWithSupportForCallType = GetServicesSupportedByCallType(phoneNumber, callType);

            return _serviceChargeRepository.GetServiceChargesByPhoneNumber(phoneNumber)
                                                .Where(charge => servicesWithSupportForCallType
                                                                     .Any(service => service.Type == charge.ServiceType)).ToList();
        }
/// <summary>
/// Gets the call settings.
/// </summary>
/// <param name="parentSettingsId">The parent settings identifier.</param>
/// <param name="callType">Type of the call.</param>
/// <returns>IServiceCallSettings.</returns>
/// <exception cref="System.ArgumentOutOfRangeException">callType</exception>
        public IServiceCallSettings GetCallSettings(int parentSettingsId, ServiceCallType callType)
        {
            switch (callType)
            {
                case ServiceCallType.Url:
                    return UrlCallSettingsEdit.GetUrlCallSettings(parentSettingsId);
                
                case ServiceCallType.WebMethod:
                    return WebMethodCallSettingsEdit.GetWebMethodCallSettings(parentSettingsId);
                
                default:
                    throw new ArgumentOutOfRangeException("callType");
            }
        }
        /// <summary>
        /// Creates the call settings.
        /// </summary>
        /// <param name="callType">Type of the call.</param>
        /// <returns>IServiceCallSettings.</returns>
        /// <exception cref="System.ArgumentOutOfRangeException">callType</exception>
        public IServiceCallSettings CreateCallSettings(ServiceCallType callType)
        {
            switch (callType)
            {
                case ServiceCallType.Url:
                    return UrlCallSettingsEdit.NewUrlCallSettings();

                case ServiceCallType.WebMethod:
                    return WebMethodCallSettingsEdit.NewWebMethodCallSettings();
                
                default:
                    throw new ArgumentOutOfRangeException("callType");
            }
        }
        /// <summary>
        /// Refreshes the internal.
        /// </summary>
        /// <param name="model">The model.</param>
        private void RefreshInternal(ServiceCallSettingsEdit model)
        {
            if (_callType != model.CallType)
                CallSettingsViewModel = null;

            Model = model;
            _callType = Model.CallType;
            RaisePropertyChanged(() => CallType);
            RaisePropertyChanged(() => ParentService);

            if (CallSettingsViewModel == null)
                CallSettingsViewModel = CallSettingsViewModelFactory.CreateViewModel(model.CallSettings.First(), this);
            else
                CallSettingsViewModel.Refresh(model.CallSettings.First());
        }
 public bool IsServiceCallSupportedBySubscription(string phoneNumber, ServiceCallType callType)
 {
     return _serviceRepository.GetServicesForPhoneNumber(phoneNumber)
                                 .Any(service => service.HasSupportForCallType(callType));
 }
 private IEnumerable<IService> GetServicesSupportedByCallType(string phoneNumber, ServiceCallType callType)
 {
     return _serviceRepository.GetServicesForPhoneNumber(phoneNumber)
                                 .Where(service => service.HasSupportForCallType(callType))
                                     .ToList();
 }