public IActionResult SendPm(CustomerModel model, [FromServices] ForumSettings forumSettings)
        {
            var customer = _customerService.GetCustomerById(model.Id);

            if (customer == null)
            {
                //No customer found with the specified id
                return(RedirectToAction("List"));
            }

            try
            {
                if (!forumSettings.AllowPrivateMessages)
                {
                    throw new GrandException("Private messages are disabled");
                }
                if (customer.IsGuest())
                {
                    throw new GrandException("Customer should be registered");
                }
                if (String.IsNullOrWhiteSpace(model.SendPm.Subject))
                {
                    throw new GrandException("PM subject is empty");
                }
                if (String.IsNullOrWhiteSpace(model.SendPm.Message))
                {
                    throw new GrandException("PM message is empty");
                }

                _customerViewModelService.SendPM(customer, model.SendPm);

                SuccessNotification(_localizationService.GetResource("Admin.Customers.Customers.SendPM.Sent"));
            }
            catch (Exception exc)
            {
                ErrorNotification(exc.Message);
            }

            return(RedirectToAction("Edit", new { id = customer.Id }));
        }
Exemplo n.º 2
0
 public SitemapGenerator(BlogSettings blogSettings,
                         ForumSettings forumSettings,
                         IActionContextAccessor actionContextAccessor,
                         IBlogService blogService,
                         ICategoryService categoryService,
                         ILanguageService languageService,
                         IManufacturerService manufacturerService,
                         INewsService newsService,
                         IProductService productService,
                         IProductTagService productTagService,
                         IStoreContext storeContext,
                         ITopicService topicService,
                         IUrlHelperFactory urlHelperFactory,
                         IUrlRecordService urlRecordService,
                         IWebHelper webHelper,
                         LocalizationSettings localizationSettings,
                         NewsSettings newsSettings,
                         SecuritySettings securitySettings,
                         SitemapXmlSettings sitemapSettings)
 {
     _blogSettings          = blogSettings;
     _forumSettings         = forumSettings;
     _actionContextAccessor = actionContextAccessor;
     _blogService           = blogService;
     _categoryService       = categoryService;
     _languageService       = languageService;
     _manufacturerService   = manufacturerService;
     _newsService           = newsService;
     _productService        = productService;
     _productTagService     = productTagService;
     _storeContext          = storeContext;
     _topicService          = topicService;
     _urlHelperFactory      = urlHelperFactory;
     _urlRecordService      = urlRecordService;
     _webHelper             = webHelper;
     _localizationSettings  = localizationSettings;
     _newsSettings          = newsSettings;
     _securitySettings      = securitySettings;
     _sitemapXmlSettings    = sitemapSettings;
 }
 public BoardsViewModelService(IForumService forumService,
                               ILocalizationService localizationService,
                               IPictureService pictureService,
                               ICountryService countryService,
                               IWorkContext workContext,
                               ForumSettings forumSettings,
                               CustomerSettings customerSettings,
                               MediaSettings mediaSettings,
                               IDateTimeHelper dateTimeHelper,
                               IServiceProvider serviceProvider)
 {
     _forumService        = forumService;
     _localizationService = localizationService;
     _pictureService      = pictureService;
     _countryService      = countryService;
     _workContext         = workContext;
     _forumSettings       = forumSettings;
     _customerSettings    = customerSettings;
     _mediaSettings       = mediaSettings;
     _dateTimeHelper      = dateTimeHelper;
     _serviceProvider     = serviceProvider;
 }
Exemplo n.º 4
0
 public ProfileController(IForumService forumService,
                          ILocalizationService localizationService,
                          IPictureService pictureService,
                          ICountryService countryService,
                          ICustomerService customerService,
                          IDateTimeHelper dateTimeHelper,
                          IPermissionService permissionService,
                          ForumSettings forumSettings,
                          CustomerSettings customerSettings,
                          MediaSettings mediaSettings)
 {
     this._forumService        = forumService;
     this._localizationService = localizationService;
     this._pictureService      = pictureService;
     this._countryService      = countryService;
     this._customerService     = customerService;
     this._permissionService   = permissionService;
     this._dateTimeHelper      = dateTimeHelper;
     this._forumSettings       = forumSettings;
     this._customerSettings    = customerSettings;
     this._mediaSettings       = mediaSettings;
 }
 public ProfileModelFactory(CustomerSettings customerSettings,
                            ForumSettings forumSettings,
                            ICountryService countryService,
                            ICustomerService customerService,
                            IDateTimeHelper dateTimeHelper,
                            IForumService forumService,
                            IGenericAttributeService genericAttributeService,
                            ILocalizationService localizationService,
                            IPictureService pictureService,
                            MediaSettings mediaSettings)
 {
     this._customerSettings        = customerSettings;
     this._forumSettings           = forumSettings;
     this._countryService          = countryService;
     this._customerService         = customerService;
     this._dateTimeHelper          = dateTimeHelper;
     this._forumService            = forumService;
     this._genericAttributeService = genericAttributeService;
     this._localizationService     = localizationService;
     this._pictureService          = pictureService;
     this._mediaSettings           = mediaSettings;
 }
Exemplo n.º 6
0
 public SitemapGenerator(IStoreContext storeContext,
                         ICategoryService categoryService,
                         IProductService productService,
                         IManufacturerService manufacturerService,
                         ITopicService topicService,
                         CommonSettings commonSettings,
                         BlogSettings blogSettings,
                         NewsSettings newsSettings,
                         ForumSettings forumSettings,
                         SecuritySettings securitySettings)
 {
     this._storeContext        = storeContext;
     this._categoryService     = categoryService;
     this._productService      = productService;
     this._manufacturerService = manufacturerService;
     this._topicService        = topicService;
     this._commonSettings      = commonSettings;
     this._blogSettings        = blogSettings;
     this._newsSettings        = newsSettings;
     this._forumSettings       = forumSettings;
     this._securitySettings    = securitySettings;
 }
 public BusinessPageApiController(IForumService forumService, ILocalizationService localizationService,
                                  IPictureService pictureService, ICountryService countryService,
                                  ICustomerService customerService, IDateTimeHelper dateTimeHelper,
                                  ForumSettings forumSettings, CustomerSettings customerSettings,
                                  MediaSettings mediaSettings, IBusinessPageService businessPageService,
                                  mobSocialSettings mobSocialSettings, IEventPageAttendanceService eventPageAttendanceService,
                                  IMobSocialService mobSocialService, IWorkContext workContext, IStateProvinceService stateProvinceService)
 {
     _localizationService        = localizationService;
     _pictureService             = pictureService;
     _countryService             = countryService;
     _customerService            = customerService;
     _dateTimeHelper             = dateTimeHelper;
     _forumSettings              = forumSettings;
     _customerSettings           = customerSettings;
     _mediaSettings              = mediaSettings;
     _businessPageService        = businessPageService;
     _eventPageAttendanceService = eventPageAttendanceService;
     _mobSocialSettings          = mobSocialSettings;
     _mobSocialService           = mobSocialService;
     _workContext          = workContext;
     _stateProvinceService = stateProvinceService;
 }
