Example #1
0
        private static List <DrawBasket> GetDrawBasketsForCup(int level, IClubService clubService)
        {
            var clubs         = clubService.GetByLevel(level).ToList();
            var cupClubsCount = clubs.Count / 10 * 4;

            var cupClubs = new List <Club>();

            for (int i = 0; i < cupClubsCount; i++)
            {
                cupClubs.Add(clubs[i]);
            }

            var averageRatings = cupClubs.Select(p => new KeyValuePair <long, float>(p.Id, clubService.GetAverageSquadRating(p.Id))).ToList();

            int[] potSizes = { cupClubsCount / 4, cupClubsCount / 4, cupClubsCount / 4, cupClubsCount / 4 };

            var basketsForLeague = new List <DrawBasket>();

            foreach (var ps in potSizes)
            {
                var ratings  = averageRatings.GetRange(0, ps).ToList();
                var keys     = ratings.Select(ar => ar.Key).ToList();
                var potClubs = cupClubs.Where(p => keys.Contains(p.Id)).ToList();

                cupClubs.RemoveAll(p => keys.Contains(p.Id));
                averageRatings.RemoveAll(ar => ratings.Contains(ar));

                basketsForLeague.Add(new DrawBasket()
                {
                    Clubs = potClubs.ToList()
                });
            }

            return(basketsForLeague);
        }
Example #2
0
 public AttendanceController(IAttendanceService attendanceService, IActivityService activityService, IMemberService memberService, IClubService clubService)
 {
     AttendanceService = attendanceService;
     ActivityService   = activityService;
     MemberService     = memberService;
     ClubService       = clubService;
 }
Example #3
0
 public TeamService(HemaneContext context, IUserService userService, IClubService clubService, IMatchService matchService)
 {
     _context      = context;
     _userService  = userService;
     _clubService  = clubService;
     _matchService = matchService;
 }
Example #4
0
        public AdminController(IAdminService adminService,
                               IAccountService accountService,
                               IMemoryCache cache,
                               ISportService sportService,
                               IDisciplineService disciplineService,
                               ICompetitionService competitionService,
                               IEventService eventService,
                               IHeatService heatService,
                               IClubService clubService,
                               ICourseService courseService,
                               IDeviceService deviceService,
                               IServiceProvider serviceProvider,
                               ICategoryService categoryService,
                               IChipService chipService,
                               UserManager <ApplicationUser> userManager)

        {
            _adminService       = adminService;
            _cache              = cache;
            _accountService     = accountService;
            _sportService       = sportService;
            _disciplineService  = disciplineService;
            _competitionService = competitionService;
            _eventService       = eventService;
            _heatService        = heatService;
            _clubService        = clubService;
            _courseService      = courseService;
            _deviceService      = deviceService;
            _serviceProvider    = serviceProvider;
            _categoryService    = categoryService;
            _chipService        = chipService;
            _userManager        = userManager;
        }
Example #5
0
 public ClubViewModelService(
     AppDbContext dbcontext,
     IClubService clubService)
 {
     _dbcontext   = dbcontext;
     _clubservice = clubService;
 }
 public UserController(IUserService userService, IStudentService studentService, IClubService clubservice, ISponsorService sponsorService)
 {
     _userservice    = userService;
     _studentservice = studentService;
     _clubservice    = clubservice;
     _sponsorservice = sponsorService;
 }
 public ClubController(IMapper mapper, ILog4Net logger, IClubService clubService, IDropDownService dropDownService)
 {
     _mapper          = mapper;
     _logger          = logger;
     _clubService     = clubService;
     _dropDownService = dropDownService;
 }
Example #8
0
        private static List <DrawBasket> GetDrawBasketsForLeague(int level, IClubService clubService)
        {
            var clubs = clubService.GetByLevel(level).ToList();

            var averageRatings = clubs.Select(p => new KeyValuePair <long, float>(p.Id, clubService.GetAverageSquadRating(p.Id))).ToList();

            averageRatings = new List <KeyValuePair <long, float> >(averageRatings.OrderByDescending(ar => ar.Value));

            int basket1Size = clubs.Count / 10 * 3;
            int basket2Size = clubs.Count / 10 * 3;
            int basket3Size = clubs.Count / 10 * 4;

            int[] potSizes = { basket1Size, basket2Size, basket3Size };

            var basketsForLeague = new List <DrawBasket>();

            foreach (var ps in potSizes)
            {
                var ratings  = averageRatings.GetRange(0, ps).ToList();
                var keys     = ratings.Select(ar => ar.Key).ToList();
                var potClubs = clubs.Where(p => keys.Contains(p.Id)).ToList();

                clubs.RemoveAll(p => keys.Contains(p.Id));
                averageRatings.RemoveAll(ar => ratings.Contains(ar));

                basketsForLeague.Add(new DrawBasket()
                {
                    Clubs = potClubs.ToList()
                });
            }

            return(basketsForLeague);
        }
