コード例 #1
0
ファイル: HomeTask.cs プロジェクト: rodmjay/Trul
 public HomeTask(ICountryService countryService, IPersonService personService, IMenuService menuService, IUserService userService)
 {
     this.countryService = countryService;
     this.personService = personService;
     this.menuService = menuService;
     this.userService = userService;
 }
コード例 #2
0
 public ShippingUPSController(UPSSettings upsSettings, ISettingService settingService,
     ICountryService countryService)
 {
     this._upsSettings = upsSettings;
     this._settingService = settingService;
     this._countryService = countryService;
 }
コード例 #3
0
 public ShippingByWeightController(IShippingService shippingService,
     IStoreService storeService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     ShippingByWeightSettings shippingByWeightSettings,
     IShippingByWeightService shippingByWeightService,
     ISettingService settingService,
     ILocalizationService localizationService,
     IPermissionService permissionService,
     ICurrencyService currencyService,
     CurrencySettings currencySettings,
     IMeasureService measureService,
     MeasureSettings measureSettings)
 {
     this._shippingService = shippingService;
     this._storeService = storeService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._shippingByWeightSettings = shippingByWeightSettings;
     this._shippingByWeightService = shippingByWeightService;
     this._settingService = settingService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._currencyService = currencyService;
     this._currencySettings = currencySettings;
     this._measureService = measureService;
     this._measureSettings = measureSettings;
 }
コード例 #4
0
        public CountryController(
			IAuditService<Country, CountryAudit> auditService,
			ICountryService countryService)
        {
            this.AuditService = auditService;
            this.CountryService = countryService;
        }
コード例 #5
0
 public CountryController(ICountryService countryService,
     IStateProvinceService stateProvinceService,
     ICityService cityService,
     IZipcodeService zipcodeService,
     ILocalizationService localizationService,
     IAddressService addressService,
     IPermissionService permissionService,
     ILocalizedEntityService localizedEntityService,
     ILanguageService languageService,
     IStoreService storeService,
     IStoreMappingService storeMappingService,
     IExportManager exportManager,
     IImportManager importManager)
 {
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._cityService = cityService;
     this._zipcodeService = zipcodeService;
     this._localizationService = localizationService;
     this._addressService = addressService;
     this._permissionService = permissionService;
     this._localizedEntityService = localizedEntityService;
     this._languageService = languageService;
     this._storeService = storeService;
     this._storeMappingService = storeMappingService;
     this._exportManager = exportManager;
     this._importManager = importManager;
 }
コード例 #6
0
ファイル: TaxServiceTests.cs プロジェクト: nvolpe/raver
        public new void SetUp()
        {
            _taxSettings = new TaxSettings();
            _taxSettings.DefaultTaxAddressId = 10;

            _workContext = null;

            _addressService = MockRepository.GenerateMock<IAddressService>();
            //default tax address
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId });

            var pluginFinder = new PluginFinder();

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _geoLookupService = MockRepository.GenerateMock<IGeoLookupService>();
            _countryService = MockRepository.GenerateMock<ICountryService>();
            _logger = MockRepository.GenerateMock<ILogger>();
            _customerSettings = new CustomerSettings();
            _addressSettings = new AddressSettings();

            _taxService = new TaxService(_addressService, _workContext, _taxSettings,
                pluginFinder, _geoLookupService, _countryService, _logger
                , _customerSettings, _addressSettings);
        }
コード例 #7
0
 public SettingController(ISettingService settingService,
     ICountryService countryService, IStateProvinceService stateProvinceService,
     IAddressService addressService, ITaxCategoryService taxCategoryService,
     ICurrencyService currencyService, IPictureService pictureService, 
     ILocalizationService localizationService, IDateTimeHelper dateTimeHelper,
     IOrderService orderService, IEncryptionService encryptionService,
     IThemeProvider themeProvider, ICustomerService customerService, 
     ICustomerActivityService customerActivityService, IPermissionService permissionService,
     IWebHelper webHelper, IFulltextService fulltextService, 
     IMaintenanceService maintenanceService, IStoreService storeService,
     IWorkContext workContext, IGenericAttributeService genericAttributeService)
 {
     this._settingService = settingService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._addressService = addressService;
     this._taxCategoryService = taxCategoryService;
     this._currencyService = currencyService;
     this._pictureService = pictureService;
     this._localizationService = localizationService;
     this._dateTimeHelper = dateTimeHelper;
     this._orderService = orderService;
     this._encryptionService = encryptionService;
     this._themeProvider = themeProvider;
     this._customerService = customerService;
     this._customerActivityService = customerActivityService;
     this._permissionService = permissionService;
     this._webHelper = webHelper;
     this._fulltextService = fulltextService;
     this._maintenanceService = maintenanceService;
     this._storeService = storeService;
     this._workContext = workContext;
     this._genericAttributeService = genericAttributeService;
 }
コード例 #8
0
        public CheckoutController(IWorkContext workContext,
            IShoppingCartService shoppingCartService, ILocalizationService localizationService,
            ITaxService taxService, ICurrencyService currencyService,
            IPriceFormatter priceFormatter, IOrderProcessingService orderProcessingService,
            ICustomerService customerService,  ICountryService countryService,
            IStateProvinceService stateProvinceService, IShippingService shippingService,
            IPaymentService paymentService, IOrderTotalCalculationService orderTotalCalculationService,
            ILogger logger, IOrderService orderService, IWebHelper webHelper,
            OrderSettings orderSettings, RewardPointsSettings rewardPointsSettings,
            PaymentSettings paymentSettings)
        {
            this._workContext = workContext;
            this._shoppingCartService = shoppingCartService;
            this._localizationService = localizationService;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._customerService = customerService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._shippingService = shippingService;
            this._paymentService = paymentService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._logger = logger;
            this._orderService = orderService;
            this._webHelper = webHelper;

            this._orderSettings = orderSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._paymentSettings = paymentSettings;
        }
コード例 #9
0
ファイル: CountryController.cs プロジェクト: CCSW/desnivell2
 public CountryController(ICountryService countryService, IStateProvinceService stateProvinceService,
     ILocalizationService localizationService)
 {
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._localizationService = localizationService;
 }