Exemplo n.º 8
0
 public EventPageController(IForumService forumService, ILocalizationService localizationService,
                            IPictureService pictureService, ICountryService countryService,
                            ICustomerService customerService, IDateTimeHelper dateTimeHelper,
                            ForumSettings forumSettings, CustomerSettings customerSettings,
                            MediaSettings mediaSettings, IEventPageService eventPageService,
                            mobSocialSettings mobSocialSettings, IEventPageAttendanceService eventPageAttendanceService,
                            IMobSocialService mobSocialService, IWorkContext workContext)
 {
     _forumService               = forumService;
     _localizationService        = localizationService;
     _pictureService             = pictureService;
     _countryService             = countryService;
     _customerService            = customerService;
     _dateTimeHelper             = dateTimeHelper;
     _forumSettings              = forumSettings;
     _customerSettings           = customerSettings;
     _mediaSettings              = mediaSettings;
     _eventPageService           = eventPageService;
     _eventPageAttendanceService = eventPageAttendanceService;
     _mobSocialSettings          = mobSocialSettings;
     _mobSocialService           = mobSocialService;
     _workContext = workContext;
 }
Exemplo n.º 9
0
 public SitemapGenerator(IStoreContext storeContext,
                         ICategoryService categoryService,
                         IArticleService articleService,
                         IPublisherService publisherService,
                         ITopicService topicService,
                         IWebHelper webHelper,
                         CommonSettings commonSettings,
                         BlogSettings blogSettings,
                         NewsSettings newsSettings,
                         ForumSettings forumSettings,
                         SecuritySettings securitySettings)
 {
     this._storeContext     = storeContext;
     this._categoryService  = categoryService;
     this._articleService   = articleService;
     this._publisherService = publisherService;
     this._topicService     = topicService;
     this._webHelper        = webHelper;
     this._commonSettings   = commonSettings;
     this._blogSettings     = blogSettings;
     this._newsSettings     = newsSettings;
     this._forumSettings    = forumSettings;
     this._securitySettings = securitySettings;
 }
Exemplo n.º 10
0
 public SitemapGenerator(IStoreContext storeContext,
                         ICategoryService categoryService,
                         IProductService productService,
                         IManufacturerService manufacturerService,
                         ITopicService topicService,
                         IWebHelper webHelper,
                         CommonSettings commonSettings,
                         BlogSettings blogSettings,
                         KnowledgebaseSettings knowledgebaseSettings,
                         NewsSettings newsSettings,
                         ForumSettings forumSettings)
 {
     _storeContext          = storeContext;
     _categoryService       = categoryService;
     _productService        = productService;
     _manufacturerService   = manufacturerService;
     _topicService          = topicService;
     _webHelper             = webHelper;
     _commonSettings        = commonSettings;
     _blogSettings          = blogSettings;
     _knowledgebaseSettings = knowledgebaseSettings;
     _newsSettings          = newsSettings;
     _forumSettings         = forumSettings;
 }
Exemplo n.º 11
0
 public CommonController(
     ICommonWebService commonWebService,
     ILocalizationService localizationService,
     IWorkContext workContext,
     IStoreContext storeContext,
     IStoreService storeService,
     ICustomerActivityService customerActivityService,
     ICustomerActionEventService customerActionEventService,
     IPopupService popupService,
     IInteractiveFormService interactiveFormService,
     ILogger logger,
     StoreInformationSettings storeInformationSettings,
     CommonSettings commonSettings,
     ForumSettings forumSettings,
     LocalizationSettings localizationSettings,
     CaptchaSettings captchaSettings,
     VendorSettings vendorSettings
     )
 {
     this._commonWebService           = commonWebService;
     this._localizationService        = localizationService;
     this._workContext                = workContext;
     this._storeContext               = storeContext;
     this._storeService               = storeService;
     this._customerActivityService    = customerActivityService;
     this._customerActionEventService = customerActionEventService;
     this._popupService               = popupService;
     this._interactiveFormService     = interactiveFormService;
     this._logger = logger;
     this._storeInformationSettings = storeInformationSettings;
     this._commonSettings           = commonSettings;
     this._forumSettings            = forumSettings;
     this._localizationSettings     = localizationSettings;
     this._captchaSettings          = captchaSettings;
     this._vendorSettings           = vendorSettings;
 }
Exemplo n.º 12
0
 public ProfileModelFactory(CustomerSettings customerSettings,
                            ForumSettings forumSettings,
                            ICountryService countryService,
                            ICustomerService customerService,
                            IDateTimeHelper dateTimeHelper,
                            IForumService forumService,
                            IGenericAttributeService genericAttributeService,
                            ILocalizationService localizationService,
                            IPictureService pictureService,
                            IWorkContext workContext,
                            MediaSettings mediaSettings)
 {
     _customerSettings        = customerSettings;
     _forumSettings           = forumSettings;
     _countryService          = countryService;
     _customerService         = customerService;
     _dateTimeHelper          = dateTimeHelper;
     _forumService            = forumService;
     _genericAttributeService = genericAttributeService;
     _localizationService     = localizationService;
     _pictureService          = pictureService;
     _workContext             = workContext;
     _mediaSettings           = mediaSettings;
 }