Example #9
0
 public ProfileService(TennisConnectDbContext context, IUserService userService, IClubService clubService, IAddressService addressService)
 {
     _context        = context;
     _userService    = userService;
     _clubService    = clubService;
     _addressService = addressService;
 }
Example #10
0
 public ClubServiceTests()
 {
     _repoWrapper = new Mock <IRepositoryWrapper>();
     _mapper      = new Mock <IMapper>();
     _blob        = new Mock <IClubBlobStorageRepository>();
     _clubService = new ClubService(_repoWrapper.Object, _mapper.Object, _blob.Object);
 }
Example #11
0
 public ClubMembersService(IRepositoryWrapper repoWrapper, IMapper mapper, IClubService clubService,
                           IUserManagerService userManagerService)
 {
     _repoWrapper        = repoWrapper;
     _mapper             = mapper;
     _clubService        = clubService;
     _userManagerService = userManagerService;
 }
Example #12
0
 public ClubsController(/*PingDbContext context,*/ IClubService service, IOrganismeService organismeService, IChampionnatService championnatService, QueryService queryService /*, CacheService cache*/) : base(/*context*/)
 {
     Service            = service;
     OrganismeService   = organismeService;
     ChampionnatService = championnatService;
     QueryService       = queryService;
     //  CacheService = cache;
 }
Example #13
0
 public HomeController(
     IFootballerService footballerService,
     IPositionService positionService,
     IClubService clubService)
 {
     this.footballerService = footballerService;
     this.positionService   = positionService;
     this.clubService       = clubService;
 }
Example #14
0
 public DataSeeder(FFDbContext _ctx)
 {
     playerSvc     = new PlayerService(_ctx);
     clubSvc       = new ClubService(_ctx);
     teamSvc       = new TeamService(_ctx);
     userSvc       = new UserService(_ctx);
     teamPlayerSvc = new TeamPlayerService(_ctx);
     playerSvc.Initialize();
 }
Example #15
0
 public DataSeeder()
 {
     playerSvc     = new PlayerService(FFDbContextFactory.CreateCtx());
     clubSvc       = new ClubService(FFDbContextFactory.CreateCtx());
     teamSvc       = new TeamService(FFDbContextFactory.CreateCtx());
     userSvc       = new UserService(FFDbContextFactory.CreateCtx());
     teamPlayerSvc = new TeamPlayerService(FFDbContextFactory.CreateCtx());
     playerSvc.Initialize();
 }
 public ManageItemsDetailsController(
     IUserService userService,
     ICityService cityService,
     IClubService clubService)
 {
     this.userService = userService;
     this.cityService = cityService;
     this.clubService = clubService;
 }
Example #17
0
 public ClubController(
     IClubService clubService,
     ICountryService countryService,
     IStadiumService stadiumService)
 {
     this.clubService    = clubService;
     this.countryService = countryService;
     this.stadiumService = stadiumService;
 }
 public EventController(IMapper mapper, ILog4Net logger, IEventService eventService, IClubService clubService, IMatchService matchService, IDropDownService dropDownService)
 {
     _mapper          = mapper;
     _logger          = logger;
     _eventService    = eventService;
     _matchService    = matchService;
     _clubService     = clubService;
     _dropDownService = dropDownService;
 }
Example #19
0
 public ClubController(
     IClubService clubService,
     IAuthorizationService authService,
     IMapper mapper)
 {
     _clubService = clubService;
     _authService = authService;
     _mapper      = mapper;
 }
Example #20
0
 public PlayerController(
     IPlayerService playerService,
     ICountryService countryService,
     IClubService clubService)
 {
     this.playerService  = playerService;
     this.countryService = countryService;
     this.clubService    = clubService;
 }
 public TeamPositionController(
     ITeamPositionService teamPositionService,
     ISeasonService seasonService,
     IClubService clubService)
 {
     this.teamPositionService = teamPositionService;
     this.seasonService       = seasonService;
     this.clubService         = clubService;
 }
 public ManagerController(
     IManagerService managerService,
     ICountryService countryService,
     IClubService clubService)
 {
     this.managerService = managerService;
     this.countryService = countryService;
     this.clubService    = clubService;
 }