コード例 #10
0
 public GoogleCheckoutPaymentProcessor(ISettingService settingService, 
     IWebHelper webHelper, ITaxService taxService,
     IShippingService shippingService, 
     IOrderTotalCalculationService orderTotalCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     IPriceCalculationService priceCalculationService, IWorkContext workContext,
     ICustomerService customerService, IGenericAttributeService genericAttributeService, 
     ICountryService countryService,
     IStateProvinceService stateProvinceService, IOrderProcessingService orderProcessingService,
     IOrderService orderService, ILogger logger, HttpContextBase httpContext)
 {
     this._settingService = settingService;
     this._webHelper = webHelper;
     this._taxService = taxService;
     this._shippingService = shippingService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._productAttributeFormatter = productAttributeFormatter;
     this._priceCalculationService = priceCalculationService;
     this._workContext = workContext;
     this._customerService = customerService;
     this._genericAttributeService = genericAttributeService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._orderProcessingService = orderProcessingService;
     this._orderService = orderService;
     this._logger = logger;
     this._httpContext = httpContext;
 }
コード例 #11
0
 public DiscountRulesShippingCountryController(ILocalizationService localizationService,
     IDiscountService discountService, ICountryService countryService)
 {
     this._localizationService = localizationService;
     this._discountService = discountService;
     this._countryService = countryService;
 }
コード例 #12
0
ファイル: CampaignController.cs プロジェクト: omidam81/Ver1.0
        public CampaignController(
            ICampaignService campaignService,
            ITShirtCostService tshirtService,
            IProductService productService,
            IPromotionService promotionService,
            IRepository<CurrencyRecord> currencyRepository,
            IWorkContextAccessor wca,
            INotifier notifier,
            IOrchardServices services,
            ICookieCultureService cookieCultureService,
            ICountryService countryService)
        {
            _currencyRepository = currencyRepository;
            Services = services;
            _tshirtService = tshirtService;
            _productService = productService;
            _campaignService = campaignService;
            _promotionService = promotionService;
            _wca = wca;
            _notifier = notifier;
            Logger = NullLogger.Instance;

            _cookieCultureService = cookieCultureService;
            //var culture = _wca.GetContext().CurrentCulture.Trim();
            _cultureUsed = _wca.GetContext().CurrentCulture.Trim();
            //cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY");
            _countryService = countryService;
        }
コード例 #13
0
ファイル: TaxZoneService.cs プロジェクト: alin-rautoiu/Cart42
 public TaxZoneService(DataContext db, ITaxRateService taxRateService, ICountryService countryService, IRegionService  regionService)
 {
     this.db = db;
     this.taxRateService = taxRateService;
     this.countryService = countryService;
     this.regionService = regionService;
 }
コード例 #14
0
 public CollectibleExportService(IProductService productService, 
     ICategoryService categoryService,
     IManufacturerService manufacturerService,
     IPictureService pictureService,
     IUrlRecordService urlRecordService,
     IStoreContext storeContext,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     ICountryService countryService,   //not used
     IStateProvinceService stateProvinceService,
     IConsignorService consignorService,
     IAuthenticationService authenticationService,
     ILogger logger,
     IRepository<AUCountryLotRecord> countrylotRepo,
     IRepository<AUStateProvinceLotRecord> stateprovincelotRepo
     )
 {
     this._productService = productService;
     this._categoryService = categoryService;
     this._manufacturerService = manufacturerService;
     this._pictureService = pictureService;
     this._urlRecordService = urlRecordService;
     this._storeContext = storeContext;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._consignorService = consignorService;
     this._authenticationService = authenticationService;
     this._logger = logger;                          //NJM: AUConsignor
     this._countrylotRepo = countrylotRepo;
     this._stateprovincelotRepo = stateprovincelotRepo;
 }
コード例 #15
0
 public ShippingZoneService(DataContext db, ICountryService countryService, IRegionService regionService, IShippingMethodService shippingMethodService)
 {
     this.db = db;
     this.countryService = countryService;
     this.regionService = regionService;
     this.shippingMethodService = shippingMethodService;
 }
コード例 #16
0
ファイル: CountryController.cs プロジェクト: UHgEHEP/test
		public CountryController(
			ICountryService countries,
			IIdentityService identity)
		{
			_countries = countries;
			_identity = identity;
		}
コード例 #17
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="addressService">Address service</param>
        /// <param name="workContext">Work context</param>
        /// <param name="taxSettings">Tax settings</param>
        /// <param name="pluginFinder">Plugin finder</param>
        /// <param name="geoLookupService">GEO lookup service</param>
        /// <param name="countryService">Country service</param>
        /// <param name="customerSettings">Customer settings</param>
        /// <param name="addressSettings">Address settings</param>
        public TaxService(IAddressService addressService,
            IWorkContext workContext,
            TaxSettings taxSettings,
            IPluginFinder pluginFinder,
            IGeoLookupService geoLookupService,
            ICountryService countryService,
            CustomerSettings customerSettings,
            AddressSettings addressSettings,
            PromoSettings promoSettings,
            //IpromoService promoService,
            IPromoUtilities promoUtilities,
            ITaxServiceExtensions taxServiceExtensions)
            : base(addressService, workContext, taxSettings,
                                                    pluginFinder, geoLookupService, countryService,
                                                    customerSettings, addressSettings)
        {
            this._addressService = addressService;
            this._workContext = workContext;
            this._taxSettings = taxSettings;
            this._pluginFinder = pluginFinder;
            this._geoLookupService = geoLookupService;
            this._countryService = countryService;
            this._customerSettings = customerSettings;
            this._addressSettings = addressSettings;

            this._promoSettings = promoSettings;
            //this._promoService = promoService;
            this._promoUtilities = promoUtilities;
            this._taxServiceExtensions = taxServiceExtensions;
        }
