示例#1
0
        public JsonResult GetGoalie(int id, [FromQuery] StatParametersDto statParametersDto)
        {
            WebsiteService service = new WebsiteService();
            var            dto     = service.GetPlayerGoalieTable(id, statParametersDto);

            return(new JsonResult(dto));
        }
        public GetRawHtmlTest()
        {
            _httpMessageHandler = new Mock <HttpMessageHandler>();
            _httpClient         = new HttpClient(_httpMessageHandler.Object);

            _sut = new WebsiteService(_httpClient);
        }
示例#3
0
        public JsonResult GetSkaterSeason([FromQuery] StatParametersDto statParametersDto)
        {
            WebsiteService service = new WebsiteService();
            var            dto     = service.GetSeasonSkaterTable(statParametersDto);

            return(new JsonResult(dto));
        }
示例#4
0
        public JsonResult GetGoalieCareer([FromQuery] StatParametersDto statParametersDto)
        {
            WebsiteService service = new WebsiteService();
            var            dto     = service.GetCareerGoalieTable(statParametersDto);

            return(new JsonResult(dto));
        }
示例#5
0
 private async Task CheckWebsite()
 {
     if (this.Website == null || this.Website.Id == null || this.Website.Id == Guid.Empty)
     {
         this.Website = await WebsiteService.FindByUrl(this.CleanDomain);
     }
 }
示例#6
0
        public JsonResult GetSearchResults(string input)
        {
            WebsiteService service = new WebsiteService();
            var            dto     = service.GetSearchResults(input);

            return(new JsonResult(dto));
        }
        private void PopulateSelectListsToModel(BindingViewModel viewModel, IBinding binding)
        {
            if (viewModel != null)
            {
                if (viewModel.SelectedWebsiteId > 0)
                {
                    binding.Website = WebsiteService.GetById(viewModel.SelectedWebsiteId);
                }

                if (viewModel.SelectedServerIds.Any())
                {
                    if (binding.Servers == null)
                    {
                        binding.Servers = new HashSet <IServer>();
                    }
                    foreach (long selectedServerId in viewModel.SelectedServerIds)
                    {
                        binding.Servers.Add(ServerService.GetById(selectedServerId));
                    }
                }
                if (viewModel.SelectedEnvironmentIds.Any())
                {
                    if (binding.Environments == null)
                    {
                        binding.Environments = new HashSet <IEnvironment>();
                    }
                    foreach (long selectedEnvironmentId in viewModel.SelectedEnvironmentIds)
                    {
                        binding.Environments.Add(EnvironmentService.GetById(selectedEnvironmentId));
                    }
                }
            }
        }
示例#8
0
 public AcceleratorPackage(
     AssortmentService assortmentService,
     FieldTemplateService fieldTemplateService,
     StructureInfoService structureInfoService,
     MarketService marketService,
     ChannelService channelService,
     CurrencyService currencyService,
     WebsiteService websiteService,
     InventoryService inventoryService,
     PriceListService priceListService,
     DomainNameService domainNameService,
     GroupService groupService,
     FolderService folderService,
     PersonService personService,
     LanguageService languageService,
     SlugifyService slugifyService)
 {
     _assortmentService    = assortmentService;
     _fieldTemplateService = fieldTemplateService;
     _structureInfoService = structureInfoService;
     _marketService        = marketService;
     _channelService       = channelService;
     _currencyService      = currencyService;
     _websiteService       = websiteService;
     _inventoryService     = inventoryService;
     _priceListService     = priceListService;
     _domainNameService    = domainNameService;
     _groupService         = groupService;
     _folderService        = folderService;
     _personService        = personService;
     _languageService      = languageService;
     _slugifyService       = slugifyService;
 }
        public ActionResult JobTypeFrontEnd(string Slug)
        {
            WebsiteViewModel vm = _GetViewModel(Slug);

            vm.BrainTreeToken = _BrainTreeService.CreateToken();
            vm.Website        = WebsiteService.websiteGetBySlug(Slug);
            return(View(vm));
        }
示例#10
0
        private async Task SaveWebsite()
        {
            var website = new Website();

            website.Domain = this.CleanDomain;

            this.Website = await WebsiteService.Add(website);
        }
 public StockStatusMessageServiceImpl(
     IStringLocalizer <IStockStatusMessageService> stringLocalizer,
     RouteRequestLookupInfoAccessor routeRequestLookupInfoAccessor,
     WebsiteService websiteService)
 {
     _stringLocalizer = stringLocalizer;
     _routeRequestLookupInfoAccessor = routeRequestLookupInfoAccessor;
     _websiteService = websiteService;
 }
