public override bool Equals(object obj)
        {
            MainTeam a = obj as MainTeam;

            if (obj == null)
            {
                return(false);
            }
            return(a.MainTeamID == this.MainTeamID);
        }
Exemple #2
0
 public bool AddNewMainTeam(MainTeam t)
 {
     try
     {
         context.Teams.Add(t);
         context.SaveChanges();
         return(true);
     } catch
     {
         return(false);
     }
 }
Exemple #3
0
        public bool InactivateMainTeam(int id)
        {
            MainTeam team = this.GetMainTeamByID(id);

            try
            {
                team.Active = false;
                context.SaveChanges();
                return(true);
            } catch
            {
                return(false);
            }
        }
Exemple #4
0
        public bool RemoveLeagueTeams(int leagueid, MainTeam t)
        {
            League l = GetLeagueByID(leagueid);

            try
            {
                l.MainTeams.Remove(t);
                context.SaveChanges();
                return(true);
            } catch
            {
                return(false);
            }
        }
Exemple #5
0
        public bool UpdateMainTeamWebsite(int id, string website)
        {
            MainTeam t = this.GetMainTeamByID(id);

            try
            {
                t.Website = website;
                context.SaveChanges();
                return(true);
            } catch
            {
                return(false);
            }
        }
Exemple #6
0
        public bool AddTeamToLadder(int id, MainTeam t)
        {
            Ladder l = this.GetLadderById(id);

            try
            {
                l.MainTeams.Add(t);
                context.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #7
0
        public bool RemoveTeamFromLadder(int id, MainTeam t)
        {
            Ladder l = this.GetLadderById(id);

            try
            {
                l.MainTeams.Remove(t);
                context.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #8
0
        public bool AddLeagueTeams(int leagueid, MainTeam t)
        {
            League q = GetLeagueByID(leagueid);

            try
            {
                q.MainTeams.Add(t);
                context.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #9
0
        public bool UpdateGamerMainTeam(int gamerID, MainTeam mt)
        {
            Gamer g = this.GetGamerById(gamerID);

            g.MainTeam = mt;
            try
            {
                context.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
        public int CompareTo(object obj)
        {
            MainTeam team = obj as MainTeam;

            return(this.TeamName.CompareTo(team.TeamName));
        }