public void DeleteTeam(Team team)
        {
            teams.Remove(team);
            ITeamDal dal = PlayerFactory.GetTeamDal();

            dal.Delete(team.IdTeam);
        }
        public void UpdateTeam(Team team, int id)
        {
            ITeamDal dal = PlayerFactory.GetTeamDal();

            dal.Edit(new TeamDto
            {
                IdTeam = id,
                Name   = team.Name
            });
        }
        //CRUD
        public void CreateTeam(Team team)
        {
            teams.Add(team);
            ITeamDal dal = PlayerFactory.GetTeamDal();

            dal.Create(new TeamDto
            {
                Name  = team.Name,
                Owner = team.Owner
            });
        }
        public Team ReadTeam(int id)
        {
            ITeamDal dal     = PlayerFactory.GetTeamDal();
            TeamDto  teamDto = dal.GetTeamById(id);

            return(new Team()
            {
                IdTeam = teamDto.IdTeam,
                Name = teamDto.Name,
                Owner = teamDto.Owner
            });
        }
        public void GetPlayers(int id)
        {
            ITeamDal dal = PlayerFactory.GetTeamDal();

            foreach (var a in dal.GetById(id))
            {
                players.Add(new Player()
                {
                    LastName  = a.LastName,
                    FirstName = a.FirstName
                });
            }
        }
        public void GetAllTeams()
        {
            ITeamDal dal = PlayerFactory.GetTeamDal();

            foreach (var a in dal.GetData())
            {
                teams.Add(new Team()
                {
                    IdTeam = a.IdTeam,
                    Name   = a.Name,
                    Owner  = a.Owner
                });
            }
        }
Пример #7
0
 public TeamCollection()
 {
     teams = new List <Team>();
     dal   = PlayerFactory.GetTeamDal();
 }
Пример #8
0
 public void PostTeam()
 {
     ITeamDal dal = PlayerFactory.GetTeamDal(PlayerNameFromForm, TeamName);
 }