示例#12
0
        public void AddWebsite(WebsiteType type, WebsiteService service, string address, string url)
        {
            if (_websites == null)
            {
                _websites = new List <Website>(1);
            }

            _websites.Add(Website.Create(type, service, address, url));
        }
示例#13
0
        public ActionResult Create()
        {
            var viewModel = new BindingViewModel();

            viewModel.Websites               = WebsiteService.GetAll().ToList();
            viewModel.SelectableServers      = ServerService.GetAll().ToList();
            viewModel.SelectableEnvironments = EnvironmentService.GetAll().ToList();

            return(View(viewModel));
        }
示例#14
0
 public KlarnaPaymentConfigV3(IErrorPageResolver errorPageResolver,
                              ChannelService channelService,
                              LanguageService languageService,
                              WebsiteService websiteService)
 {
     _errorPageResolver = errorPageResolver;
     _channelService    = channelService;
     _languageService   = languageService;
     _websiteService    = websiteService;
 }
示例#15
0
        public ActionResult Index(int?page)
        {
            var viewModel = new WebsiteListViewModel();

            var  pageNumber = (page ?? 1) - 1;
            long totalCount;
            IEnumerable <IWebsite> websites = WebsiteService.GetAll(pageNumber, PageSize, out totalCount);

            viewModel.Websites = new StaticPagedList <IWebsite>(websites, pageNumber + 1, PageSize, (int)totalCount);
            return(View(viewModel));
        }
        public void SetUp()
        {
            _factory    = new Mock <IWebsiteFactory>();
            _repository = new Mock <IWebsiteRepository>();

            _repository.Setup(r => r.AddAsync(It.IsAny <Website>())).ReturnsAsync(new Website());

            _service = new WebsiteService(
                _repository.Object,
                _factory.Object);
        }
示例#17
0
        public ActionResult Delete(int id, int?page)
        {
            var website = WebsiteService.GetById(id);

            if (website != null)
            {
                WebsiteService.Delete(website);
            }

            return(RedirectToAction("Index", new { page }));
        }
示例#18
0
 public ActionResult Edit(long?id, int?page)
 {
     if (id.HasValue)
     {
         var viewModel = AutoMapper.Mapper.Map <IBinding, BindingViewModel>(BindingService.GetById(id.Value));
         viewModel.Websites               = WebsiteService.GetAll().ToList();
         viewModel.SelectableServers      = ServerService.GetAll().ToList();
         viewModel.SelectableEnvironments = EnvironmentService.GetAll().ToList();
         return(View(viewModel));
     }
     return(RedirectToAction("Create"));
 }
示例#19
0
 public MailServiceImpl(SchedulerService schedulerService,
                        UrlService urlService,
                        WebsiteService websiteService,
                        ChannelService channelService,
                        ILogger <MailService> logger,
                        MailServiceProcessor mailServiceProcessor)
 {
     _schedulerService     = schedulerService;
     _urlService           = urlService;
     _websiteService       = websiteService;
     _channelService       = channelService;
     _logger               = logger;
     _mailServiceProcessor = mailServiceProcessor;
 }
示例#20
0
        public static Website Create(WebsiteType type, WebsiteService service, string address, string url)
        {
            if (string.IsNullOrEmpty(address))
            {
                throw new ArgumentException("Address must be populated");
            }

            return(new Website()
            {
                Service = service.ToFriendlyString(),
                Type = type.ToFriendlyString(),
                Address = address,
                Url = url
            });
        }