コード例 #18
0
        private void InitializeConfigs()
        {
            csw = Container.Resolve<ICountryService>();
            lsw = Container.Resolve<ILocalService>();
            ssw = Container.Resolve<ISubdivisionService>();

            ConfigUser = new DefaultMapConfig();
                ConfigUserFullInfo = new DefaultMapConfig();
                ConfigUser.ConvertUsing((UserFullInfo usr) =>
                    new User
                    {
                        Id = usr.Id,
                        FirstName = usr.FirstName,
                        SecondName = usr.SecondName,
                        CountryId = usr.Country.Id,
                        LocationId = usr.Location.Id,
                        SubdivisionId = usr.Subdivision.Id
                    });

                ConfigUserFullInfo.ConvertUsing((User usr) =>
                    new UserFullInfo
                    {
                        Id = usr.Id,
                        FirstName = usr.FirstName,
                        SecondName = usr.SecondName,
                        Country = csw.GetCountryById(usr.CountryId),
                        Subdivision = usr.SubdivisionId != null ? ssw.GetSubdivisionById((int)usr.SubdivisionId) : null,
                        Location = usr.LocationId != null ? lsw.GetLocationById((int)usr.LocationId) : null

                    });
        }
コード例 #19
0
        public OrderController(IOrderService orderService, 
            IShipmentService shipmentService, IWorkContext workContext,
            ICurrencyService currencyService, IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService, IDateTimeHelper dateTimeHelper,
            IPaymentService paymentService, ILocalizationService localizationService,
            IPdfService pdfService, IShippingService shippingService,
            ICountryService countryService, IProductAttributeParser productAttributeParser,
            IWebHelper webHelper,
            CatalogSettings catalogSettings, OrderSettings orderSettings,
            TaxSettings taxSettings, PdfSettings pdfSettings,
            ShippingSettings shippingSettings, AddressSettings addressSettings)
        {
            this._orderService = orderService;
            this._shipmentService = shipmentService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._paymentService = paymentService;
            this._localizationService = localizationService;
            this._pdfService = pdfService;
            this._shippingService = shippingService;
            this._countryService = countryService;
            this._productAttributeParser = productAttributeParser;
            this._webHelper = webHelper;

            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._taxSettings = taxSettings;
            this._pdfSettings = pdfSettings;
            this._shippingSettings = shippingSettings;
            this._addressSettings = addressSettings;
        }
コード例 #20
0
 public ShippingController(IShippingService shippingService, 
     ShippingSettings shippingSettings,
     ISettingService settingService,
     IAddressService addressService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     ILocalizationService localizationService, 
     IPermissionService permissionService,
      ILocalizedEntityService localizedEntityService,
     ILanguageService languageService,
     IPluginFinder pluginFinder,
     IWebHelper webHelper)
 {
     this._shippingService = shippingService;
     this._shippingSettings = shippingSettings;
     this._settingService = settingService;
     this._addressService = addressService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._localizationService = localizationService;
     this._permissionService = permissionService;
     this._localizedEntityService = localizedEntityService;
     this._languageService = languageService;
     this._pluginFinder = pluginFinder;
     this._webHelper = webHelper;
 }
コード例 #21
0
 public CountryController(ICountryService countryService, IPortService portService,
     IStateProvinceService stateProvinceService, ILocalizationService localizationService)
 {
     this.countryService       = countryService;
     this.portService          = portService;
     this.stateProvinceService = stateProvinceService;
     this.localizationService  = localizationService;
 }
コード例 #22
0
 public AdminTranslationTextController(ICountryService countryService, ICultureService cultureService, IRepository<CultureRecord> cultureRepository, IWorkContextAccessor wca, IOrchardServices services)
 {
     _countryService = countryService;
     _cultureService = cultureService;
     _cultureRepository = cultureRepository;
     _wca = wca;
     Services = services;
 }
コード例 #23
0
 public ArtistViewModel(IArtistService artistService, ICategoryService categoryService,
     ICountryService countryService, Artist artist)
 {
     this.artistService = artistService;
     this.categoryService = categoryService;
     this.countryService = countryService;
     this.artist = artist;
 }
コード例 #24
0
 public static void ClassInitialize(TestContext testContext)
 {
     db = new MYSQLDatabase("Server = localhost; Database = ufotest; Uid = root;");
     catdao = new CategoryDao(db);
     coudao = new CountryDao(db);
     adao = new ArtistDao(db);
     couS = ServiceFactory.CreateCountryService(db);
 }
コード例 #25
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="addressRepository">Address repository</param>
 /// <param name="countryService">Country service</param>
 /// <param name="stateProvinceService">State/province service</param>
 /// <param name="eventPublisher">Event publisher</param>
 public AddressService(IRepository<Address> addressRepository,
     ICountryService countryService, IStateProvinceService stateProvinceService, 
     IEventPublisher eventPublisher)
 {
     this._addressRepository = addressRepository;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._eventPublisher = eventPublisher;
 }
 public TaxCountryStateZipController(ITaxCategoryService taxCategoryService,
     ICountryService countryService, IStateProvinceService stateProvinceService,
     ITaxRateService taxRateService)
 {
     this._taxCategoryService = taxCategoryService;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._taxRateService = taxRateService;
 }
コード例 #27
0
		public static string ToFormatedAddress(this Address amazonAddress, ICountryService countryService, IStateProvinceService stateProvinceService)
		{
			var sb = new StringBuilder();

			try
			{
				var city = (amazonAddress.IsSetCity() ? amazonAddress.City : null);
				var zip = (amazonAddress.IsSetPostalCode() ? amazonAddress.PostalCode : null);

				sb.AppendLine("");

				if (amazonAddress.Name.HasValue())
					sb.AppendLine(amazonAddress.Name);

				if (amazonAddress.AddressLine1.HasValue())
					sb.AppendLine(amazonAddress.AddressLine1);

				if (amazonAddress.AddressLine2.HasValue())
					sb.AppendLine(amazonAddress.AddressLine2);

				if (amazonAddress.AddressLine3.HasValue())
					sb.AppendLine(amazonAddress.AddressLine3);

				sb.AppendLine(zip.Grow(city, " "));

				if (amazonAddress.IsSetStateOrRegion())
				{
					var stateProvince = stateProvinceService.GetStateProvinceByAbbreviation(amazonAddress.StateOrRegion);

					if (stateProvince == null)
						sb.AppendLine(amazonAddress.StateOrRegion);
					else
						sb.AppendLine("{0} {1}".FormatWith(amazonAddress.StateOrRegion, stateProvince.GetLocalized(x => x.Name)));
				}

				if (amazonAddress.IsSetCountryCode())
				{
					var country = countryService.GetCountryByTwoOrThreeLetterIsoCode(amazonAddress.CountryCode);

					if (country == null)
						sb.AppendLine(amazonAddress.CountryCode);
					else
						sb.AppendLine("{0} {1}".FormatWith(amazonAddress.CountryCode, country.GetLocalized(x => x.Name)));
				}

				if (amazonAddress.Phone.HasValue())
				{
					sb.AppendLine(amazonAddress.Phone);
				}
			}
			catch (Exception exc)
			{
				exc.Dump();
			}

			return sb.ToString();
		}
