示例#1
0
 public ContestController(
     IContestStore store,
     ITeamStore teams)
 {
     Store = store;
     Teams = teams;
 }
示例#2
0
 public ContestUpdateFactory(
     IContestStore contestStore,
     IConnectedClientStore connectedClients)
 {
     _contestStore     = contestStore;
     _connectedClients = connectedClients;
 }
示例#3
0
        public async Task <IActionResult> Add(bool isgym,
                                              [FromServices] RoleManager <Role> roleManager,
                                              [FromServices] UserManager userManager,
                                              [FromServices] IContestStore store)
        {
            var c = await store.CreateAsync(new Contest
            {
                IsPublic = false,
                RegisterDefaultCategory = 0,
                ShortName = "DOMjudge",
                Name      = "Round 1",
                Gym       = isgym,
            });

            await HttpContext.AuditAsync("added", $"{c.ContestId}");

            int cid      = c.ContestId;
            var roleName = $"JuryOfContest{cid}";
            var result   = await roleManager.CreateAsync(new Role(roleName) { ContestId = cid });

            if (!result.Succeeded)
            {
                return(Json(result));
            }

            var firstUser = await userManager.GetUserAsync(User);

            var roleAttach = await userManager.AddToRoleAsync(firstUser, roleName);

            if (!roleAttach.Succeeded)
            {
                return(Json(roleAttach));
            }
            return(RedirectToAction("Home", "Jury", new { area = "Contest", cid }));
        }
示例#4
0
 public JudgingFinishedHandler(
     DbContextAccessor db,
     IContestStore contests,
     IProblemsetStore probs)
 {
     Context  = db;
     Contests = contests;
     Problems = probs;
 }
示例#5
0
 public ContestFacade(
     DbContextAccessor context,
     IContestStore store1,
     IProblemsetStore store2,
     ITeamStore store3,
     ISubmissionStore store4)
 {
     Context     = context;
     Contests    = store1;
     Problemset  = store2;
     Teams       = store3;
     Submissions = store4;
 }
示例#6
0
 public ContestsController(IContestStore store) => Store = store;
示例#7
0
 public PullRopeHandler(IContestStore contestStore)
 {
     _contestStore = contestStore;
 }
 public JoinContestHandler(IContestStore contestStore)
 {
     _contestStore = contestStore;
 }
示例#9
0
 public ConnectHook(IContestStore contestStore, ICharacterStateService characterStateService)
 {
     _contestStore          = contestStore;
     _characterStateService = characterStateService;
 }
示例#10
0
 public StartContestHandler(IContestStore contestStore)
 {
     _contestStore = contestStore;
 }