示例#21
0
 public VariantInfoBuilder(
     VariantService variantService,
     FileService fileService,
     ProductPriceModelBuilder priceModelBuilder,
     WebsiteService websiteService,
     CurrencyService currencyService,
     ChannelService channelService,
     PriceListItemService priceListItemService)
 {
     _variantService       = variantService;
     _fileService          = fileService;
     _priceModelBuilder    = priceModelBuilder;
     _currencyService      = currencyService;
     _channelService       = channelService;
     _priceListItemService = priceListItemService;
 }
        public static string ToFriendlyString(this WebsiteService me)
        {
            switch (me)
            {
            case WebsiteService.FACEBOOK:
                return("facebook");

            case WebsiteService.FEED:
                return("feed");

            case WebsiteService.FLICKR:
                return("flickr");

            case WebsiteService.GITHUB:
                return("github");

            case WebsiteService.GOOGLE_PLUS:
                return("google_plus");

            case WebsiteService.INSTAGRAM:
                return("instagram");

            case WebsiteService.LINKED_IN:
                return("linked_in");

            case WebsiteService.PINTEREST:
                return("pinterest");

            case WebsiteService.SKYPE:
                return("skype");

            case WebsiteService.TWITTER:
                return("twitter");

            case WebsiteService.URL:
                return("url");

            case WebsiteService.XING:
                return("xing");

            case WebsiteService.YOUTUBE:
                return("youtube");

            default:
                return("");
            }
        }
        public PageByFieldTemplateCache(
            FieldTemplateService fieldTemplateService,
            DataService dataService,
            EventBroker eventBroker,
            MemoryCacheService memoryCacheService,
            AuthorizationService authorizationService,
            PageService pageService,
            IServiceProvider serviceProvider,
            RouteRequestLookupInfoAccessor routeRequestLookupInfoAccessor,
            WebsiteService websiteService,
            ChannelService channelService)
        {
            var fieldType = ActivatorUtilities.CreateInstance <T>(serviceProvider);

            _fieldTemplateService = fieldTemplateService;
            _dataService          = dataService;
            _memoryCacheService   = memoryCacheService;
            _authorizationService = authorizationService;
            _pageService          = pageService;
            _fieldTemplateName    = fieldType.Name;
            _channelService       = channelService;

            _cacheKey = GetType().FullName + ":" + _fieldTemplateName;

            eventBroker.Subscribe <FieldTemplateCreated>(_ => RemoveCacheForWebsites());
            eventBroker.Subscribe <FieldTemplateDeleted>(_ => RemoveCacheForWebsites());
            eventBroker.Subscribe <DraftPageCreated>(_ => RemoveCacheForWebsites());
            eventBroker.Subscribe <PageCreated>(_ => RemoveCacheForWebsites());
            eventBroker.Subscribe <PageDeleted>(_ => RemoveCacheForWebsites());
            eventBroker.Subscribe <PageUpdated>(x =>
            {
                if (x.OriginalFieldTemplateSystemId != null)
                {
                    RemoveCacheForWebsites();
                }
            });
            _routeRequestLookupInfoAccessor = routeRequestLookupInfoAccessor;

            void RemoveCacheForWebsites()
            {
                foreach (var website in websiteService.GetAll())
                {
                    _memoryCacheService.Remove(_cacheKey + website.SystemId);
                }
            }
        }
示例#24
0
 public StructureInfoService(
     FieldDefinitionService fieldDefinitionService,
     GroupService groupService,
     WebsiteService websiteService,
     ChannelService channelService,
     InventoryService inventoryService,
     PriceListService priceListService,
     FieldTypeMetadataService fieldTypeMetadataService,
     ApplicationJsonConverter applicationJsonConverter)
 {
     _fieldDefinitionService   = fieldDefinitionService;
     _groupService             = groupService;
     _websiteService           = websiteService;
     _channelService           = channelService;
     _inventoryService         = inventoryService;
     _priceListService         = priceListService;
     _fieldTypeMetadataService = fieldTypeMetadataService;
     _jsonSerializer           = JsonSerializer.Create(applicationJsonConverter.GetSerializerSettings());
 }
        [Route("add"), HttpPost] // inserting the create user request model
        public HttpResponseMessage RegisterNewUser(CreateUserRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            // if email/phone number taken, return bad request.
            // checks for a null websiteId via slug
            bool   checkUser    = _UserProfileService.GetUserByEmailAndPhoneNumber(model);
            string thisSlug     = model.Slug;
            var    checkWebsite = WebsiteService.GetWebsiteIdBySlug(thisSlug);

            if (checkUser == true && checkWebsite == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            // if user has not already been registered run user service to create new user
            else
            {
                ApplicationUser newUser = null;
                try
                {   // submit users email, password, and phone number for registration
                    newUser = (ApplicationUser)UserService.CreateUser(model.Email, model.Password, model.Phone);
                }
                catch (IdentityResultException ex)
                {   // catches exceptions returns bad request
                    string validatedData = UtilityService.ValidateData(ex);
                    return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, validatedData, ex));
                }
                //send User to database
                //only run if there are no duplicate phone/email
                //NOTHING SHOULD GET INTO THE DATABASE IF THERE IS A 400 ERROR
                if (newUser != null)
                {    // passing user model to service
                    _UserProfileService.CreateUserProfile(newUser.Id, model);
                }
                ItemResponse <UserProfile> response = new ItemResponse <UserProfile>();
                // return the newly created user profile
                response.Item = (UserProfile)_UserProfileService.GetUserById(newUser.Id);

                return(Request.CreateResponse(response));
            }
        }
示例#26
0
        public ActionResult Edit(int?id, int?page)
        {
            if (id.HasValue)
            {
                var viewModel = AutoMapper.Mapper.Map <IWebsite, WebsiteViewModel>(WebsiteService.GetById(id.Value));
                viewModel.PackageConfigurations = PackageConfigurationService.GetAll().ToList();
                if (viewModel.ApplicationPool == null)
                {
                    viewModel.ApplicationPool = new ApplicationPoolViewModel();
                }
                else
                {
                    viewModel.ApplicationPool = AutoMapper.Mapper.Map <IApplicationPool, ApplicationPoolViewModel>(viewModel.ApplicationPool);
                }

                return(View(viewModel));
            }
            return(RedirectToAction("Create"));
        }
