public static string ToLabelString(
            this DurationSeparator format,
            DateTimeSettings currentSettings,
            TimeSpan sampleTime
            )
        {
            string label;

            if (format == DurationSeparator.ColonAndLetters)
            {
                label = "Colons and Letters";
            }
            else if (format == DurationSeparator.LettersOnly)
            {
                label = "Letters Only";
            }
            else // Colons only is the default.
            {
                label = "Colons Only";
            }

            DateTimeSettings settings = currentSettings with {
                DurationSeparator = format
            };

            return($"{label} ({sampleTime.ToSettingsString( settings )})");
        }
    }
 public CommonController(
     ITransactionService transactionService,
     LocalizationSettings localizationSettings,
     ICustomerPlanService customerPlanService,
     IPlanService planService,
     ICommonServices services,
     IAuthenticationService authenticationService,
     IDateTimeHelper dateTimeHelper,
     DateTimeSettings dateTimeSettings, TaxSettings taxSettings,
     ILocalizationService localizationService,
     IWorkContext workContext, IStoreContext storeContext,
     ICustomerService customerService,
     IGenericAttributeService genericAttributeService,
     IBoardService boardService,
     ICountryService countryService,
     IAdCampaignService adCampaignService)
 {
     _planService             = planService;
     _customerPlanService     = customerPlanService;
     _localizationSettings    = localizationSettings;
     _transactionService      = transactionService;
     _services                = services;
     _authenticationService   = authenticationService;
     _dateTimeHelper          = dateTimeHelper;
     _dateTimeSettings        = dateTimeSettings;
     _localizationService     = localizationService;
     _workContext             = workContext;
     _storeContext            = storeContext;
     _customerService         = customerService;
     _genericAttributeService = genericAttributeService;
     _countryService          = countryService;
     _adCampaignService       = adCampaignService;
 }
        // -------- ToLabelString --------

        public static string ToLabelString(
            this DateFormat format,
            DateTimeSettings currentSettings,
            DateTime sampleTime
            )
        {
            string label;

            if (format == DateFormat.DayMonthYear)
            {
                label = "Day Month Year";
            }
            else if (format == DateFormat.YearMonthDay)
            {
                label = "Year Month Day";
            }
            else // MonthDayYear is the default.
            {
                label = "Month Day Year";
            }

            DateTimeSettings settings = currentSettings with {
                DateFormat = format
            };

            return($"{label} ({sampleTime.ToSettingsString( settings )})");
        }
 public UserModelFactory(
     IDateTimeHelper dateTimeHelper,
     DateTimeSettings dateTimeSettings,
     ILocalizationService localizationService,
     IWorkContext workContext,
     IUserAttributeParser customerAttributeParser,
     IUserAttributeService customerAttributeService,
     IGenericAttributeService genericAttributeService,
     UserSettings customerSettings,
     IOpenAuthenticationService openAuthenticationService,
     CaptchaSettings captchaSettings,
     SecuritySettings securitySettings,
     ExternalAuthenticationSettings externalAuthenticationSettings
     )
 {
     this._dateTimeHelper                 = dateTimeHelper;
     this._dateTimeSettings               = dateTimeSettings;
     this._localizationService            = localizationService;
     this._workContext                    = workContext;
     this._customerAttributeParser        = customerAttributeParser;
     this._customerAttributeService       = customerAttributeService;
     this._genericAttributeService        = genericAttributeService;
     this._customerSettings               = customerSettings;
     this._openAuthenticationService      = openAuthenticationService;
     this._captchaSettings                = captchaSettings;
     this._securitySettings               = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
 }
 public CustomerModelFactory(AddressSettings addressSettings,
                             CaptchaSettings captchaSettings,
                             CatalogSettings catalogSettings,
                             CommonSettings commonSettings,
                             CustomerSettings customerSettings,
                             DateTimeSettings dateTimeSettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             ForumSettings forumSettings,
                             GdprSettings gdprSettings,
                             IAddressModelFactory addressModelFactory,
                             ICountryService countryService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             IDateTimeHelper dateTimeHelper,
                             IDownloadService downloadService,
                             IExternalAuthenticationService externalAuthenticationService,
                             IGdprService gdprService,
                             IGenericAttributeService genericAttributeService,
                             ILocalizationService localizationService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IPictureService pictureService,
                             IStateProvinceService stateProvinceService,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             IUrlRecordService urlRecordService,
                             IWorkContext workContext,
                             MediaSettings mediaSettings,
                             SecuritySettings securitySettings,
                             VendorSettings vendorSettings)
 {
     this._addressSettings  = addressSettings;
     this._captchaSettings  = captchaSettings;
     this._catalogSettings  = catalogSettings;
     this._commonSettings   = commonSettings;
     this._customerSettings = customerSettings;
     this._dateTimeSettings = dateTimeSettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._forumSettings                 = forumSettings;
     this._gdprSettings                  = gdprSettings;
     this._addressModelFactory           = addressModelFactory;
     this._countryService                = countryService;
     this._customerAttributeParser       = customerAttributeParser;
     this._customerAttributeService      = customerAttributeService;
     this._dateTimeHelper                = dateTimeHelper;
     this._downloadService               = downloadService;
     this._externalAuthenticationService = externalAuthenticationService;
     this._gdprService                   = gdprService;
     this._genericAttributeService       = genericAttributeService;
     this._localizationService           = localizationService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._pictureService                = pictureService;
     this._stateProvinceService          = stateProvinceService;
     this._storeContext                  = storeContext;
     this._storeMappingService           = storeMappingService;
     this._urlRecordService              = urlRecordService;
     this._workContext                   = workContext;
     this._mediaSettings                 = mediaSettings;
     this._securitySettings              = securitySettings;
     this._vendorSettings                = vendorSettings;
 }
        public new void SetUp()
        {
            _genericAttributeService = new Mock <IGenericAttributeService>();
            _settingService          = new Mock <ISettingService>();

            _workContext = new Mock <IWorkContext>();

            _tenant = new Tenant {
                Id = 1
            };
            _tenantContext = new Mock <ITenantContext>();
            _tenantContext.Setup(x => x.CurrentTenant).Returns(_tenant);

            _dateTimeSettings = new DateTimeSettings
            {
                AllowUsersToSetTimeZone = false,
                DefaultTimeZoneId       = string.Empty,
            };

            _dateTimeHelper = new DateTimeHelper(_dateTimeSettings, _genericAttributeService.Object,
                                                 _settingService.Object, _workContext.Object);

            var isUnix = Environment.OSVersion.Platform == PlatformID.Unix;

            _gmtPlus2MinskTimeZoneId       = isUnix ? "Europe/Minsk" : "E. Europe Standard Time";
            _gmtPlus3MoscowTimeZoneId      = isUnix ? "Europe/Moscow" : "Russian Standard Time";
            _gmtPlus7KrasnoyarskTimeZoneId = isUnix ? "Asia/Krasnoyarsk" : "North Asia Standard Time";
        }