コード例 #28
0
        public CheckoutController(IWorkContext workContext,
            IStoreContext storeContext,
            IStoreMappingService storeMappingService,
            IShoppingCartService shoppingCartService, 
            ILocalizationService localizationService, 
            ITaxService taxService, 
            ICurrencyService currencyService, 
            IPriceFormatter priceFormatter, 
            IOrderProcessingService orderProcessingService,
            ICustomerService customerService, 
            IGenericAttributeService genericAttributeService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            IShippingService shippingService, 
            IPaymentService paymentService,
            IPluginFinder pluginFinder,
            IOrderTotalCalculationService orderTotalCalculationService,
            ILogger logger,
            IOrderService orderService,
            IWebHelper webHelper,
            HttpContextBase httpContext,
            IMobileDeviceHelper mobileDeviceHelper,
            OrderSettings orderSettings, 
            RewardPointsSettings rewardPointsSettings,
            PaymentSettings paymentSettings,
            ShippingSettings shippingSettings,
            AddressSettings addressSettings)
        {
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._storeMappingService = storeMappingService;
            this._shoppingCartService = shoppingCartService;
            this._localizationService = localizationService;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._customerService = customerService;
            this._genericAttributeService = genericAttributeService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._shippingService = shippingService;
            this._paymentService = paymentService;
            this._pluginFinder = pluginFinder;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._logger = logger;
            this._orderService = orderService;
            this._webHelper = webHelper;
            this._httpContext = httpContext;
            this._mobileDeviceHelper = mobileDeviceHelper;

            this._orderSettings = orderSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._paymentSettings = paymentSettings;
            this._shippingSettings = shippingSettings;
            this._addressSettings = addressSettings;
        }
 public DiscountRulesBillingCountryController(ILocalizationService localizationService, 
     IDiscountService discountService, ICountryService countryService,
     ISettingService settingService)
 {
     this._localizationService = localizationService;
     this._discountService = discountService;
     this._countryService = countryService;
     this._settingService = settingService;
 }
コード例 #30
0
 public CountryController(ICountryService <Country> clientService)
 {
     _clientService = clientService;
 }
コード例 #31
0
 public CountryController(ICountryService country)
 {
     _country = country;
 }
コード例 #32
0
 public CountriesController(ICountryService countryService, IStateOrProvinceService stateOrProvinceService, IModelMapper modelMapper)
 {
     _countryService         = countryService;
     _stateOrProvinceService = stateOrProvinceService;
     _modelMapper            = modelMapper;
 }
コード例 #33
0
 public StateProvinceController(IStateProvinceService stateProvinceService, ICountryService countryService)
 {
     _stateProvinceService = stateProvinceService;
     _countryService       = countryService;
 }
コード例 #34
0
 public EmployementController(IEmployementService IEmployementService, ICityService ICityService, IStateService IStateService, ICountryService ICountryService, IUserService IUserService, IEmploymentCountService IEmploymentCountService)
 {
     this._IEmployementService = IEmployementService;
     _employement       = new EmploymentDetail();
     this._ICityService = ICityService;
     _city = new Master_City();
     this._IStateService = IStateService;
     _state = new Master_State();
     this._ICountryService = ICountryService;
     _country                      = new Master_Country();
     this._IUserService            = IUserService;
     this._IEmploymentCountService = IEmploymentCountService;
 }
コード例 #35
0
        public static void ToAddress(this OrderReferenceDetails details, SmartStore.Core.Domain.Common.Address address, ICountryService countryService,
                                     IStateProvinceService stateProvinceService, out bool countryAllowsShipping, out bool countryAllowsBilling)
        {
            countryAllowsShipping = countryAllowsBilling = true;

            if (details.IsSetBuyer() && details.Buyer.IsSetEmail())
            {
                address.Email = details.Buyer.Email;
            }

            if (details.IsSetDestination() && details.Destination.IsSetPhysicalDestination())
            {
                details.Destination.PhysicalDestination.ToAddress(address, countryService, stateProvinceService, out countryAllowsShipping, out countryAllowsBilling);
            }
        }
コード例 #36
0
 public CountryController(ICountryService service)
 {
     this._service = service ?? throw new ArgumentNullException(nameof(service));
 }
