Example #1
0
        public void GetTeamPlayersTest()
        {
            var context = new CSBC.Core.Data.CSBCDbContext();
            var rep = new PlayerRepository(context);
            var repTeam = new TeamRepository(context);
            //var seasonId = repSeason.GetCurrentSeason(1).SeasonID;
            var players = rep.GetTeamPlayers(5954);       //test value

            Assert.IsTrue(players.Count<SeasonPlayer>() > 0);
        }
Example #2
0
 private void LoadTeamPlayers(int teamId)
 {
     var rep = new PlayerRepository(new CSBCDbContext());
     var players = rep.GetTeamPlayers(teamId);
     try
     {
         grdPlayers.DataSource = players;
         grdPlayers.DataBind();
         if (players.Any())
         {
             lblRecordCount.Text = players.Count<SeasonPlayer>().ToString() + " players";
             lblRecordCount.CssClass = "text-info";
         }
         else
         {
             lblRecordCount.Text = "No players assigned to team!";
             lblRecordCount.CssClass = "text-warning";
         }
         btnDelete.Enabled = !(players.Any());
     }
     catch (Exception ex)
     {
         lblError.Text = "TeamPlayers::" + ex.Message;
     }
 }