Beispiel #7
0
 public CustomerRegisteredCommandHandler(
     IGenericAttributeService genericAttributeService,
     IVatService checkVatService,
     IWorkflowMessageService workflowMessageService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IAddressService addressService,
     ICustomerService customerService,
     ICustomerActionEventService customerActionEventService,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     CustomerSettings customerSettings,
     LocalizationSettings localizationSettings)
 {
     _genericAttributeService       = genericAttributeService;
     _checkVatService               = checkVatService;
     _workflowMessageService        = workflowMessageService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _addressService             = addressService;
     _customerService            = customerService;
     _customerActionEventService = customerActionEventService;
     _dateTimeSettings           = dateTimeSettings;
     _taxSettings          = taxSettings;
     _customerSettings     = customerSettings;
     _localizationSettings = localizationSettings;
 }
        public void TestInitialize()
        {
            tempGenericAttributeService = new Mock <IGenericAttributeService>();
            {
                _genericAttributeService = tempGenericAttributeService.Object;
            }

            _settingService = new Mock <ISettingService>().Object;
            _workContext    = new Mock <IWorkContext>().Object;

            _store = new Store {
                Id = "1"
            };
            var tempStoreContext = new Mock <IStoreContext>();

            {
                tempStoreContext.Setup(x => x.CurrentStore).Returns(_store);
                _storeContext = tempStoreContext.Object;
            }

            _dateTimeSettings = new DateTimeSettings {
                AllowCustomersToSetTimeZone = false,
                DefaultStoreTimeZoneId      = ""
            };

            _dateTimeHelper = new DateTimeHelper(_workContext, _dateTimeSettings);
        }
