Ejemplo n.º 1
0
      // GET: Teams
      public ActionResult Index()
      {
          var model = new TeamIndexModel
          {
              AvailablePlayers = mngLogic.getAvailablePlayers(),
              Teams            = db.Teams.ToList(),
          };

          return(View(model));
      }
Ejemplo n.º 2
0
        public ActionResult Index(int?page, string CurrentFilter, int?teamID)
        {
            int pageSize   = 9;
            int pageNumber = (page ?? 1);

            ViewBag.teamID = teamID;
            TeamIndexModel teamIndexModel = new TeamIndexModel();

            teamIndexModel.TeamPagedList = (_teamModelListLogic.GetTeamModelList(teamID > 0 ? teamID : 0)).ToPagedList(pageNumber, pageSize);
            return(View(teamIndexModel));
        }
Ejemplo n.º 3
0
        public IActionResult Index()
        {
            var teams = _teamService.GetAll()
                        .OrderBy(team => team.TeamName)
                        .Select(c => new TeamListingModel
            {
                TeamName     = c.TeamName,
                TeamBadgeUrl = c.TeamBadgeUrl,
                Nickname     = c.Nickname,
                YearFounded  = c.YearFounded
            });
            var model = new TeamIndexModel
            {
                TeamList = teams
            };

            return(View(model));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> AssignTeamsAsync(TeamIndexModel model)
        {
            if (ModelState.IsValid && model != null)
            {
                var updateModel = model.UpdateModel;
                if (!string.IsNullOrEmpty(updateModel.Username) &&
                    !string.IsNullOrEmpty(updateModel.Team))
                {
                    var user = await _userManager.FindByNameAsync(updateModel.Username)
                               .ConfigureAwait(false);

                    var succeeded = _userBug.AssignUserToTeam(user, updateModel.Team);
                    if (succeeded)
                    {
                        return(RedirectToAction("ManageTeams", "Management"));
                    }
                }
            }
            return(RedirectToAction("ManageTeams", "Management"));
        }
Ejemplo n.º 5
0
        public IActionResult ManageTeams()
        {
            var listingModel = _user.GetAll()
                               .Select(result => new TeamListingModel
            {
                FullName = result.FirstName + " " + result.LastName,
                Username = result.UserName,
                Email    = result.Email,
                Team     = _user.GetTeamName(result),
                Role     = _user.GetAllRolesAsync(result, ',').Result
            });
            var model = new TeamIndexModel
            {
                UserTeams = listingModel,
                Usernames = _userManager.Users.Select(user => user.UserName).ToList(),
                Teams     = _bug.GetAllTeams().Select(team => team.Name).ToList(),
            };

            return(View(model));
        }
Ejemplo n.º 6
0
        public IActionResult LeagueTeams(int id)
        {
            var teams = _teamService.GetAll()
                        .Where(l => l.LeagueId == id)
                        .OrderBy(team => team.TeamName)
                        .Select(c => new TeamListingModel
            {
                Id           = c.Id,
                TeamName     = c.TeamName,
                TeamBadgeUrl = c.TeamBadgeUrl,
                Nickname     = c.Nickname,
                YearFounded  = c.YearFounded,
                LeagueId     = c.LeagueId
            });
            var model = new TeamIndexModel
            {
                TeamList = teams
            };

            return(View(model));
        }
Ejemplo n.º 7
0
        public ActionResult Index()
        {
            var model = TeamIndexModel.GetTeams();

            return(View(model));
        }