Exemplo n.º 13
0
 public SitemapGenerator(BlogSettings blogSettings,
                         CommonSettings commonSettings,
                         ForumSettings forumSettings,
                         IActionContextAccessor actionContextAccessor,
                         ICategoryService categoryService,
                         ILanguageService languageService,
                         IManufacturerService manufacturerService,
                         IProductService productService,
                         IProductTagService productTagService,
                         IStoreContext storeContext,
                         ITopicService topicService,
                         IUrlHelperFactory urlHelperFactory,
                         IUrlRecordService urlRecordService,
                         IWebHelper webHelper,
                         LocalizationSettings localizationSettings,
                         NewsSettings newsSettings,
                         SecuritySettings securitySettings)
 {
     this._blogSettings          = blogSettings;
     this._commonSettings        = commonSettings;
     this._forumSettings         = forumSettings;
     this._actionContextAccessor = actionContextAccessor;
     this._categoryService       = categoryService;
     this._languageService       = languageService;
     this._manufacturerService   = manufacturerService;
     this._productService        = productService;
     this._productTagService     = productTagService;
     this._storeContext          = storeContext;
     this._topicService          = topicService;
     this._urlHelperFactory      = urlHelperFactory;
     this._urlRecordService      = urlRecordService;
     this._webHelper             = webHelper;
     this._localizationSettings  = localizationSettings;
     this._newsSettings          = newsSettings;
     this._securitySettings      = securitySettings;
 }
Exemplo n.º 14
0
 public BoardsViewModelService(IForumService forumService,
                               ILocalizationService localizationService,
                               IPictureService pictureService,
                               ICountryService countryService,
                               IWebHelper webHelper,
                               IWorkContext workContext,
                               IStoreContext storeContext,
                               ForumSettings forumSettings,
                               CustomerSettings customerSettings,
                               MediaSettings mediaSettings,
                               IDateTimeHelper dateTimeHelper)
 {
     this._forumService        = forumService;
     this._localizationService = localizationService;
     this._pictureService      = pictureService;
     this._countryService      = countryService;
     this._webHelper           = webHelper;
     this._workContext         = workContext;
     this._storeContext        = storeContext;
     this._forumSettings       = forumSettings;
     this._customerSettings    = customerSettings;
     this._mediaSettings       = mediaSettings;
     this._dateTimeHelper      = dateTimeHelper;
 }
 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;
 }
Exemplo n.º 16
0
 public static ForumSettings ToEntity(this ForumSettingsModel model, ForumSettings destination)
 {
     return(Mapper.Map(model, destination));
 }
Exemplo n.º 17
0
 public static ForumSettingsModel ToModel(this ForumSettings entity)
 {
     return(Mapper.Map <ForumSettings, ForumSettingsModel>(entity));
 }
Exemplo n.º 18
0
        private static ForumSettingItem GetForumSettingItem(List<TempForum> forums, int forumID, ForumSettings forumSettings, ref bool? isParentSetting)
        {
            foreach (ForumSettingItem item in forumSettings.Items)
            {
                if (item.ForumID == forumID)
                {
                    if (isParentSetting == null)
                    {
                        isParentSetting = false;
                    }
                    return item;
                }
            }

            isParentSetting = true;

            foreach (TempForum temp in forums)
            {
                if (temp.ForumID == forumID)
                {
                    return SettingManager.CloneSetttings<ForumSettingItem>(GetForumSettingItem(forums, temp.ParentID, forumSettings, ref isParentSetting));
                }
            }

            return SettingManager.CloneSetttings<ForumSettingItem>(GetForumSettingItem(forums, 0, forumSettings, ref isParentSetting));
        }
Exemplo n.º 19
0
 public static ForumSettings ToEntity(this ForumSettingsModel model, ForumSettings destination)
 {
     return(model.MapTo(destination));
 }
        public GBSLoginController(IAddressModelFactory addressModelFactory,
                                  ICustomerModelFactory customerModelFactory,
                                  IAuthenticationService authenticationService,
                                  DateTimeSettings dateTimeSettings,
                                  TaxSettings taxSettings,
                                  ILocalizationService localizationService,
                                  IWorkContext workContext,
                                  IStoreContext storeContext,
                                  ICustomerService customerService,
                                  ICustomerAttributeParser customerAttributeParser,
                                  ICustomerAttributeService customerAttributeService,
                                  IGenericAttributeService genericAttributeService,
                                  ICustomerRegistrationService customerRegistrationService,
                                  ITaxService taxService,
                                  CustomerSettings customerSettings,
                                  AddressSettings addressSettings,
                                  ForumSettings forumSettings,
                                  IAddressService addressService,
                                  ICountryService countryService,
                                  IOrderService orderService,
                                  IPictureService pictureService,
                                  INewsLetterSubscriptionService newsLetterSubscriptionService,
                                  IShoppingCartService shoppingCartService,
                                  IWebHelper webHelper,
                                  ICustomerActivityService customerActivityService,
                                  IAddressAttributeParser addressAttributeParser,
                                  IAddressAttributeService addressAttributeService,
                                  IStoreService storeService,
                                  IEventPublisher eventPublisher,
                                  MediaSettings mediaSettings,
                                  IWorkflowMessageService workflowMessageService,
                                  LocalizationSettings localizationSettings,
                                  CaptchaSettings captchaSettings,
                                  StoreInformationSettings storeInformationSettings,
                                  ILogger logger,
                                  CaptchaSettings _captchaSettings,
                                  IExternalAuthenticationService externalAuthenticationService)
        {
            this._addressModelFactory         = addressModelFactory;
            this._customerModelFactory        = customerModelFactory;
            this._authenticationService       = authenticationService;
            this._dateTimeSettings            = dateTimeSettings;
            this._taxSettings                 = taxSettings;
            this._localizationService         = localizationService;
            this._workContext                 = workContext;
            this._storeContext                = storeContext;
            this._customerService             = customerService;
            this._customerAttributeParser     = customerAttributeParser;
            this._customerAttributeService    = customerAttributeService;
            this._genericAttributeService     = genericAttributeService;
            this._customerRegistrationService = customerRegistrationService;
            this._taxService       = taxService;
            this._customerSettings = customerSettings;
            this._addressSettings  = addressSettings;
            this._forumSettings    = forumSettings;
            this._addressService   = addressService;
            this._countryService   = countryService;
            this._orderService     = orderService;
            this._pictureService   = pictureService;
            this._newsLetterSubscriptionService = newsLetterSubscriptionService;
            this._shoppingCartService           = shoppingCartService;
            this._webHelper = webHelper;
            this._customerActivityService  = customerActivityService;
            this._addressAttributeParser   = addressAttributeParser;
            this._addressAttributeService  = addressAttributeService;
            this._storeService             = storeService;
            this._eventPublisher           = eventPublisher;
            this._mediaSettings            = mediaSettings;
            this._workflowMessageService   = workflowMessageService;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._logger = logger;
            this._externalAuthenticationService = externalAuthenticationService;

            this._baseNopCustomerController = new Nop.Web.Controllers.CustomerController(
                this._addressModelFactory,
                this._customerModelFactory,
                this._authenticationService,
                this._dateTimeSettings,
                this._taxSettings,
                this._localizationService,
                this._workContext,
                this._storeContext,
                this._customerService,
                this._customerAttributeParser,
                this._customerAttributeService,
                this._genericAttributeService,
                this._customerRegistrationService,
                this._taxService,
                this._customerSettings,
                this._addressSettings,
                this._forumSettings,
                this._addressService,
                this._countryService,
                this._orderService,
                this._pictureService,
                this._newsLetterSubscriptionService,
                this._shoppingCartService,
                this._externalAuthenticationService,
                this._webHelper,
                this._customerActivityService,
                this._addressAttributeParser,
                this._addressAttributeService,
                this._eventPublisher,
                this._mediaSettings,
                this._workflowMessageService,
                this._localizationSettings,
                this._captchaSettings,
                this._storeInformationSettings);
        }