Beispiel #9
0
 public UpdateCustomerInfoCommandHandler(
     ICustomerRegistrationService customerRegistrationService,
     IGrandAuthenticationService authenticationService,
     IGenericAttributeService genericAttributeService,
     IVatService checkVatService,
     IWorkflowMessageService workflowMessageService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     DateTimeSettings dateTimeSettings,
     CustomerSettings customerSettings,
     TaxSettings taxSettings,
     LocalizationSettings localizationSettings,
     ForumSettings forumSettings)
 {
     _customerRegistrationService   = customerRegistrationService;
     _authenticationService         = authenticationService;
     _genericAttributeService       = genericAttributeService;
     _checkVatService               = checkVatService;
     _workflowMessageService        = workflowMessageService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _dateTimeSettings              = dateTimeSettings;
     _customerSettings              = customerSettings;
     _taxSettings          = taxSettings;
     _localizationSettings = localizationSettings;
     _forumSettings        = forumSettings;
 }
Beispiel #10
0
 public AccountController(
     UserSettings userSettings,
     DateTimeSettings dateTimeSettings,
     MediaSettings mediaSettings,
     IAuthenticationService authenticationService,
     IUserAccountModelFactory userAccountModelFactory,
     IUserRegistrationService userRegistrationService,
     IUserService userService,
     IUserActivityService userActivityService,
     IGenericAttributeService genericAttributeService,
     INotificationService notificationService,
     IWorkContext workContext,
     ITenantContext tenantContext,
     IEmailSender emailSender,
     IPictureService pictureService)
 {
     _userSettings            = userSettings;
     _dateTimeSettings        = dateTimeSettings;
     _mediaSettings           = mediaSettings;
     _authenticationService   = authenticationService;
     _userAccountModelFactory = userAccountModelFactory;
     _userRegistrationService = userRegistrationService;
     _userService             = userService;
     _userActivityService     = userActivityService;
     _genericAttributeService = genericAttributeService;
     _notificationService     = notificationService;
     _workContext             = workContext;
     _tenantContext           = tenantContext;
     _emailSender             = emailSender;
     _pictureService          = pictureService;
 }
 public UserController(AddressSettings addressSettings,
                       CaptchaSettings captchaSettings,
                       UserSettings userSettings,
                       DateTimeSettings dateTimeSettings,
                       IDownloadService downloadService,
                       IAddressAttributeParser addressAttributeParser,
                       IAddressModelFactory addressModelFactory,
                       IAddressService addressService,
                       IAuthenticationService authenticationService,
                       ICountryService countryService,
                       IUserActivityService userActivityService,
                       IUserAttributeParser userAttributeParser,
                       IUserAttributeService userAttributeService,
                       IUserModelFactory userModelFactory,
                       IUserRegistrationService userRegistrationService,
                       IUserService userService,
                       IEventPublisher eventPublisher,
                       IExportManager exportManager,
                       IExternalAuthenticationService externalAuthenticationService,
                       IGenericAttributeService genericAttributeService,
                       ILocalizationService localizationService,
                       INewsLetterSubscriptionService newsLetterSubscriptionService,
                       IPictureService pictureService,
                       IWebHelper webHelper,
                       IWorkContext workContext,
                       IWorkflowMessageService workflowMessageService,
                       LocalizationSettings localizationSettings,
                       MediaSettings mediaSettings,
                       SiteInformationSettings siteInformationSettings)
 {
     this._addressSettings               = addressSettings;
     this._captchaSettings               = captchaSettings;
     this._userSettings                  = userSettings;
     this._dateTimeSettings              = dateTimeSettings;
     this._downloadService               = downloadService;
     this._addressAttributeParser        = addressAttributeParser;
     this._addressModelFactory           = addressModelFactory;
     this._addressService                = addressService;
     this._authenticationService         = authenticationService;
     this._countryService                = countryService;
     this._userActivityService           = userActivityService;
     this._userAttributeParser           = userAttributeParser;
     this._userAttributeService          = userAttributeService;
     this._userModelFactory              = userModelFactory;
     this._userRegistrationService       = userRegistrationService;
     this._userService                   = userService;
     this._eventPublisher                = eventPublisher;
     this._exportManager                 = exportManager;
     this._externalAuthenticationService = externalAuthenticationService;
     this._genericAttributeService       = genericAttributeService;
     this._localizationService           = localizationService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._pictureService                = pictureService;
     this._webHelper               = webHelper;
     this._workContext             = workContext;
     this._workflowMessageService  = workflowMessageService;
     this._localizationSettings    = localizationSettings;
     this._mediaSettings           = mediaSettings;
     this._siteInformationSettings = siteInformationSettings;
 }