コード例 #37
0
        public ShoppingCartModelExtension(
            IShoppingCartModelFactory shoppingCartModelFactory,
            IPluginFinder pluginFinder,
            IProductService productService,
            IStoreContext storeContext,
            IWorkContext workContext,
            IShoppingCartService shoppingCartService,
            IPictureService pictureService,
            ILocalizationService localizationService,
            IProductAttributeService productAttributeService,
            IProductAttributeFormatter productAttributeFormatter,
            IProductAttributeParser productAttributeParser,
            ITaxService taxService, ICurrencyService currencyService,
            IPriceCalculationService priceCalculationService,
            IPriceFormatter priceFormatter,
            ICheckoutAttributeParser checkoutAttributeParser,
            ICheckoutAttributeFormatter checkoutAttributeFormatter,
            IOrderProcessingService orderProcessingService,
            IDiscountService discountService,
            ICustomerService customerService,
            IGiftCardService giftCardService,
            IDateRangeService dateRangeService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            IShippingService shippingService,
            IOrderTotalCalculationService orderTotalCalculationService,
            ICheckoutAttributeService checkoutAttributeService,
            IPaymentService paymentService,
            IWorkflowMessageService workflowMessageService,
            IPermissionService permissionService,
            IDownloadService downloadService,
            IStaticCacheManager cacheManager,
            IWebHelper webHelper,
            ICustomerActivityService customerActivityService,
            IGenericAttributeService genericAttributeService,
            IAddressAttributeFormatter addressAttributeFormatter,
            MediaSettings mediaSettings,
            ShoppingCartSettings shoppingCartSettings,
            CatalogSettings catalogSettings,
            OrderSettings orderSettings,
            ShippingSettings shippingSettings,
            TaxSettings taxSettings,
            CaptchaSettings captchaSettings,
            AddressSettings addressSettings,
            RewardPointsSettings rewardPointsSettings,
            CustomerSettings customerSettings) : base(
                shoppingCartModelFactory,
                productService,
                storeContext,
                workContext,
                shoppingCartService,
                pictureService,
                localizationService,
                productAttributeService,
                productAttributeParser,
                taxService,
                currencyService,
                priceCalculationService,
                priceFormatter,
                checkoutAttributeParser,
                discountService,
                customerService,
                giftCardService,
                dateRangeService,
                checkoutAttributeService,
                workflowMessageService,
                permissionService,
                downloadService,
                cacheManager,
                webHelper,
                customerActivityService,
                genericAttributeService,
                mediaSettings,
                shoppingCartSettings,
                orderSettings,
                captchaSettings,
                customerSettings
                )
        {
            this._productService            = productService;
            this._workContext               = workContext;
            this._storeContext              = storeContext;
            this._shoppingCartService       = shoppingCartService;
            this._pictureService            = pictureService;
            this._localizationService       = localizationService;
            this._productAttributeService   = productAttributeService;
            this._productAttributeFormatter = productAttributeFormatter;
            this._productAttributeParser    = productAttributeParser;
            this._taxService                   = taxService;
            this._currencyService              = currencyService;
            this._priceCalculationService      = priceCalculationService;
            this._priceFormatter               = priceFormatter;
            this._checkoutAttributeParser      = checkoutAttributeParser;
            this._checkoutAttributeFormatter   = checkoutAttributeFormatter;
            this._orderProcessingService       = orderProcessingService;
            this._discountService              = discountService;
            this._customerService              = customerService;
            this._giftCardService              = giftCardService;
            this._countryService               = countryService;
            this._stateProvinceService         = stateProvinceService;
            this._shippingService              = shippingService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._checkoutAttributeService     = checkoutAttributeService;
            this._paymentService               = paymentService;
            this._workflowMessageService       = workflowMessageService;
            this._permissionService            = permissionService;
            this._downloadService              = downloadService;
            this._cacheManager                 = cacheManager;
            this._webHelper = webHelper;
            this._customerActivityService   = customerActivityService;
            this._genericAttributeService   = genericAttributeService;
            this._addressAttributeFormatter = addressAttributeFormatter;

            this._mediaSettings            = mediaSettings;
            this._shoppingCartSettings     = shoppingCartSettings;
            this._catalogSettings          = catalogSettings;
            this._orderSettings            = orderSettings;
            this._shippingSettings         = shippingSettings;
            this._taxSettings              = taxSettings;
            this._captchaSettings          = captchaSettings;
            this._addressSettings          = addressSettings;
            this._rewardPointsSettings     = rewardPointsSettings;
            this._customerSettings         = customerSettings;
            this._shoppingCartModelFactory = shoppingCartModelFactory;
        }
コード例 #38
0
 public CountryApplication(ICountryService baseService, IMapper mapper) : base(baseService, mapper)
 {
 }
コード例 #39
0
 public CitiesController(ICityService cityService, ICountryService countryService)
 {
     this.cityService    = cityService;
     this.countryService = countryService;
 }
コード例 #40
0
 public OrderModelFactory(AddressSettings addressSettings,
                          CatalogSettings catalogSettings,
                          IAddressModelFactory addressModelFactory,
                          IAddressService addressService,
                          ICountryService countryService,
                          ICurrencyService currencyService,
                          ICustomerService customerService,
                          IDateTimeHelper dateTimeHelper,
                          IGiftCardService giftCardService,
                          ILocalizationService localizationService,
                          IOrderProcessingService orderProcessingService,
                          IOrderService orderService,
                          IOrderTotalCalculationService orderTotalCalculationService,
                          IPaymentPluginManager paymentPluginManager,
                          IPaymentService paymentService,
                          IPriceFormatter priceFormatter,
                          IProductService productService,
                          IRewardPointService rewardPointService,
                          IShipmentService shipmentService,
                          IStateProvinceService stateProvinceService,
                          IStoreContext storeContext,
                          IUrlRecordService urlRecordService,
                          IVendorService vendorService,
                          IWorkContext workContext,
                          OrderSettings orderSettings,
                          PdfSettings pdfSettings,
                          RewardPointsSettings rewardPointsSettings,
                          ShippingSettings shippingSettings,
                          TaxSettings taxSettings,
                          VendorSettings vendorSettings)
 {
     _addressSettings              = addressSettings;
     _catalogSettings              = catalogSettings;
     _addressModelFactory          = addressModelFactory;
     _addressService               = addressService;
     _countryService               = countryService;
     _currencyService              = currencyService;
     _customerService              = customerService;
     _dateTimeHelper               = dateTimeHelper;
     _giftCardService              = giftCardService;
     _localizationService          = localizationService;
     _orderProcessingService       = orderProcessingService;
     _orderService                 = orderService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentPluginManager         = paymentPluginManager;
     _paymentService               = paymentService;
     _priceFormatter               = priceFormatter;
     _productService               = productService;
     _rewardPointService           = rewardPointService;
     _shipmentService              = shipmentService;
     _stateProvinceService         = stateProvinceService;
     _storeContext                 = storeContext;
     _urlRecordService             = urlRecordService;
     _vendorService                = vendorService;
     _workContext          = workContext;
     _orderSettings        = orderSettings;
     _pdfSettings          = pdfSettings;
     _rewardPointsSettings = rewardPointsSettings;
     _shippingSettings     = shippingSettings;
     _taxSettings          = taxSettings;
     _vendorSettings       = vendorSettings;
 }