Exemplo n.º 21
0
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHostingEnvironment hostingEnvironment,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INopFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager cacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           NewsSettings newsSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     this._blogSettings     = blogSettings;
     this._captchaSettings  = captchaSettings;
     this._catalogSettings  = catalogSettings;
     this._commonSettings   = commonSettings;
     this._customerSettings = customerSettings;
     this._displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     this._forumSettings           = forumSettings;
     this._actionContextAccessor   = actionContextAccessor;
     this._categoryService         = categoryService;
     this._currencyService         = currencyService;
     this._customerService         = customerService;
     this._forumService            = forumService;
     this._genericAttributeService = genericAttributeService;
     this._hostingEnvironment      = hostingEnvironment;
     this._languageService         = languageService;
     this._localizationService     = localizationService;
     this._manufacturerService     = manufacturerService;
     this._fileProvider            = fileProvider;
     this._pageHeadBuilder         = pageHeadBuilder;
     this._permissionService       = permissionService;
     this._pictureService          = pictureService;
     this._productService          = productService;
     this._productTagService       = productTagService;
     this._sitemapGenerator        = sitemapGenerator;
     this._cacheManager            = cacheManager;
     this._storeContext            = storeContext;
     this._themeContext            = themeContext;
     this._themeProvider           = themeProvider;
     this._topicService            = topicService;
     this._urlHelperFactory        = urlHelperFactory;
     this._urlRecordService        = urlRecordService;
     this._webHelper                = webHelper;
     this._workContext              = workContext;
     this._localizationSettings     = localizationSettings;
     this._newsSettings             = newsSettings;
     this._storeInformationSettings = storeInformationSettings;
     this._vendorSettings           = vendorSettings;
 }
Exemplo n.º 22
0
 public CustomerViewModelService(
     IExternalAuthenticationService externalAuthenticationService,
     ICustomerAttributeParser customerAttributeParser,
     ICustomerAttributeService customerAttributeService,
     ILocalizationService localizationService,
     IDateTimeHelper dateTimeHelper,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IGenericAttributeService genericAttributeService,
     IWorkflowMessageService workflowMessageService,
     IReturnRequestService returnRequestService,
     IStoreMappingService storeMappingService,
     IAddressViewModelService addressViewModelService,
     IOrderService orderService,
     IDownloadService downloadService,
     IPictureService pictureService,
     IProductService productService,
     IAuctionService auctionService,
     INewsletterCategoryService newsletterCategoryService,
     IServiceProvider serviceProvider,
     CustomerSettings customerSettings,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     ForumSettings forumSettings,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     SecuritySettings securitySettings,
     CaptchaSettings captchaSettings,
     RewardPointsSettings rewardPointsSettings,
     OrderSettings orderSettings,
     MediaSettings mediaSettings,
     VendorSettings vendorSettings
     )
 {
     this._externalAuthenticationService = externalAuthenticationService;
     this._customerAttributeParser       = customerAttributeParser;
     this._customerAttributeService      = customerAttributeService;
     this._localizationService           = localizationService;
     this._dateTimeHelper = dateTimeHelper;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._workContext                    = workContext;
     this._storeContext                   = storeContext;
     this._countryService                 = countryService;
     this._stateProvinceService           = stateProvinceService;
     this._genericAttributeService        = genericAttributeService;
     this._workflowMessageService         = workflowMessageService;
     this._returnRequestService           = returnRequestService;
     this._storeMappingService            = storeMappingService;
     this._addressViewModelService        = addressViewModelService;
     this._orderService                   = orderService;
     this._downloadService                = downloadService;
     this._pictureService                 = pictureService;
     this._productService                 = productService;
     this._auctionService                 = auctionService;
     this._newsletterCategoryService      = newsletterCategoryService;
     this._serviceProvider                = serviceProvider;
     this._customerSettings               = customerSettings;
     this._dateTimeSettings               = dateTimeSettings;
     this._taxSettings                    = taxSettings;
     this._forumSettings                  = forumSettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._securitySettings               = securitySettings;
     this._captchaSettings                = captchaSettings;
     this._rewardPointsSettings           = rewardPointsSettings;
     this._orderSettings                  = orderSettings;
     this._mediaSettings                  = mediaSettings;
     this._vendorSettings                 = vendorSettings;
 }
