Exemple #1
0
        public void IniclizeManagers()
        {
            IUserRepository       userRepo = new UserRepository();
            ITournamentRepository tourRepo = new TournamentRepository();

            _programManager    = new ProgramManager();
            _tournamentManager = new TournamentManager(tourRepo);
            _userManager       = new UserManager(userRepo);
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _tournamentManager.Dispose();
                _tournamentManager = null;

                base.Dispose(disposing);
            }
        }
Exemple #3
0
        public void Dispose()
        {
            _userManager.Dispose();
            _userManager = null;

            _programManager.Dispose();
            _programManager = null;

            _tournamentManager.Dispose();
            _tournamentManager = null;
        }
 public TournamentController(ITournamentManager tournamentManager, IScoreManager scoreManager)
 {
     _tournamentManager = tournamentManager;
     _scoreManager      = scoreManager;
 }
Exemple #5
0
 public ActionController(ITournamentManager tournamentManager, IUserManager userManager)
 {
     _tournamentManager = tournamentManager;
     _userManager = userManager;
 }
 public ManageTournamentsController(ITournamentManager tournamentManager)
 {
     _tournamentManager = tournamentManager;
 }
Exemple #7
0
 public ReportController(ITournamentRegistrationsManager tournamentRegistrationsManager, ITournamentManager tournamentManager, ICountryManager countryManager, DebRegUserManager userManager, ISecurityManager securityManager, ISlotManager slotManager)
 {
     this.tournamentRegistrationsManager = tournamentRegistrationsManager;
     this.tournamentManager = tournamentManager;
     this.countryManager = countryManager;
     this.securityManager = securityManager;
     this.userManager = userManager;
     this.slotManager = slotManager;
 }
Exemple #8
0
 public HomeController(ITournamentManager tournamentManager)
 {
     _tournamentManager = tournamentManager;
 }
 public ManageTaskController(ITournamentManager tournamentManager, IUserManager userManager)
 {
     _tournamentManager = tournamentManager;
     _userManager = userManager;
 }
 public ManageTournamentsController(ITournamentManager tournamentManager)
 {
     _tournamentManager = tournamentManager;
 }
Exemple #11
0
        //public ActionResult SendAssignmentNotifications() {
        //    // Find currentTournament

        //    var ident = HttpContext.User.Identity as ClaimsIdentity;
        //    var currentTournamentId = claimsManager.GetCurrentTournamentId(ident);
        //    var user = userManager.FindById(ident.GetUserId());

        //    String paymentPageUrl = HttpContext.Request.Url.GetLeftPart(UriPartial.Authority) +
        //        Url.Action("Display", "TournamentRegistration", new {
        //            Area = "",
        //            tournamentId = "{0}",   // will be filled by slotManager
        //            organizationId = "{1}",  // will be filled by slotManager
        //            tab = "account",
        //        });
        //    paymentPageUrl = HttpContext.Server.UrlDecode(paymentPageUrl);
        //    slotManager.SendAssignmentNotifications(currentTournamentId, paymentPageUrl, user);
        //    return Redirect("Index");
        //}
        public SlotController(
            IUnitOfWork unitOfWork,
            ITournamentRegistrationsManager tournamentRegistrationsManager,
            ISlotAssignmentManager slotAssignmentManager,
            ISlotManager slotManager,
            IOrganizationManager organizationManager,
            ITournamentManager tournamentManager,
            DebRegUserManager userManager)
        {
            this.unitOfWork = unitOfWork;
            // this.claimsManager = claimsManager;
            this.tournamentRegistrationsManager = tournamentRegistrationsManager;
            this.slotAssignmentManager = slotAssignmentManager;
            this.slotManager = slotManager;
            this.organizationManager = organizationManager;
            this.tournamentManager = tournamentManager;
            this.userManager = userManager;
        }
Exemple #12
0
        public void IniclizeManagers()
        {
            IUserRepository userRepo = new UserRepository();
            ITournamentRepository tourRepo = new TournamentRepository();

            _programManager = new ProgramManager();
            _tournamentManager = new TournamentManager(tourRepo);
            _userManager = new UserManager(userRepo);
        }
Exemple #13
0
        public void Dispose()
        {
            _userManager.Dispose();
            _userManager = null;

            _programManager.Dispose();
            _programManager = null;

            _tournamentManager.Dispose();
            _tournamentManager = null;
        }
 public TournamentsController(ITournamentManager tournamentManager, ITournamentRegistrationsManager tournamentRegistrationsManager, DebRegUserManager userManager)
 {
     this.tournamentManager = tournamentManager;
     this.userManager = userManager;
     this.tournamentRegistrationsManager = tournamentRegistrationsManager;
 }
 public TournamentController(ITournamentManager tournamentManager, IScoreManager scoreManager)
 {
     _tournamentManager = tournamentManager;
     _scoreManager = scoreManager;
 }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _tournamentManager.Dispose();
                _tournamentManager = null;

                _userManager.Dispose();
                _userManager = null;

                base.Dispose(disposing);
            }
        }