コード例 #41
0
 public CategoriesApiController(ICountryService countryService, ICategoryService categoryService)
 {
     _countryService  = countryService;
     _categoryService = categoryService;
 }
コード例 #42
0
        public CustomerInfoValidator(
            IEnumerable <IValidatorConsumer <CustomerInfoModel> > validators,
            ITranslationService translationService,
            ICountryService countryService,
            CustomerSettings customerSettings)
            : base(validators)
        {
            RuleFor(x => x.Email).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Email.Required"));
            RuleFor(x => x.Email).EmailAddress().WithMessage(translationService.GetResource("Common.WrongEmail"));

            if (customerSettings.FirstLastNameRequired)
            {
                RuleFor(x => x.FirstName).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.FirstName.Required"));
                RuleFor(x => x.LastName).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.LastName.Required"));
            }

            if (customerSettings.UsernamesEnabled && customerSettings.AllowUsersToChangeUsernames)
            {
                RuleFor(x => x.Username).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Username.Required"));
            }

            //form fields
            if (customerSettings.CountryEnabled && customerSettings.CountryRequired)
            {
                RuleFor(x => x.CountryId)
                .NotNull()
                .WithMessage(translationService.GetResource("Address.Fields.Country.Required"));
                RuleFor(x => x.CountryId)
                .NotEqual("")
                .WithMessage(translationService.GetResource("Address.Fields.Country.Required"));
            }
            if (customerSettings.CountryEnabled &&
                customerSettings.StateProvinceEnabled &&
                customerSettings.StateProvinceRequired)
            {
                RuleFor(x => x.StateProvinceId).MustAsync(async(x, y, context) =>
                {
                    var countryId = !string.IsNullOrEmpty(x.CountryId) ? x.CountryId : "";
                    var country   = await countryService.GetCountryById(countryId);
                    if (country != null && country.StateProvinces.Any())
                    {
                        //if yes, then ensure that state is selected
                        if (string.IsNullOrEmpty(y))
                        {
                            return(false);
                        }
                        if (country.StateProvinces.FirstOrDefault(x => x.Id == y) != null)
                        {
                            return(true);
                        }
                    }
                    return(false);
                }).WithMessage(translationService.GetResource("Account.Fields.StateProvince.Required"));
            }
            if (customerSettings.DateOfBirthEnabled && customerSettings.DateOfBirthRequired)
            {
                RuleFor(x => x.DateOfBirthDay).Must((x, context) =>
                {
                    var dateOfBirth = x.ParseDateOfBirth();
                    if (!dateOfBirth.HasValue)
                    {
                        return(false);
                    }

                    return(true);
                }).WithMessage(translationService.GetResource("Account.Fields.DateOfBirth.Required"));

                //minimum age
                RuleFor(x => x.DateOfBirthDay).Must((x, context) =>
                {
                    var dateOfBirth = x.ParseDateOfBirth();
                    if (dateOfBirth.HasValue && customerSettings.DateOfBirthMinimumAge.HasValue &&
                        CommonHelper.GetDifferenceInYears(dateOfBirth.Value, DateTime.Today) <
                        customerSettings.DateOfBirthMinimumAge.Value)
                    {
                        return(false);
                    }

                    return(true);
                }).WithMessage(string.Format(translationService.GetResource("Account.Fields.DateOfBirth.MinimumAge"), customerSettings.DateOfBirthMinimumAge));
            }
            if (customerSettings.CompanyRequired && customerSettings.CompanyEnabled)
            {
                RuleFor(x => x.Company).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Company.Required"));
            }
            if (customerSettings.StreetAddressRequired && customerSettings.StreetAddressEnabled)
            {
                RuleFor(x => x.StreetAddress).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.StreetAddress.Required"));
            }
            if (customerSettings.StreetAddress2Required && customerSettings.StreetAddress2Enabled)
            {
                RuleFor(x => x.StreetAddress2).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.StreetAddress2.Required"));
            }
            if (customerSettings.ZipPostalCodeRequired && customerSettings.ZipPostalCodeEnabled)
            {
                RuleFor(x => x.ZipPostalCode).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.ZipPostalCode.Required"));
            }
            if (customerSettings.CityRequired && customerSettings.CityEnabled)
            {
                RuleFor(x => x.City).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.City.Required"));
            }
            if (customerSettings.PhoneRequired && customerSettings.PhoneEnabled)
            {
                RuleFor(x => x.Phone).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Phone.Required"));
            }
            if (customerSettings.FaxRequired && customerSettings.FaxEnabled)
            {
                RuleFor(x => x.Fax).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Fax.Required"));
            }
        }
コード例 #43
0
        public void Configure(IApplicationBuilder app, ILanguageService languageService, ICountryService countryService, IWebHostEnvironment env)
        {
            var countries = countryService.GetAll();

            if (countries == null || countries.Count == 0)
            {
                throw new Exception("Countries list is empty");
            }

            foreach (var country in countries)
            {
                app.UseRewriter(new RewriteOptions()
                                .AddRedirect(@"^$", "/" + country.Path, (int)HttpStatusCode.Redirect)
                                );

                Guid countryId = country.ID;
                app.Map("/" + country.Path,
                        mapper =>
                {
                    StartupHelper.MapSite(languageService, Configuration, app, countryId);

                    mapper.UseSpa(spa =>
                    {
                        spa.Options.SourcePath = "ClientApp";
                        spa.UseAngularCliServer(npmScript: "start-" + country.Path);
                    });
                }
                        );
            }
        }
コード例 #44
0
ファイル: CountryController.cs プロジェクト: GagY23998/rs2
 public CountryController(ICountryService service, IMapper mapper) : base(service, mapper)
 {
 }