Exemplo n.º 23
0
 public CustomerController(IAuthenticationService authenticationService,
                           IDateTimeHelper dateTimeHelper,
                           DateTimeSettings dateTimeSettings,
                           TaxSettings taxSettings,
                           ILocalizationService localizationService,
                           IWorkContext workContext,
                           IStoreContext storeContext,
                           IStoreMappingService storeMappingService,
                           ICustomerService customerService,
                           ICustomerAttributeParser customerAttributeParser,
                           ICustomerAttributeService customerAttributeService,
                           IGenericAttributeService genericAttributeService,
                           ICustomerRegistrationService customerRegistrationService,
                           ITaxService taxService,
                           RewardPointsSettings rewardPointsSettings,
                           CustomerSettings customerSettings,
                           AddressSettings addressSettings,
                           ForumSettings forumSettings,
                           OrderSettings orderSettings,
                           IAddressService addressService,
                           ICountryService countryService,
                           IStateProvinceService stateProvinceService,
                           IOrderService orderService,
                           IPictureService pictureService,
                           INewsLetterSubscriptionService newsLetterSubscriptionService,
                           IShoppingCartService shoppingCartService,
                           IOpenAuthenticationService openAuthenticationService,
                           IDownloadService downloadService,
                           IWebHelper webHelper,
                           ICustomerActivityService customerActivityService,
                           IAddressAttributeParser addressAttributeParser,
                           IAddressAttributeService addressAttributeService,
                           IAddressAttributeFormatter addressAttributeFormatter,
                           IReturnRequestService returnRequestService,
                           IEventPublisher eventPublisher,
                           MediaSettings mediaSettings,
                           IWorkflowMessageService workflowMessageService,
                           LocalizationSettings localizationSettings,
                           CaptchaSettings captchaSettings,
                           SecuritySettings securitySettings,
                           ExternalAuthenticationSettings externalAuthenticationSettings,
                           StoreInformationSettings storeInformationSettings)
 {
     this._authenticationService       = authenticationService;
     this._dateTimeHelper              = dateTimeHelper;
     this._dateTimeSettings            = dateTimeSettings;
     this._taxSettings                 = taxSettings;
     this._localizationService         = localizationService;
     this._workContext                 = workContext;
     this._storeContext                = storeContext;
     this._storeMappingService         = storeMappingService;
     this._customerService             = customerService;
     this._customerAttributeParser     = customerAttributeParser;
     this._customerAttributeService    = customerAttributeService;
     this._genericAttributeService     = genericAttributeService;
     this._customerRegistrationService = customerRegistrationService;
     this._taxService                    = taxService;
     this._rewardPointsSettings          = rewardPointsSettings;
     this._customerSettings              = customerSettings;
     this._addressSettings               = addressSettings;
     this._forumSettings                 = forumSettings;
     this._orderSettings                 = orderSettings;
     this._addressService                = addressService;
     this._countryService                = countryService;
     this._stateProvinceService          = stateProvinceService;
     this._orderService                  = orderService;
     this._pictureService                = pictureService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._shoppingCartService           = shoppingCartService;
     this._openAuthenticationService     = openAuthenticationService;
     this._downloadService               = downloadService;
     this._webHelper = webHelper;
     this._customerActivityService        = customerActivityService;
     this._addressAttributeParser         = addressAttributeParser;
     this._addressAttributeService        = addressAttributeService;
     this._addressAttributeFormatter      = addressAttributeFormatter;
     this._returnRequestService           = returnRequestService;
     this._eventPublisher                 = eventPublisher;
     this._mediaSettings                  = mediaSettings;
     this._workflowMessageService         = workflowMessageService;
     this._localizationSettings           = localizationSettings;
     this._captchaSettings                = captchaSettings;
     this._securitySettings               = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._storeInformationSettings       = storeInformationSettings;
 }
Exemplo n.º 24
0
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           IBlogService blogService,
                           ICacheKeyService cacheKeyService,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INewsService newsService,
                           INopFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           IShoppingCartService shoppingCartService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager staticCacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           MediaSettings mediaSettings,
                           NewsSettings newsSettings,
                           SitemapSettings sitemapSettings,
                           SitemapXmlSettings sitemapXmlSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     _blogSettings     = blogSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     _forumSettings           = forumSettings;
     _actionContextAccessor   = actionContextAccessor;
     _blogService             = blogService;
     _cacheKeyService         = cacheKeyService;
     _categoryService         = categoryService;
     _currencyService         = currencyService;
     _customerService         = customerService;
     _forumService            = forumService;
     _genericAttributeService = genericAttributeService;
     _httpContextAccessor     = httpContextAccessor;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _manufacturerService     = manufacturerService;
     _newsService             = newsService;
     _fileProvider            = fileProvider;
     _pageHeadBuilder         = pageHeadBuilder;
     _permissionService       = permissionService;
     _pictureService          = pictureService;
     _productService          = productService;
     _productTagService       = productTagService;
     _shoppingCartService     = shoppingCartService;
     _sitemapGenerator        = sitemapGenerator;
     _staticCacheManager      = staticCacheManager;
     _storeContext            = storeContext;
     _themeContext            = themeContext;
     _themeProvider           = themeProvider;
     _topicService            = topicService;
     _urlHelperFactory        = urlHelperFactory;
     _urlRecordService        = urlRecordService;
     _webHelper                = webHelper;
     _workContext              = workContext;
     _mediaSettings            = mediaSettings;
     _localizationSettings     = localizationSettings;
     _newsSettings             = newsSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }
Exemplo n.º 25
0
        public CommonController(ICategoryService categoryService,
                                IProductService productService,
                                IManufacturerService manufacturerService,
                                ITopicService topicService,
                                ILanguageService languageService,
                                ICurrencyService currencyService,
                                ILocalizationService localizationService,
                                IWorkContext workContext,
                                IStoreContext storeContext,
                                IQueuedEmailService queuedEmailService,
                                IEmailAccountService emailAccountService,
                                ISitemapGenerator sitemapGenerator,
                                IThemeContext themeContext,
                                IThemeProvider themeProvider,
                                IForumService forumService,
                                IGenericAttributeService genericAttributeService,
                                IWebHelper webHelper,
                                IPermissionService permissionService,
                                IMobileDeviceHelper mobileDeviceHelper,
                                HttpContextBase httpContext,
                                ICacheManager cacheManager,
                                ICustomerActivityService customerActivityService,
                                CustomerSettings customerSettings,
                                TaxSettings taxSettings,
                                CatalogSettings catalogSettings,
                                StoreInformationSettings storeInformationSettings,
                                EmailAccountSettings emailAccountSettings,
                                CommonSettings commonSettings,
                                BlogSettings blogSettings,
                                NewsSettings newsSettings,
                                ForumSettings forumSettings,
                                LocalizationSettings localizationSettings,
                                CaptchaSettings captchaSettings)
        {
            this._categoryService         = categoryService;
            this._productService          = productService;
            this._manufacturerService     = manufacturerService;
            this._topicService            = topicService;
            this._languageService         = languageService;
            this._currencyService         = currencyService;
            this._localizationService     = localizationService;
            this._workContext             = workContext;
            this._storeContext            = storeContext;
            this._queuedEmailService      = queuedEmailService;
            this._emailAccountService     = emailAccountService;
            this._sitemapGenerator        = sitemapGenerator;
            this._themeContext            = themeContext;
            this._themeProvider           = themeProvider;
            this._forumservice            = forumService;
            this._genericAttributeService = genericAttributeService;
            this._webHelper               = webHelper;
            this._permissionService       = permissionService;
            this._mobileDeviceHelper      = mobileDeviceHelper;
            this._httpContext             = httpContext;
            this._cacheManager            = cacheManager;
            this._customerActivityService = customerActivityService;

            this._customerSettings         = customerSettings;
            this._taxSettings              = taxSettings;
            this._catalogSettings          = catalogSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._emailAccountSettings     = emailAccountSettings;
            this._commonSettings           = commonSettings;
            this._blogSettings             = blogSettings;
            this._newsSettings             = newsSettings;
            this._forumSettings            = forumSettings;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
        }