Exemple #17
0
        //public FinanceController(ITournamentManager tournamentManager, ITournamentRegistrationsManager registrationManager, IPaymentManager paymentManager, IBookingManager bookingManager)
        //{
        //    this.tournamentManager = tournamentManager;
        //    this.registrationManager = registrationManager;
        //    this.paymentManager = paymentManager;
        //    // this.claimsManager = claimsManager;
        //    this.bookingManager = bookingManager;
        //    this.userManager = UserManager;
        //}

        public FinanceController(ITournamentManager tournamentManager, ITournamentRegistrationsManager registrationManager, IPaymentManager paymentManager, IBookingManager bookingManager, DebRegUserManager userManager)
        {
            this.tournamentManager = tournamentManager;
            this.registrationManager = registrationManager;
            this.paymentManager = paymentManager;
            this.bookingManager = bookingManager;

            this.userManager = userManager;
        }
 public ManageTaskController(ITournamentManager tournamentManager, IUserManager userManager)
 {
     _tournamentManager = tournamentManager;
     _userManager       = userManager;
 }
Exemple #19
0
        //public UserController(
        //    IUnitOfWork unitOfWork,
        //    TournamentRegistrationsManager tournamentRegistrationsManager,
        //    ISendMail sendMail,
        //    OrganizationManager organizationManager,
        //    ISecurityManager securityManager,
        //    ICountryManager countryManager,
        //    ITournamentManager tournamentManager)
        //{
        //    this.unitOfWork = unitOfWork;
        //    this.tournamentRegistrationsManager = tournamentRegistrationsManager;
        //    this.sendMail = sendMail;
        //    this.organizationManager = organizationManager;
        //    this.userManager = this.UserManager;
        //    this.securityManager = securityManager;
        //    this.countryManager = countryManager;
        //    this.tournamentManager = tournamentManager;
        //}

        public UserController(
            IUnitOfWork unitOfWork,
            TournamentRegistrationsManager tournamentRegistrationsManager,
            ISendMail sendMail,
            OrganizationManager organizationManager,
            DebRegUserManager userManager,
            ISecurityManager securityManager,
            ICountryManager countryManager,
            ITournamentManager tournamentManager)
        {
            this.unitOfWork = unitOfWork;
            this.tournamentRegistrationsManager = tournamentRegistrationsManager;
            this.sendMail = sendMail;
            this.organizationManager = organizationManager;
            this.securityManager = securityManager;
            this.countryManager = countryManager;
            this.tournamentManager = tournamentManager;
            this.userManager = userManager;
        }
Exemple #20
0
 public HomeController(ITournamentManager tournamentManager)
 {
     _tournamentManager = tournamentManager;
 }
Exemple #21
0
 public SlotManager(ISlotAssignmentManager slotAssignmentManager, ITournamentRegistrationsManager tournamentRegistrationsManager, ITournamentManager tournamentManager, IBookingManager bookingManager, IEMailService mailService, DebRegUserManager userManager)
 {
     this.slotAssignmentManager = slotAssignmentManager;
     this.tournamentregistrationsManager = tournamentRegistrationsManager;
     this.tournamentManager = tournamentManager;
     this.bookingManager = bookingManager;
     this.mailService = mailService;
     this.userManager = userManager;
 }
Exemple #22
0
        public void Init()
        {
            // Create mocks
            DebRegDataMocks dataMocks = new DebRegDataMocks();
            DebRegCommunicationMocks communicationMocks = new DebRegCommunicationMocks();
            userManager = dataMocks.UserManager;

            unitOfWork = dataMocks.UnitOfWork;
            // Create Managers
            slotAssignmentManager = new SlotAssignmentManager(unitOfWork);
            tournamentManager = new TournamentManager(unitOfWork, userManager);
            tournamentRegistrationsManager = new TournamentRegistrationsManager(unitOfWork, communicationMocks.EMailService, userManager);
            bookingManager = new BookingManager(unitOfWork);

            slotManager = new SlotManager(slotAssignmentManager, tournamentRegistrationsManager, tournamentManager, bookingManager, communicationMocks.EMailService, userManager);

            // Create basic objects

            Organization hostingOrganization = new Organization { Id = Guid.NewGuid() };
            Random rand = new Random();

            User user = CreateUserWithOrganizationRole(hostingOrganization, OrganizationRole.OrganizationTournamentManager);

            // Create tournament

            tournament = new Tournament
            {
                Id = Guid.NewGuid(),
                HostingOrganization = hostingOrganization,
                HostingOrganizationID = hostingOrganization.Id,
                TeamProduct = new Product
                {
                    Id = Guid.NewGuid(),
                    Price = 40
                },
                AdjudicatorProduct = new Product
                {
                    Id = Guid.NewGuid(),
                    Price = 20
                }
            };
            {
                var task = tournamentManager.AddTournamentAsync(tournament, user);
                if (!task.IsCompleted)
                {
                    task.Wait();
                }
            }

            // Create registrations
            Guid[] organizationIds = new Guid[] { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };

            for (int i = 0; i < organizationIds.Length; i++)
            {
                int teamsWanted = i + 1;
                int adjudicatorsWanted = i;
                var registration = tournamentRegistrationsManager.AddRegistration(
                    tournament.Id,
                    organizationIds[i],
                    organizationIds[i],
                    teamsWanted,
                    adjudicatorsWanted,
                    null,
                    user
                );

                registration.OrganizationStatus = OrganizationStatus.Approved;
                registration.OrganizationStatusDraft = false;
            }

        }
Exemple #23
0
 public ActionController(ITournamentManager tournamentManager, IUserManager userManager)
 {
     _tournamentManager = tournamentManager;
     _userManager       = userManager;
 }