コード例 #45
0
        public static void ToAddress(this Address amazonAddress, SmartStore.Core.Domain.Common.Address address, ICountryService countryService,
                                     IStateProvinceService stateProvinceService, out bool countryAllowsShipping, out bool countryAllowsBilling)
        {
            countryAllowsShipping = countryAllowsBilling = true;

            if (amazonAddress.IsSetName())
            {
                address.ToFirstAndLastName(amazonAddress.Name);
            }

            if (amazonAddress.IsSetAddressLine1())
            {
                address.Address1 = amazonAddress.AddressLine1.TrimSafe().Truncate(4000);
            }

            if (amazonAddress.IsSetAddressLine2())
            {
                address.Address2 = amazonAddress.AddressLine2.TrimSafe().Truncate(4000);
            }

            if (amazonAddress.IsSetAddressLine3())
            {
                address.Address2 = address.Address2.Grow(amazonAddress.AddressLine3.TrimSafe(), ", ").Truncate(4000);
            }

            // normalize
            if (address.Address1.IsEmpty() && address.Address2.HasValue())
            {
                address.Address1 = address.Address2;
                address.Address2 = null;
            }
            else if (address.Address1.HasValue() && address.Address1 == address.Address2)
            {
                address.Address2 = null;
            }

            if (amazonAddress.IsSetCity())
            {
                address.City = amazonAddress.City.TrimSafe().Truncate(4000);
            }

            if (amazonAddress.IsSetPostalCode())
            {
                address.ZipPostalCode = amazonAddress.PostalCode.TrimSafe().Truncate(4000);
            }

            if (amazonAddress.IsSetPhone())
            {
                address.PhoneNumber = amazonAddress.Phone.TrimSafe().Truncate(4000);
            }

            if (amazonAddress.IsSetCountryCode())
            {
                var country = countryService.GetCountryByTwoOrThreeLetterIsoCode(amazonAddress.CountryCode);

                if (country != null)
                {
                    address.CountryId     = country.Id;
                    countryAllowsShipping = country.AllowsShipping;
                    countryAllowsBilling  = country.AllowsBilling;
                }
            }

            if (amazonAddress.IsSetStateOrRegion())
            {
                var stateProvince = stateProvinceService.GetStateProvinceByAbbreviation(amazonAddress.StateOrRegion);

                if (stateProvince != null)
                {
                    address.StateProvinceId = stateProvince.Id;
                }
            }

            //amazonAddress.District, amazonAddress.County ??

            if (address.CountryId == 0)
            {
                address.CountryId = null;
            }

            if (address.StateProvinceId == 0)
            {
                address.StateProvinceId = null;
            }
        }
コード例 #46
0
        public static string ToFormatedAddress(this Address amazonAddress, ICountryService countryService, IStateProvinceService stateProvinceService)
        {
            var sb = new StringBuilder();

            try
            {
                var city = (amazonAddress.IsSetCity() ? amazonAddress.City : null);
                var zip  = (amazonAddress.IsSetPostalCode() ? amazonAddress.PostalCode : null);

                sb.AppendLine("");

                if (amazonAddress.Name.HasValue())
                {
                    sb.AppendLine(amazonAddress.Name);
                }

                if (amazonAddress.AddressLine1.HasValue())
                {
                    sb.AppendLine(amazonAddress.AddressLine1);
                }

                if (amazonAddress.AddressLine2.HasValue())
                {
                    sb.AppendLine(amazonAddress.AddressLine2);
                }

                if (amazonAddress.AddressLine3.HasValue())
                {
                    sb.AppendLine(amazonAddress.AddressLine3);
                }

                sb.AppendLine(zip.Grow(city, " "));

                if (amazonAddress.IsSetStateOrRegion())
                {
                    var stateProvince = stateProvinceService.GetStateProvinceByAbbreviation(amazonAddress.StateOrRegion);

                    if (stateProvince == null)
                    {
                        sb.AppendLine(amazonAddress.StateOrRegion);
                    }
                    else
                    {
                        sb.AppendLine("{0} {1}".FormatWith(amazonAddress.StateOrRegion, stateProvince.GetLocalized(x => x.Name)));
                    }
                }

                if (amazonAddress.IsSetCountryCode())
                {
                    var country = countryService.GetCountryByTwoOrThreeLetterIsoCode(amazonAddress.CountryCode);

                    if (country == null)
                    {
                        sb.AppendLine(amazonAddress.CountryCode);
                    }
                    else
                    {
                        sb.AppendLine("{0} {1}".FormatWith(amazonAddress.CountryCode, country.GetLocalized(x => x.Name)));
                    }
                }

                if (amazonAddress.Phone.HasValue())
                {
                    sb.AppendLine(amazonAddress.Phone);
                }
            }
            catch (Exception exc)
            {
                exc.Dump();
            }

            return(sb.ToString());
        }
コード例 #47
0
 public CountryController(ICountryService countryService, IMapper mapper)
 {
     this._mapper         = mapper;
     this._countryService = countryService;
 }
コード例 #48
0
 public CountryController(ICountryService countryService, ICityService cityService)
 {
     _countryService = countryService;
     _cityService    = cityService;
 }
コード例 #49
0
 public CountryController(ILogger <CountryController> logger, IMapper mapper, ICountryService countryService)
 {
     _logger         = logger;
     _mapper         = mapper;
     _countryService = countryService;
 }
コード例 #50
0
 public CountriesController(AdvertisementDbContext context, ICountryService countryService)
 {
     this.countryService = countryService;
     _context            = context;
 }
コード例 #51
0
 public CountryController(ICountryService countryService)
 {
     _countryService = countryService;
 }
コード例 #52
0
 public CityController(ICityService cityService, ICountryService countryService, IPeopelService peopleService)
 {
     this._cityService    = cityService;
     this._countryService = countryService;
     this._peopleService  = peopleService;
 }
コード例 #53
0
 public CountryControllerTest()
 {
     _countryService = new CountryService(new RepCountryFake());
 }
コード例 #54
0
 public CompanyService(ApiContext context, IQualificationService qualificationService, ICountryService countryService, UserManager <User> userManager)
 {
     db = context;
     qualificationServ = qualificationService;
     countryServ       = countryService;
     _userManager      = userManager;
 }
コード例 #55
0
 public CountriesController(ICountryService countryService)
 {
     CountryService = countryService;
 }