示例#27
0
        public async Task Invoke(HttpContext context, WebsiteService _WebsiteService)
        {
            this.oWebsiteService = _WebsiteService;

            List <string> IgnoreRouteList = this.setIgnoreRouteList();

            IgnoreRouteList.AddRange(this.getEliteReleaseCountryList());

            foreach (var routeItem in IgnoreRouteList)
            {
                if (context.Request.Path.HasValue &&
                    context.Request.Path.Value.ToLower().StartsWith(routeItem))
                {
                    context.Response.StatusCode = 404;

                    return;
                }
            }
            await next.Invoke(context);
        }
示例#28
0
        public async Task Invoke(HttpContext context, WebsiteService _WebsiteService)
        {
            bool IsInRoute = false;

            this.oWebsiteService = _WebsiteService;

            List <string> ReleaseRouteList = new List <string>();

            ReleaseRouteList.AddRange(this.getRouteList());

            if (context.Request.Path.HasValue)
            {
                string requestPath = context.Request.Path.Value.ToLower();
                foreach (string routeItem in ReleaseRouteList)
                {
                    if (requestPath.StartsWith(routeItem))
                    {
                        IsInRoute = true;
                    }

                    if (IsInRoute)
                    {
                        break;
                    }
                }

                if (!IsInRoute)
                {
                    List <string> strList = new List <string> {
                        "", context.Request.Path.Value
                    };
                    context.Features.Set(strList);

                    context.Request.Path = "/elite/error/";
                    context.Response.Redirect("/elite/error");
                }
            }

            await next.Invoke(context);
        }
示例#29
0
 public DeploymentController(
     DeploymentViewModelBuilder deploymentViewModelBuilder,
     FolderService folderService,
     ChannelService channelService,
     AssortmentService assortmentService,
     IPackageService packageService,
     IPackage package,
     WebsiteService websiteService,
     StructureInfoService structureInfoService,
     SettingService settingService,
     DomainNameService domainNameService,
     SlugifyService slugifyService,
     ILogger <DeploymentController> logger,
     InventoryService inventoryService,
     PriceListService priceListService,
     CategoryService categoryService,
     BaseProductService baseProductService,
     VariantService variantService,
     MarketService marketService)
 {
     _deploymentViewModelBuilder = deploymentViewModelBuilder;
     _folderService        = folderService;
     _channelService       = channelService;
     _assortmentService    = assortmentService;
     _packageService       = packageService;
     _package              = package;
     _websiteService       = websiteService;
     _structureInfoService = structureInfoService;
     _settingService       = settingService;
     _domainNameService    = domainNameService;
     _slugifyService       = slugifyService;
     _logger             = logger;
     _inventoryService   = inventoryService;
     _priceListService   = priceListService;
     _categoryService    = categoryService;
     _baseProductService = baseProductService;
     _variantService     = variantService;
     _marketService      = marketService;
 }
示例#30
0
 public CheckoutServiceImpl(
     ModuleECommerce moduleECommerce,
     RequestModelAccessor requestModelAccessor,
     CartService cartService,
     IPaymentInfoFactory paymentInfoFactory,
     LanguageService languageService,
     UserValidationService userValidationService,
     SecurityContextService securityContextService,
     PersonService personService,
     LoginService loginService,
     MailService mailService,
     WelcomeEmailDefinitionResolver welcomeEmailDefinitionResolver,
     FieldTemplateService templateService,
     WebsiteService websiteService,
     AddressTypeService addressTypeService,
     UrlService urlService,
     PageService pageService,
     PersonStorage personStorage,
     CheckoutState checkoutState)
 {
     _moduleECommerce                = moduleECommerce;
     _requestModelAccessor           = requestModelAccessor;
     _cartService                    = cartService;
     _paymentInfoFactory             = paymentInfoFactory;
     _languageService                = languageService;
     _userValidationService          = userValidationService;
     _securityContextService         = securityContextService;
     _personService                  = personService;
     _loginService                   = loginService;
     _mailService                    = mailService;
     _welcomeEmailDefinitionResolver = welcomeEmailDefinitionResolver;
     _templateService                = templateService;
     _addressTypeService             = addressTypeService;
     _websiteService                 = websiteService;
     _pageService                    = pageService;
     _personStorage                  = personStorage;
     _checkoutState                  = checkoutState;
     _urlService = urlService;
 }