Example #1
0
        public static ITeam ConstructTeamFromDAO(List <object> teamFromDao)
        {
            if (teamFromDao == null)
            {
                return(null);
            }

            ITeam result = new Team();

            // [0] = ID, [1] = Club_id
            result.Id     = (int)teamFromDao[0];
            result.ClubId = (int)teamFromDao[1];

            // On ajoute les joueurs correspondant au TeamId au result
            IManagePlayerDatabase managePlayerDatabase = DatabaseSingleton <ManagePlayerDatabase> .Instance;

            result.Players = DaoServicesPlayer.ConstructPlayersFromDAO(managePlayerDatabase.GetPlayersByTeamId(result.Id));

            return(result);
        }
Example #2
0
        public static List <IPlayer> GetPlayers(string clubName)
        {
            IManagePlayerDatabase managePlayerDatabase = DatabaseSingleton <ManagePlayerDatabase> .Instance;

            return(DaoServicesPlayer.ConstructPlayersFromDAO(managePlayerDatabase.GetPlayers(clubName)));
        }