Beispiel #12
0
 public CustomerImporter(
     IRepository <Customer> customerRepository,
     IRepository <CustomerRole> customerRoleRepository,
     IRepository <Picture> pictureRepository,
     ICommonServices services,
     IGenericAttributeService genericAttributeService,
     IPictureService pictureService,
     IAffiliateService affiliateService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     FileDownloadManager fileDownloadManager,
     CustomerSettings customerSettings,
     DateTimeSettings dateTimeSettings,
     ForumSettings forumSettings)
 {
     _customerRepository     = customerRepository;
     _customerRoleRepository = customerRoleRepository;
     _pictureRepository      = pictureRepository;
     _services = services;
     _genericAttributeService = genericAttributeService;
     _pictureService          = pictureService;
     _affiliateService        = affiliateService;
     _countryService          = countryService;
     _stateProvinceService    = stateProvinceService;
     _fileDownloadManager     = fileDownloadManager;
     _customerSettings        = customerSettings;
     _dateTimeSettings        = dateTimeSettings;
     _forumSettings           = forumSettings;
 }
        public static string ToLabelString(
            this MonthFormat format,
            DateTimeSettings currentSettings,
            DateTime sampleTime
            )
        {
            string label;

            if (format == MonthFormat.ThreeLetters)
            {
                label = "Abbreviated";
            }
            else if (format == MonthFormat.FullMonth)
            {
                label = "Full Month";
            }
            else // Number is the default.
            {
                label = "Digit";
            }

            DateTimeSettings settings = currentSettings with {
                MonthFormat = format
            };

            return($"{label} ({sampleTime.ToSettingsString( settings )})");
        }
Beispiel #14
0
 public CustomerImporter(
     IRepository <Customer> customerRepository,
     IRepository <CustomerRole> customerRoleRepository,
     ICommonServices services,
     ICustomerService customerService,
     IGenericAttributeService genericAttributeService,
     IMediaService mediaService,
     IAffiliateService affiliateService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     FileDownloadManager fileDownloadManager,
     CustomerSettings customerSettings,
     DateTimeSettings dateTimeSettings,
     ForumSettings forumSettings,
     TaxSettings taxSettings,
     PrivacySettings privacySettings)
 {
     _customerRepository     = customerRepository;
     _customerRoleRepository = customerRoleRepository;
     _mediaService           = mediaService;
     _services                = services;
     _customerService         = customerService;
     _genericAttributeService = genericAttributeService;
     _affiliateService        = affiliateService;
     _countryService          = countryService;
     _stateProvinceService    = stateProvinceService;
     _fileDownloadManager     = fileDownloadManager;
     _customerSettings        = customerSettings;
     _dateTimeSettings        = dateTimeSettings;
     _forumSettings           = forumSettings;
     _taxSettings             = taxSettings;
     _privacySettings         = privacySettings;
 }