Example #23
0
 public LocalServiceImporter(
     ISeriesService seriesService,
     IClubService clubService,
     IBoatClassService classService)
 {
     _coreSeriesService = seriesService;
     _coreClubService   = clubService;
     _coreClassService  = classService;
 }
Example #24
0
 public ClubController(IClubService clubService, IClubAdministrationService clubAdministrationService,
                       IClubMembersService clubMembersService, IUserManagerService userManagerService, IMapper mapper)
 {
     _clubService = clubService;
     _clubAdministrationService = clubAdministrationService;
     _clubMembersService        = clubMembersService;
     _userManagerService        = userManagerService;
     _mapper = mapper;
 }
Example #25
0
        public override void Setup()
        {
            base.Setup();

#if UNIT
            ClubService = new ClubService(WebClient);
#elif INT
            ClubService = ServiceLocator.Get <IClubService>();
#endif
        }
Example #26
0
 public ClubController(ILoggerService <ClubController> logger,
                       IClubService ClubService,
                       IClubMembersService ClubMembersService,
                       IMapper mapper)
 {
     _logger             = logger;
     _ClubService        = ClubService;
     _ClubMembersService = ClubMembersService;
     _mapper             = mapper;
 }
Example #27
0
 public ClubController(
     IUserService users,
     IMusicGenreService genres,
     IImageService images,
     IClubService clubs)
 {
     this.users  = users;
     this.genres = genres;
     this.images = images;
     this.clubs  = clubs;
 }
 public HomeController(
     IUserService userService,
     IFavoriteService favorService,
     IClubService clubService,
     ICityService cityService)
 {
     this.userService  = userService;
     this.favorService = favorService;
     this.clubService  = clubService;
     this.cityService  = cityService;
 }
Example #29
0
 public ClubsController(
     IClubService clubs,
     IClubAnonymousReviewService anonymousReviews,
     IClubHiddenImageService hiddenImages,
     IClubHiddenImageVoteService hiddenImagesVotes)
 {
     this.clubs = clubs;
     this.anonymousReviews = anonymousReviews;
     this.hiddenImages = hiddenImages;
     this.hiddenImagesVotes = hiddenImagesVotes;
 }
Example #30
0
 public ClubController(
     IUserService users,
     IMusicGenreService genres,
     IImageService images,
     IClubService clubs)
 {
     this.users = users;
     this.genres = genres;
     this.images = images;
     this.clubs = clubs;
 }
Example #31
0
 public ScoringSystemController(
     IClubService clubService,
     IScoringService scoringService,
     IAuthorizationService authService,
     IMapper mapper)
 {
     _clubService    = clubService;
     _scoringService = scoringService;
     _authService    = authService;
     _mapper         = mapper;
 }
Example #32
0
 public ClubsController(
     IClubService clubs,
     IClubAnonymousReviewService anonymousReviews,
     IClubHiddenImageService hiddenImages,
     IClubHiddenImageVoteService hiddenImagesVotes)
 {
     this.clubs             = clubs;
     this.anonymousReviews  = anonymousReviews;
     this.hiddenImages      = hiddenImages;
     this.hiddenImagesVotes = hiddenImagesVotes;
 }
Example #33
0
 public MatchService(IMatchRepository matchRepository, IMapper mapper, IClubService clubService)
 {
     _clubService = clubService;
     _mapper = mapper;
     _matchRepository = matchRepository;
 }
Example #34
0
 public UploadService(IUserService userService, IClubService clubService, IHostingEnvironment appEnvironment)
 {
     _userService = userService;
     _clubService = clubService;
     _appEnvironment = appEnvironment;
 }
 public ClubsController(IClubService ClubService)
 { _ClubService = ClubService; }
Example #36
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="clubService"></param>
 public ClubController(IClubService clubService)
 {
     _clubService = clubService;
 }
Example #37
0
        public override void Setup()
        {
            base.Setup();

            #if UNIT
            ClubService = new ClubService(WebClient);
            #elif INT
            ClubService = ServiceLocator.Get<IClubService>();
            #endif
        }