Exemplo n.º 26
0
        public CommonController(
            ICommonServices services,
            ITopicService topicService,
            Lazy <ILanguageService> languageService,
            Lazy <ICurrencyService> currencyService,
            IThemeContext themeContext,
            Lazy <IThemeRegistry> themeRegistry,
            Lazy <IForumService> forumService,
            Lazy <IGenericAttributeService> genericAttributeService,
            Lazy <IMobileDeviceHelper> mobileDeviceHelper,
            Lazy <ICompareProductsService> compareProductsService,
            Lazy <IUrlRecordService> urlRecordService,
            StoreInformationSettings storeInfoSettings,
            CustomerSettings customerSettings,
            PrivacySettings privacySettings,
            TaxSettings taxSettings,
            CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings,
            EmailAccountSettings emailAccountSettings,
            CommonSettings commonSettings,
            NewsSettings newsSettings,
            BlogSettings blogSettings,
            ForumSettings forumSettings,
            LocalizationSettings localizationSettings,
            Lazy <SecuritySettings> securitySettings,
            Lazy <SocialSettings> socialSettings,
            Lazy <MediaSettings> mediaSettings,
            IOrderTotalCalculationService orderTotalCalculationService,
            IPriceFormatter priceFormatter,
            ThemeSettings themeSettings,
            IPageAssetsBuilder pageAssetsBuilder,
            Lazy <IPictureService> pictureService,
            Lazy <IManufacturerService> manufacturerService,
            Lazy <IProductService> productService,
            Lazy <IShoppingCartService> shoppingCartService,
            IBreadcrumb breadcrumb)
        {
            _services                = services;
            _topicService            = topicService;
            _languageService         = languageService;
            _currencyService         = currencyService;
            _themeContext            = themeContext;
            _themeRegistry           = themeRegistry;
            _forumservice            = forumService;
            _genericAttributeService = genericAttributeService;
            _compareProductsService  = compareProductsService;
            _urlRecordService        = urlRecordService;

            _storeInfoSettings    = storeInfoSettings;
            _customerSettings     = customerSettings;
            _privacySettings      = privacySettings;
            _taxSettings          = taxSettings;
            _catalogSettings      = catalogSettings;
            _shoppingCartSettings = shoppingCartSettings;
            _commonSettings       = commonSettings;
            _newsSettings         = newsSettings;
            _blogSettings         = blogSettings;
            _forumSettings        = forumSettings;
            _localizationSettings = localizationSettings;
            _securitySettings     = securitySettings;
            _socialSettings       = socialSettings;
            _mediaSettings        = mediaSettings;

            _orderTotalCalculationService = orderTotalCalculationService;
            _priceFormatter = priceFormatter;

            _themeSettings       = themeSettings;
            _pageAssetsBuilder   = pageAssetsBuilder;
            _pictureService      = pictureService;
            _manufacturerService = manufacturerService;
            _productService      = productService;
            _shoppingCartService = shoppingCartService;

            _breadcrumb = breadcrumb;
        }
Exemplo n.º 27
0
 public CommonModelFactory(ICategoryService categoryService,
                           IProductService productService,
                           IManufacturerService manufacturerService,
                           ITopicService topicService,
                           ILanguageService languageService,
                           ICurrencyService currencyService,
                           ILocalizationService localizationService,
                           IWorkContext workContext,
                           IStoreContext storeContext,
                           ISitemapGenerator sitemapGenerator,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IWebHelper webHelper,
                           IPermissionService permissionService,
                           IStaticCacheManager cacheManager,
                           IPageHeadBuilder pageHeadBuilder,
                           IPictureService pictureService,
                           IHostingEnvironment hostingEnvironment,
                           CatalogSettings catalogSettings,
                           StoreInformationSettings storeInformationSettings,
                           CommonSettings commonSettings,
                           BlogSettings blogSettings,
                           NewsSettings newsSettings,
                           ForumSettings forumSettings,
                           LocalizationSettings localizationSettings,
                           CaptchaSettings captchaSettings,
                           VendorSettings vendorSettings,
                           IProductTagService productTagService)
 {
     this._categoryService         = categoryService;
     this._productService          = productService;
     this._manufacturerService     = manufacturerService;
     this._topicService            = topicService;
     this._languageService         = languageService;
     this._currencyService         = currencyService;
     this._localizationService     = localizationService;
     this._workContext             = workContext;
     this._storeContext            = storeContext;
     this._sitemapGenerator        = sitemapGenerator;
     this._themeContext            = themeContext;
     this._themeProvider           = themeProvider;
     this._forumservice            = forumService;
     this._genericAttributeService = genericAttributeService;
     this._webHelper                = webHelper;
     this._permissionService        = permissionService;
     this._cacheManager             = cacheManager;
     this._pageHeadBuilder          = pageHeadBuilder;
     this._pictureService           = pictureService;
     this._hostingEnvironment       = hostingEnvironment;
     this._catalogSettings          = catalogSettings;
     this._storeInformationSettings = storeInformationSettings;
     this._commonSettings           = commonSettings;
     this._blogSettings             = blogSettings;
     this._newsSettings             = newsSettings;
     this._forumSettings            = forumSettings;
     this._localizationSettings     = localizationSettings;
     this._captchaSettings          = captchaSettings;
     this._vendorSettings           = vendorSettings;
     this._productTagService        = productTagService;
 }
Exemplo n.º 28
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,
                             IDateTimeHelper dateTimeHelper,
                             IDownloadService downloadService,
                             IGdprService gdprService,
                             IGenericAttributeService genericAttributeService,
                             ILocalizationService localizationService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             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;
     _externalAuthenticationSettings = externalAuthenticationSettings;
     _forumSettings               = forumSettings;
     _gdprSettings                = gdprSettings;
     _addressModelFactory         = addressModelFactory;
     _authenticationPluginManager = authenticationPluginManager;
     _countryService              = countryService;
     _customerAttributeParser     = customerAttributeParser;
     _customerAttributeService    = customerAttributeService;
     _dateTimeHelper              = dateTimeHelper;
     _downloadService             = downloadService;
     _gdprService                   = gdprService;
     _genericAttributeService       = genericAttributeService;
     _localizationService           = localizationService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _orderService                  = orderService;
     _pictureService                = pictureService;
     _returnRequestService          = returnRequestService;
     _stateProvinceService          = stateProvinceService;
     _storeContext                  = storeContext;
     _storeMappingService           = storeMappingService;
     _urlRecordService              = urlRecordService;
     _workContext                   = workContext;
     _mediaSettings                 = mediaSettings;
     _orderSettings                 = orderSettings;
     _rewardPointsSettings          = rewardPointsSettings;
     _securitySettings              = securitySettings;
     _taxSettings                   = taxSettings;
     _vendorSettings                = vendorSettings;
 }