Beispiel #15
0
        public new void SetUp()
        {
            _genericAttributeService = new Mock <IGenericAttributeService>();
            _settingService          = new Mock <ISettingService>();

            _workContext = new Mock <IWorkContext>();

            _store = new Store {
                Id = 1
            };
            _storeContext = new Mock <IStoreContext>();
            _storeContext.Setup(x => x.CurrentStore).Returns(_store);

            _dateTimeSettings = new DateTimeSettings
            {
                AllowCustomersToSetTimeZone = false,
                DefaultStoreTimeZoneId      = ""
            };

            _dateTimeHelper = new DateTimeHelper(_dateTimeSettings, _genericAttributeService.Object,
                                                 _settingService.Object, _workContext.Object);

            gmtPlus2TimeZoneId = "E. Europe Standard Time";  //(GMT+02:00) Minsk
            gmtPlus3TimeZoneId = "Russian Standard Time";    //(GMT+03:00) Moscow, St. Petersburg, Volgograd
            gmtPlus7TimeZoneId = "North Asia Standard Time"; //(GMT+07:00) Krasnoyarsk;

            if (Environment.OSVersion.Platform == PlatformID.Unix)
            {
                gmtPlus2TimeZoneId = "Europe/Minsk";     //(GMT+02:00) Minsk;
                gmtPlus3TimeZoneId = "Europe/Moscow";    //(GMT+03:00) Moscow, St. Petersburg, Volgograd
                gmtPlus7TimeZoneId = "Asia/Krasnoyarsk"; //(GMT+07:00) Krasnoyarsk;
            }
        }
Beispiel #16
0
        public void SetUp()
        {
            _genericAttributeService = GetService <IGenericAttributeService>();
            _dateTimeSettings        = GetService <DateTimeSettings>();
            _dateTimeHelper          = GetService <IDateTimeHelper>();
            _settingService          = GetService <ISettingService>();

            _customer = GetService <ICustomerService>().GetCustomerByEmail(NopTestsDefaults.AdminEmail);

            _defaultTimeZone = _genericAttributeService.GetAttribute <string>(_customer, NopCustomerDefaults.TimeZoneIdAttribute);

            _defaultAllowCustomersToSetTimeZone = _dateTimeSettings.AllowCustomersToSetTimeZone;
            _defaultDefaultStoreTimeZoneId      = _dateTimeSettings.DefaultStoreTimeZoneId;

            _gmtPlus2MinskTimeZoneId       = "E. Europe Standard Time";  //(GMT+02:00) Minsk
            _gmtPlus3MoscowTimeZoneId      = "Russian Standard Time";    //(GMT+03:00) Moscow, St. Petersburg, Volgograd
            _gmtPlus7KrasnoyarskTimeZoneId = "North Asia Standard Time"; //(GMT+07:00) Krasnoyarsk;

            if (Environment.OSVersion.Platform != PlatformID.Unix)
            {
                return;
            }

            _gmtPlus2MinskTimeZoneId       = "Europe/Minsk";     //(GMT+02:00) Minsk;
            _gmtPlus3MoscowTimeZoneId      = "Europe/Moscow";    //(GMT+03:00) Moscow, St. Petersburg, Volgograd
            _gmtPlus7KrasnoyarskTimeZoneId = "Asia/Krasnoyarsk"; //(GMT+07:00) Krasnoyarsk;
        }
Beispiel #17
0
 public UserController(
     UserSettings userSettings,
     DateTimeSettings dateTimeSettings,
     IUserService userService,
     IUserRegistrationService userRegistrationService,
     IUserModelFactory userModelFactory,
     IGenericAttributeService genericAttributeService,
     IPermissionService permissionService,
     INotificationService notificationService,
     IUserActivityService userActivityService,
     IStoreService storeService,
     IWorkContext workContext)
 {
     _userSettings            = userSettings;
     _dateTimeSettings        = dateTimeSettings;
     _userService             = userService;
     _userRegistrationService = userRegistrationService;
     _userModelFactory        = userModelFactory;
     _genericAttributeService = genericAttributeService;
     _permissionService       = permissionService;
     _notificationService     = notificationService;
     _userActivityService     = userActivityService;
     _storeService            = storeService;
     _workContext             = workContext;
 }
 public GetInfoHandler(
     IDateTimeHelper dateTimeHelper,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     INewsletterCategoryService newsletterCategoryService,
     ILocalizationService localizationService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IExternalAuthenticationService externalAuthenticationService,
     IMediator mediator,
     CustomerSettings customerSettings,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     ForumSettings forumSettings,
     ExternalAuthenticationSettings externalAuthenticationSettings)
 {
     _dateTimeHelper = dateTimeHelper;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _newsletterCategoryService     = newsletterCategoryService;
     _localizationService           = localizationService;
     _countryService                = countryService;
     _stateProvinceService          = stateProvinceService;
     _externalAuthenticationService = externalAuthenticationService;
     _mediator         = mediator;
     _customerSettings = customerSettings;
     _dateTimeSettings = dateTimeSettings;
     _taxSettings      = taxSettings;
     _forumSettings    = forumSettings;
     _externalAuthenticationSettings = externalAuthenticationSettings;
 }
