Exemplo n.º 1
0
 public ContestController(
     IContestStore store,
     ITeamStore teams)
 {
     Store = store;
     Teams = teams;
 }
		public InviteToTeamController(
			ITeamStore teamStore = null,
			IEmailSender emailSender = null)
		{
			_teamStore = teamStore ?? new TeamStore();
			_emailSender = emailSender ?? new EmailSender();
		}
Exemplo n.º 3
0
        public async Task <IActionResult> Detail(int uid,
                                                 [FromServices] ISubmissionStore submissions,
                                                 [FromServices] ITeamStore contests)
        {
            var user = await UserManager.FindByIdAsync(uid);

            if (user == null)
            {
                return(NotFound());
            }

            ViewBag.Roles = await UserManager.ListRolesAsync(user);

            (ViewBag.Submissions, _) = await submissions.ListWithJudgingAsync(
                pagination : (1, 100),
                predicate : s => s.ContestId == 0 && s.Author == uid);

            ViewBag.Student = user.StudentId.HasValue
                ? await UserManager.FindStudentAsync(user.StudentId.Value)
                : null;

            ViewBag.Teams = await contests.ListRegisteredWithDetailAsync(uid);

            return(View(user));
        }
 public CreateTeamController(
     ITeamStore teamStore = null,
     ITeamProfileFactory teamProfileFactory = null,
     IUserSessionStore userSessionStore     = null)
 {
     _teamStore          = teamStore ?? new TeamStore();
     _teamProfileFactory = teamProfileFactory ?? new TeamProfileFactory();
     _userSessionStore   = userSessionStore ?? new UserSessionStore();
 }
 public TeamService(
     ITeamStore store,
     IMapper mapper,
     ITeamSearchQueryBuilder queryBuilder,
     IPricePolicyService pricePolicyService)
 {
     _store              = store;
     _mapper             = mapper;
     _queryBuilder       = queryBuilder;
     _pricePolicyService = pricePolicyService;
 }
 public JoinTeamController(
     ITeamStore teamStore = null,
     IInviteToTeamStore inviteToTeamStore = null,
     ITeamMemberStore teamMemberStore     = null,
     IUserSessionStore userSessionStore   = null)
 {
     _teamStore         = teamStore ?? new TeamStore();
     _inviteToTeamStore = inviteToTeamStore ?? new InviteToTeamStore();
     _teamMemberStore   = teamMemberStore ?? new TeamMemberStore();
     _userSessionStore  = userSessionStore ?? new UserSessionStore();
 }
Exemplo n.º 7
0
 public async Task <IActionResult> Updates(int cid,
                                           [FromServices] IClarificationStore clars,
                                           [FromServices] ITeamStore teams,
                                           [FromServices] IRejudgingStore rejs)
 {
     return(Json(new
     {
         clarifications = await clars.GetJuryStatusAsync(cid),
         teams = await teams.GetJuryStatusAsync(cid),
         rejudgings = await rejs.GetJuryStatusAsync(cid)
     }));
 }
Exemplo n.º 8
0
        public MatchBP(IMatchStore matchStore, IPlayerStore playerStore, ITeamStore teamStore, ISportStore sportStore)
        {
            if (matchStore == null) throw new ArgumentNullException("matchStore");
            if (playerStore == null) throw new ArgumentNullException("playerStore");
            if (teamStore == null) throw new ArgumentNullException("teamStore");
            if (sportStore == null) throw new ArgumentNullException("sportStore");

            _matchStore = matchStore;
            _playerStore = playerStore;
            _teamStore = teamStore;
            _sportStore = sportStore;
        }
Exemplo n.º 9
0
        public async Task <ActionResult <Scoreboard> > OnGet(int cid, bool @public,
                                                             [FromServices] ITeamStore store)
        {
            if (!Contest.StartTime.HasValue)
            {
                return(null);
            }
            var scb = await store.LoadScoreboardAsync(cid);

            var affs = await store.ListAffiliationAsync(cid);

            var orgs = await store.ListCategoryAsync(cid, false);

            var probs = Problems;

            var board = new FullBoardViewModel
            {
                RankCache    = scb.Data.Values,
                UpdateTime   = scb.RefreshTime,
                Problems     = probs,
                IsPublic     = @public,
                Categories   = orgs,
                Contest      = Contest,
                Affiliations = affs,
            };

            var opt = new int[probs.Length];

            for (int i = 0; i < probs.Length; i++)
            {
                opt[i] = i;
            }

            var go = board
                     .SelectMany(a => a)
                     .Select(t => new Scoreboard.Row
            {
                rank     = t.Rank.Value,
                team_id  = $"{t.TeamId}",
                score    = new Scoreboard.Score(t.Points, t.Penalty),
                problems = opt.Select(i => MakeProblem(t.Problems[i], probs[i]))
            });

            return(new Scoreboard
            {
                time = Contest.StartTime.Value,
                contest_time = DateTimeOffset.Now - Contest.StartTime.Value,
                event_id = $"{MaxEventId}",
                state = new State(Contest),
                rows = go,
            });
        }
Exemplo n.º 10
0
        public TournamentBP(IPlayerStore playerStore, ITeamStore teamStore, ISportStore sportStore, ITournamentStore tournamentStore, ITournamentSystemFactory tournamentSystemFactory)
        {
            if (playerStore == null) throw new ArgumentNullException("playerStore");
            if (teamStore == null) throw new ArgumentNullException("teamStore");
            if (sportStore == null) throw new ArgumentNullException("sportStore");
            if (tournamentSystemFactory == null) throw new ArgumentNullException("tournamentSystemFactory");

            _playerStore = playerStore;
            _teamStore = teamStore;
            _sportStore = sportStore;
            _tournamentStore = tournamentStore;
            _tournamentSystemFactory = tournamentSystemFactory;
        }
Exemplo n.º 11
0
 public ContestFacade(
     DbContextAccessor context,
     IContestStore store1,
     IProblemsetStore store2,
     ITeamStore store3,
     ISubmissionStore store4)
 {
     Context     = context;
     Contests    = store1;
     Problemset  = store2;
     Teams       = store3;
     Submissions = store4;
 }
Exemplo n.º 12
0
 public HireService(
     IPricePolicyService pricePolicyService,
     IHireStore hireStore,
     ITeamStore teamStore,
     IEmployeeStore employeeStore,
     IMapper mapper)
 {
     _pricePolicyService = pricePolicyService;
     _hireStore          = hireStore;
     _teamStore          = teamStore;
     _employeeStore      = employeeStore;
     _mapper             = mapper;
 }
Exemplo n.º 13
0
 public LeagueTeamStore(ITeamStore teamStore = null)
 {
     _teamStore = teamStore ?? new TeamStore();
 }
Exemplo n.º 14
0
 public TeamsController(ITeamStore store) => Store = store;
Exemplo n.º 15
0
 public TeamController(ITeamStore teamStore = null)
 {
     _teamStore = teamStore ?? new TeamStore();
 }