Exemplo n.º 29
0
 public static ForumSettingsModel ToModel(this ForumSettings entity)
 {
     return(entity.MapTo <ForumSettings, ForumSettingsModel>());
 }
Exemplo n.º 30
0
 public void Init()
 {
     _settings   = new ForumSettings(new BlackStormTheme(), new Uri("http://metin2hungary.test"));
     _httpClient = new HttpClientMock();
 }
Exemplo n.º 31
0
        public new void SetUp()
        {
            _pictureService                = new Mock <IPictureService>();
            _authenticationService         = new Mock <IAuthenticationService>();
            _vendorService                 = new Mock <IVendorService>();
            _productTemplateService        = new Mock <IProductTemplateService>();
            _dateRangeService              = new Mock <IDateRangeService>();
            _storeService                  = new Mock <IStoreService>();
            _productAttributeService       = new Mock <IProductAttributeService>();
            _productTagService             = new Mock <IProductTagService>();
            _taxCategoryService            = new Mock <ITaxCategoryService>();
            _measureService                = new Mock <IMeasureService>();
            _catalogSettings               = new CatalogSettings();
            _specificationAttributeService = new Mock <ISpecificationAttributeService>();
            _orderSettings                 = new OrderSettings();
            _categoryService               = new Mock <ICategoryService>();
            _manufacturerService           = new Mock <IManufacturerService>();
            _customerService               = new Mock <ICustomerService>();
            _newsLetterSubscriptionService = new Mock <INewsLetterSubscriptionService>();
            _productEditorSettings         = new ProductEditorSettings();
            _customerAttributeFormatter    = new Mock <ICustomerAttributeFormatter>();

            _orderService         = new Mock <IOrderService>();
            _countryService       = new Mock <ICountryService>();
            _stateProvinceService = new Mock <IStateProvinceService>();
            _priceFormatter       = new Mock <IPriceFormatter>();
            _forumSettings        = new ForumSettings();
            _forumService         = new Mock <IForumService>();
            _gdprService          = new Mock <IGdprService>();
            _customerSettings     = new CustomerSettings();
            _dateTimeHelper       = new Mock <IDateTimeHelper>();
            _addressSettings      = new AddressSettings();
            _currencyService      = new Mock <ICurrencyService>();
            _urlRecordService     = new Mock <IUrlRecordService>();
            _feeSerivce           = new Mock <IFeeService>();

            var nopEngine = new Mock <NopEngine>();

            var picture = new Picture
            {
                Id          = 1,
                SeoFilename = "picture"
            };

            _authenticationService.Setup(p => p.GetAuthenticatedCustomer()).Returns(GetTestCustomer());
            _pictureService.Setup(p => p.GetPictureById(1)).Returns(picture);
            _pictureService.Setup(p => p.GetThumbLocalPath(picture, 0, true)).Returns(@"c:\temp\picture.png");
            _pictureService.Setup(p => p.GetPicturesByProductId(1, 3)).Returns(new List <Picture> {
                picture
            });
            _productTemplateService.Setup(p => p.GetAllProductTemplates()).Returns(new List <ProductTemplate> {
                new ProductTemplate {
                    Id = 1
                }
            });
            _dateRangeService.Setup(d => d.GetAllDeliveryDates()).Returns(new List <DeliveryDate> {
                new DeliveryDate {
                    Id = 1
                }
            });
            _dateRangeService.Setup(d => d.GetAllProductAvailabilityRanges()).Returns(new List <ProductAvailabilityRange> {
                new ProductAvailabilityRange {
                    Id = 1
                }
            });
            _taxCategoryService.Setup(t => t.GetAllTaxCategories()).Returns(new List <TaxCategory> {
                new TaxCategory()
            });
            _vendorService.Setup(v => v.GetAllVendors(string.Empty, 0, int.MaxValue, true)).Returns(new PagedList <Vendor>(new List <Vendor> {
                new Vendor {
                    Id = 1
                }
            }, 0, 10));
            _measureService.Setup(m => m.GetAllMeasureWeights()).Returns(new List <MeasureWeight> {
                new MeasureWeight()
            });
            _categoryService.Setup(c => c.GetProductCategoriesByProductId(1, true)).Returns(new List <ProductCategory>());
            _manufacturerService.Setup(m => m.GetProductManufacturersByProductId(1, true)).Returns(new List <ProductManufacturer>());

            var serviceProvider = new TestServiceProvider();

            nopEngine.Setup(x => x.ServiceProvider).Returns(serviceProvider);

            EngineContext.Replace(nopEngine.Object);

            _exportManager = new ExportManager(_addressSettings,
                                               _catalogSettings,
                                               _customerSettings,
                                               _forumSettings,
                                               _categoryService.Object,
                                               _countryService.Object,
                                               _currencyService.Object,
                                               _customerAttributeFormatter.Object,
                                               _customerService.Object,
                                               _dateRangeService.Object,
                                               _dateTimeHelper.Object,
                                               _forumService.Object,
                                               _gdprService.Object,
                                               serviceProvider.GenericAttributeService.Object,
                                               serviceProvider.LocalizationService.Object,
                                               _manufacturerService.Object,
                                               _measureService.Object,
                                               _newsLetterSubscriptionService.Object,
                                               _orderService.Object,
                                               _pictureService.Object,
                                               _priceFormatter.Object,
                                               _productAttributeService.Object,
                                               _productTagService.Object,
                                               _productTemplateService.Object,
                                               _specificationAttributeService.Object,
                                               _stateProvinceService.Object,
                                               _storeService.Object,
                                               _taxCategoryService.Object,
                                               _urlRecordService.Object,
                                               _vendorService.Object,
                                               serviceProvider.WorkContext.Object,
                                               _orderSettings,
                                               _productEditorSettings,
                                               _feeSerivce.Object);
        }