Beispiel #19
0
 public DateTimeHelper(IWorkContext workContext, IGenericAttributeService genericAttributeService, ISettingService settingService, DateTimeSettings dateTimeSettings)
 {
     _workContext             = workContext;
     _genericAttributeService = genericAttributeService;
     _settingService          = settingService;
     _dateTimeSettings        = dateTimeSettings;
 }
Beispiel #20
0
 public GetRegisterHandler(
     IDateTimeHelper dateTimeHelper,
     INewsletterCategoryService newsletterCategoryService,
     ILocalizationService localizationService,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IMediator mediator,
     CustomerSettings customerSettings,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     SecuritySettings securitySettings,
     CaptchaSettings captchaSettings)
 {
     _dateTimeHelper            = dateTimeHelper;
     _newsletterCategoryService = newsletterCategoryService;
     _localizationService       = localizationService;
     _countryService            = countryService;
     _stateProvinceService      = stateProvinceService;
     _mediator         = mediator;
     _customerSettings = customerSettings;
     _dateTimeSettings = dateTimeSettings;
     _taxSettings      = taxSettings;
     _securitySettings = securitySettings;
     _captchaSettings  = captchaSettings;
 }
Beispiel #21
0
 public CustomerController(
     ITransactionService transactionService,
     ICustomerPlanService customerPlanService,
     IPlanService planService,
     ICommonServices services,
     IAuthenticationService authenticationService,
     IDateTimeHelper dateTimeHelper,
     DateTimeSettings dateTimeSettings, TaxSettings taxSettings,
     ILocalizationService localizationService,
     IWorkContext workContext, IStoreContext storeContext,
     ICustomerService customerService,
     IGenericAttributeService genericAttributeService,
     ICustomerRegistrationService customerRegistrationService,
     ITaxService taxService, RewardPointsSettings rewardPointsSettings,
     CustomerSettings customerSettings, AddressSettings addressSettings, ForumSettings forumSettings,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IPictureService pictureService, INewsLetterSubscriptionService newsLetterSubscriptionService,
     ICustomerActivityService customerActivityService,
     MediaSettings mediaSettings,
     LocalizationSettings localizationSettings,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     PluginMediator pluginMediator,
     IPermissionService permissionService,
     IBoardService boardService,
     ICountryService countryService,
     IAuthenticationService formsAuthenticationService,
     IAdCampaignService adCampaignService)
 {
     _planService                    = planService;
     _customerPlanService            = customerPlanService;
     _transactionService             = transactionService;
     _services                       = services;
     _authenticationService          = authenticationService;
     _dateTimeHelper                 = dateTimeHelper;
     _dateTimeSettings               = dateTimeSettings;
     _localizationService            = localizationService;
     _workContext                    = workContext;
     _storeContext                   = storeContext;
     _customerService                = customerService;
     _genericAttributeService        = genericAttributeService;
     _customerRegistrationService    = customerRegistrationService;
     _taxService                     = taxService;
     _customerSettings               = customerSettings;
     _currencyService                = currencyService;
     _priceFormatter                 = priceFormatter;
     _pictureService                 = pictureService;
     _newsLetterSubscriptionService  = newsLetterSubscriptionService;
     _customerActivityService        = customerActivityService;
     _mediaSettings                  = mediaSettings;
     _localizationSettings           = localizationSettings;
     _externalAuthenticationSettings = externalAuthenticationSettings;
     _pluginMediator                 = pluginMediator;
     _permissionService              = permissionService;
     _boardService                   = boardService;
     _countryService                 = countryService;
     _formsAuthenticationService     = formsAuthenticationService;
     _adCampaignService              = adCampaignService;
 }
