Example #1
0
        private Player GetPlayerInfo(int seasonId, int peopleId)
        {
            var rep = new PlayerRepository(new CSBCDbContext());
            var player = rep.GetPlayerByPersonAndSeasonId(peopleId, seasonId);
            if (player == null)
            {
                //if none found get last season
                var newSeason = rep.GetLastSeasonPlayed(peopleId);
               //need to call something!
            }
            FillPlayerFields(player);

            return player;
        }
Example #2
0
 public void GetPlayerByPersonAndSeasonIdTest()
 {
     var rep = new PlayerRepository(new CSBCDbContext());
     var season = rep.GetPlayerByPersonAndSeasonId(2, 2);
     Assert.IsTrue(season != null);
 }
Example #3
0
 private int GetPlayerId()
 {
     var PlayerId = 0;
     var rep = new PlayerRepository(new CSBCDbContext());
     var player = rep.GetPlayerByPersonAndSeasonId(Master.PeopleId, Master.SeasonId);
     if (player == null)
         player = rep.GetByPeopleId(Master.PeopleId);
     else
     {
         ClearPaymentFields();
     }
     if (player != null)
         PlayerId = player.PlayerID;
     return PlayerId;
 }