コード例 #56
0
 public CustomerModelFactory(AddressSettings addressSettings,
                             CaptchaSettings captchaSettings,
                             CatalogSettings catalogSettings,
                             CommonSettings commonSettings,
                             CustomerSettings customerSettings,
                             DateTimeSettings dateTimeSettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             ForumSettings forumSettings,
                             GdprSettings gdprSettings,
                             IAddressModelFactory addressModelFactory,
                             IAuthenticationPluginManager authenticationPluginManager,
                             ICountryService countryService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             ICustomerService customerService,
                             IDateTimeHelper dateTimeHelper,
                             IExternalAuthenticationService externalAuthenticationService,
                             IDownloadService downloadService,
                             IGdprService gdprService,
                             IGenericAttributeService genericAttributeService,
                             ILocalizationService localizationService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             IProductService productService,
                             IReturnRequestService returnRequestService,
                             IStateProvinceService stateProvinceService,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             IUrlRecordService urlRecordService,
                             IWorkContext workContext,
                             MediaSettings mediaSettings,
                             OrderSettings orderSettings,
                             RewardPointsSettings rewardPointsSettings,
                             SecuritySettings securitySettings,
                             TaxSettings taxSettings,
                             VendorSettings vendorSettings)
 {
     _addressSettings  = addressSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _dateTimeSettings = dateTimeSettings;
     _externalAuthenticationService  = externalAuthenticationService;
     _externalAuthenticationSettings = externalAuthenticationSettings;
     _forumSettings               = forumSettings;
     _gdprSettings                = gdprSettings;
     _addressModelFactory         = addressModelFactory;
     _authenticationPluginManager = authenticationPluginManager;
     _countryService              = countryService;
     _customerAttributeParser     = customerAttributeParser;
     _customerAttributeService    = customerAttributeService;
     _customerService             = customerService;
     _dateTimeHelper              = dateTimeHelper;
     _downloadService             = downloadService;
     _gdprService                   = gdprService;
     _genericAttributeService       = genericAttributeService;
     _localizationService           = localizationService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _orderService                  = orderService;
     _pictureService                = pictureService;
     _productService                = productService;
     _returnRequestService          = returnRequestService;
     _stateProvinceService          = stateProvinceService;
     _storeContext                  = storeContext;
     _storeMappingService           = storeMappingService;
     _urlRecordService              = urlRecordService;
     _workContext                   = workContext;
     _mediaSettings                 = mediaSettings;
     _orderSettings                 = orderSettings;
     _rewardPointsSettings          = rewardPointsSettings;
     _securitySettings              = securitySettings;
     _taxSettings                   = taxSettings;
     _vendorSettings                = vendorSettings;
 }
コード例 #57
0
 public CountryCreationDtoValidator(ICountryService service)
     : base(service)
 {
 }
コード例 #58
0
 public CustomerModelFactory(IAddressModelFactory addressModelFactory,
                             IDateTimeHelper dateTimeHelper,
                             DateTimeSettings dateTimeSettings,
                             TaxSettings taxSettings,
                             ILocalizationService localizationService,
                             IWorkContext workContext,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             IGenericAttributeService genericAttributeService,
                             RewardPointsSettings rewardPointsSettings,
                             CustomerSettings customerSettings,
                             AddressSettings addressSettings,
                             ForumSettings forumSettings,
                             OrderSettings orderSettings,
                             ICountryService countryService,
                             IStateProvinceService stateProvinceService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOpenAuthenticationService openAuthenticationService,
                             IDownloadService downloadService,
                             IReturnRequestService returnRequestService,
                             MediaSettings mediaSettings,
                             CaptchaSettings captchaSettings,
                             SecuritySettings securitySettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             CatalogSettings catalogSettings,
                             VendorSettings vendorSettings)
 {
     this._addressModelFactory            = addressModelFactory;
     this._dateTimeHelper                 = dateTimeHelper;
     this._dateTimeSettings               = dateTimeSettings;
     this._taxSettings                    = taxSettings;
     this._localizationService            = localizationService;
     this._workContext                    = workContext;
     this._storeContext                   = storeContext;
     this._storeMappingService            = storeMappingService;
     this._customerAttributeParser        = customerAttributeParser;
     this._customerAttributeService       = customerAttributeService;
     this._genericAttributeService        = genericAttributeService;
     this._rewardPointsSettings           = rewardPointsSettings;
     this._customerSettings               = customerSettings;
     this._addressSettings                = addressSettings;
     this._forumSettings                  = forumSettings;
     this._orderSettings                  = orderSettings;
     this._countryService                 = countryService;
     this._stateProvinceService           = stateProvinceService;
     this._orderService                   = orderService;
     this._pictureService                 = pictureService;
     this._newsLetterSubscriptionService  = newsLetterSubscriptionService;
     this._openAuthenticationService      = openAuthenticationService;
     this._downloadService                = downloadService;
     this._returnRequestService           = returnRequestService;
     this._mediaSettings                  = mediaSettings;
     this._captchaSettings                = captchaSettings;
     this._securitySettings               = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._catalogSettings                = catalogSettings;
     this._vendorSettings                 = vendorSettings;
 }
コード例 #59
0
 public CountryController(ICountryService service, IMapper mapper)
 {
     _service = service;
     _mapper  = mapper;
 }
コード例 #60
-4
        public void Country_Get_All()
        {
            //Arrange
            data = new List<Country>() {
           new Country() { Id = 1, Name = "US" },
           new Country() { Id = 2, Name = "India" },
           new Country() { Id = 3, Name = "Russia" }
          }.AsQueryable();
            mockContext = new Mock<IContext>();
            mockSet = new Mock<IDbSet<Country>>();

           
            mockSet.Setup(m => m.Provider).Returns(data.Provider);
            mockSet.Setup(m => m.Expression).Returns(data.Expression);
            mockSet.Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());

            mockContext.SetupGet(c => c.Countries).Returns(mockSet.Object);

            _service = new CountryService(mockContext.Object);


            //Act
            IQueryable<Country> results = _service.GetAll() as IQueryable<Country>;

            //Assert
            Assert.IsNotNull(results);
            Assert.AreEqual(3, results.ToList().Count);

         
        }