Beispiel #22
0
 public CustomerModelFactory(CaptchaSettings captchaSettings,
                             DateTimeSettings dateTimeSettings,
                             ILocalizationService localizationService)
 {
     this._captchaSettings     = captchaSettings;
     this._dateTimeSettings    = dateTimeSettings;
     this._localizationService = localizationService;
 }
 private void EqualsFailureTest(DateTimeSettings left, DateTimeSettings right)
 {
     Assert.IsFalse(left.Equals(right));
     Assert.IsFalse(right.Equals(left));
     Assert.IsFalse(left == right);
     Assert.IsFalse(right == left);;
     Assert.IsTrue(left != right);
     Assert.IsTrue(right != left);;
 }
 public DateTimeHelper(
     ICommonServices services,
     IWorkContext workContext,
     DateTimeSettings dateTimeSettings)
 {
     _services         = services;
     _workContext      = workContext;
     _dateTimeSettings = dateTimeSettings;
 }
Beispiel #25
0
 void OnEnable()
 {
     dt = (DateTimeSettings)target;
     dt.Reset();
     playTex      = Resources.Load("Textures/play-button") as Texture;
     pauseTex     = Resources.Load("Textures/pause-button") as Texture;
     playPauseTex = playTex;
     lastUpdate   = EditorApplication.timeSinceStartup;
 }
        public static DateTimeSettingsModel ToModel(this DateTimeSettings dateTimeSettings)
        {
            var model = new DateTimeSettingsModel()
            {
                DefaultTimeZoneId = dateTimeSettings.DefaultTimeZoneId
            };

            return(model);
        }
 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,
                             OrderSettings orderSettings,
                             ICountryService countryService,
                             IStateProvinceService stateProvinceService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOpenAuthenticationService openAuthenticationService,
                             IDownloadService downloadService,
                             MediaSettings mediaSettings,
                             CaptchaSettings captchaSettings,
                             SecuritySettings securitySettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             CatalogSettings catalogSettings
                             )
 {
     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._orderSettings                  = orderSettings;
     this._countryService                 = countryService;
     this._stateProvinceService           = stateProvinceService;
     this._orderService                   = orderService;
     this._pictureService                 = pictureService;
     this._newsLetterSubscriptionService  = newsLetterSubscriptionService;
     this._openAuthenticationService      = openAuthenticationService;
     this._downloadService                = downloadService;
     this._mediaSettings                  = mediaSettings;
     this._captchaSettings                = captchaSettings;
     this._securitySettings               = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._catalogSettings                = catalogSettings;
 }
        public static DateTime ToTimeZoneTime(this DateTime date, DateTimeSettings settings)
        {
            TimeZoneInfo tz = settings.GetTimeZoneInfo();

            return(TimeZoneInfo.ConvertTime(
                       date,
                       TimeZoneInfo.Utc,
                       tz
                       ));
        }
Beispiel #29
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="workContext">Work context</param>
 /// <param name="genericAttributeService">Generic attribute service</param>
 /// <param name="settingService">Setting service</param>
 /// <param name="dateTimeSettings">Datetime settings</param>
 public DateTimeHelper(IWorkContext workContext,
     IGenericAttributeService genericAttributeService,
     ISettingService settingService, 
     DateTimeSettings dateTimeSettings)
 {
     this._workContext = workContext;
     this._genericAttributeService = genericAttributeService;
     this._settingService = settingService;
     this._dateTimeSettings = dateTimeSettings;
 }
Beispiel #30
0
 public DateTimeHelper(
     SmartDbContext db,
     ISettingService settingService,
     IWorkContext workContext,
     DateTimeSettings dateTimeSettings)
 {
     _db               = db;
     _settingService   = settingService;
     _workContext      = workContext;
     _dateTimeSettings = dateTimeSettings;
 }
Beispiel #31
0
        public IHttpActionResult Post(DateTimeSettingsModel entityModel)
        {
            var dateTimeSettings = new DateTimeSettings()
            {
                DefaultTimeZoneId = entityModel.DefaultTimeZoneId
            };

            _settingService.Save(dateTimeSettings);
            VerboseReporter.ReportSuccess("Settings saved successfully", "post_setting");
            return(RespondSuccess(new { DateTimeSettings = dateTimeSettings.ToModel() }));
        }