Exemplo n.º 32
0
        /// <summary>
        /// ����������� ��
        /// </summary>
        public static void ProcessSetting()
        {
            string sql = @"
SELECT [ForumID],[ParentID],[ExtendedAttributes] FROM bx_Forums;
SELECT [Value] FROM bx_Settings WHERE TypeName = 'MaxLabs.bbsMax.Settings.ForumSettings' AND [Key] = '*';
";
            using (SqlConnection connection = new SqlConnection(Settings.Current.IConnectionString))
            {
                connection.Open();
                SqlCommand command = new SqlCommand(sql, connection);
                command.CommandText = sql;
                command.CommandType = CommandType.Text;
                command.CommandTimeout = 60;
                try
                {
                    Dictionary<int, StringTable> forumsExtendedDatas = new Dictionary<int, StringTable>();
                    ForumSettings forumSetting = new ForumSettings();
                    List<TempForum> forums = new List<TempForum>();
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            int forumID = reader.GetInt32(0);
                            TempForum forum = new TempForum();
                            forum.ForumID = forumID;
                            forum.ParentID = reader.GetInt32(1);

                            forums.Add(forum);
                            try
                            {
                                if (reader.IsDBNull(2) == false)
                                {
                                    StringTable st = SettingBase.ParseStringTable(reader.GetString(2));
                                    forumsExtendedDatas.Add(forumID, st);
                                }
                            }
                            catch
                            { }

                        }

                        if (reader.NextResult())
                        {
                            while (reader.Read())
                            {
                                forumSetting = new ForumSettings();
                                forumSetting.Parse(reader.GetString(0));
                            }
                        }
                    }
                    if (forumsExtendedDatas.Count == 0)
                        return;

                    StringBuilder sbSql = new StringBuilder();
                    ForumSettings tempForumSettings = new ForumSettings();

                    ForumSettingItem temp0Item = forumSetting.Items.GetForumSettingItem(0);
                    tempForumSettings.Items.Add(temp0Item);

                    foreach (KeyValuePair<int, StringTable> pair in forumsExtendedDatas)
                    {
                        string allowGuestVisitForumValue = null;
                        string displayInListForGuestValue = null;
                        string visitForumValue = null;
                        string displayInListValue = null;

                        if (pair.Value.ContainsKey("AllowGuestVisitForum"))
                        {
                            allowGuestVisitForumValue = pair.Value["AllowGuestVisitForum"];
                            pair.Value.Remove("AllowGuestVisitForum");
                        }
                        if (pair.Value.ContainsKey("DisplayInListForGuest"))
                        {
                            displayInListForGuestValue = pair.Value["DisplayInListForGuest"];
                            pair.Value.Remove("DisplayInListForGuest");
                        }
                        if (pair.Value.ContainsKey("VisitForum"))
                        {
                            visitForumValue = pair.Value["VisitForum"];
                            pair.Value.Remove("VisitForum");
                        }
                        if (pair.Value.ContainsKey("DisplayInList"))
                        {
                            displayInListValue = pair.Value["DisplayInList"];
                            pair.Value.Remove("DisplayInList");
                        }

                        ForumSettingItem fSetting = null;

                        bool? isNew = null;

                        fSetting = GetForumSettingItem(forums, pair.Key, forumSetting, ref isNew);

                        if (allowGuestVisitForumValue == null && displayInListForGuestValue == null
                            && visitForumValue == null && displayInListValue == null)
                        {
                            if (isNew.Value == false)
                            {
                                tempForumSettings.Items.Add(fSetting);
                            }
                            continue;
                        }


                        //bool mustAddNew = false;
                        if (allowGuestVisitForumValue != null)
                        {
                            if (fSetting.AllowGuestVisitForum.ToString().ToLower() != allowGuestVisitForumValue.ToLower())
                            {
                                fSetting.AllowGuestVisitForum = (allowGuestVisitForumValue.ToLower() == "true");
                                //mustAddNew = true;
                            }
                        }
                        if (visitForumValue != null)
                        {
                            if (fSetting.VisitForum.GetValue() != visitForumValue)
                            {
                                fSetting.VisitForum = new Exceptable<bool>(true);
                                fSetting.VisitForum.SetValue(visitForumValue);
                                //mustAddNew = true;
                            }
                        }
                        if (displayInListForGuestValue != null)
                        {
                            if (fSetting.DisplayInListForGuest.ToString().ToLower() != displayInListForGuestValue.ToLower())
                            {
                                fSetting.DisplayInListForGuest = (displayInListForGuestValue.ToLower() == "true");
                                //mustAddNew = true;
                            }
                        }
                        if (displayInListValue != null)
                        {
                            if (fSetting.DisplayInList.GetValue() != displayInListValue)
                            {
                                fSetting.DisplayInList = new Exceptable<bool>(true);
                                fSetting.DisplayInList.SetValue(displayInListValue);
                                //mustAddNew = true;
                            }
                        }

                        //if (isNew.Value && mustAddNew)
                        //    forumSetting.Items.Add(fSetting);

                        fSetting.ForumID = pair.Key;
                        tempForumSettings.Items.Add(fSetting);

                        sbSql.AppendFormat("UPDATE bx_Forums SET ExtendedAttributes = '{0}' WHERE ForumID = {1};", SettingBase.FormatStringTable(pair.Value), pair.Key);

                    }

                    ForumSettings resultSettings = new ForumSettings();
                    foreach (ForumSettingItem item in tempForumSettings.Items)
                    {
                        bool? isParentSetting = null;
                        ForumSettingItem temp = GetForumSettingItem(forums, item.ForumID, forumSetting, ref isParentSetting);

                        if (isParentSetting.Value)//����Ǹ�����һ����  ��ʹ�ü̳е�
                        {
                            if (temp.ToString() == item.ToString())
                            {
                                continue;
                            }
                        }

                        resultSettings.Items.Add(item);
                    }

                    sbSql.AppendFormat(@"
IF EXISTS(SELECT * FROM bx_Settings WHERE TypeName = 'MaxLabs.bbsMax.Settings.ForumSettings' AND [Key] = '*')
    UPDATE bx_Settings SET [Value] = '{0}' WHERE TypeName = 'MaxLabs.bbsMax.Settings.ForumSettings' AND [Key] = '*';
ELSE
    INSERT INTO bx_Settings ([Value],[TypeName],[Key]) VALUES('{0}','MaxLabs.bbsMax.Settings.ForumSettings','*');
"
                        , resultSettings.ToString());

                    command.CommandText = sbSql.ToString();
                    sql = command.CommandText;

                    command.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    CreateLog(ex);
                    throw new Exception("�����������ʧ��" + ex.Message + sql);
                }
                finally
                {
                    connection.Close();
                }
            }
        }