public void AddTeam(Team team)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Team.Add(team);
         db.SaveChanges();
     }
 }
 public void AddLeader(Leader leader)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_leader.Add(leader);
         db.SaveChanges();
     }
 }
 public void AddGameInformation(GameInformation gameInformation)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_gameInformation.Add(gameInformation);
         db.SaveChanges();
     }
 }
 public void AddPersonalItemFinalScore(PersonalItemFinalScore personalItemFinalScore)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_PersonalItemFinalScore.Add(personalItemFinalScore);
         db.SaveChanges();
     }
 }
 public void AddAthlete(Athlete athlete)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_athlete.Add(athlete);
         db.SaveChanges();
     }
 }
 public void AddItem(Item item)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_item.Add(item);
         db.SaveChanges();
     }
 }
 public void AddCoach(Coach coach)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_coach.Add(coach);
         db.SaveChanges();
     }
 }
 public void AddReferee(Referee referee)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_referee.Add(referee);
         db.SaveChanges();
     }
 }
 //Add
 public void AddAdmin(Admin admin)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_admin.Add(admin);
         db.SaveChanges();
     }
 }
 public void AddDoctor(Doctor doctor)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_doctor.Add(doctor);
         db.SaveChanges();
     }
 }
 public void UpdateRefereeScore(RefereeScore refereeScore)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_refereeScore.Attach(refereeScore);
         db.Entry(refereeScore).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 public void UpdateGameInfo(GameInformation gameInformation)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_gameInformation.Attach(gameInformation);
         db.Entry(gameInformation).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 public void UpdateCoach(Coach coach)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_coach.Attach(coach);
         db.Entry(coach).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 public void UpdateAthlete(Athlete athlete)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_athlete.Attach(athlete);
         db.Entry(athlete).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 public void UpdateDoctor(Doctor doctor)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_doctor.Attach(doctor);
         db.Entry(doctor).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 public void UpdateLeader(Leader leader)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Tb_leader.Attach(leader);
         db.Entry(leader).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
 //更新 表
 public void UpdateTeam(Team team)
 {
     using (var db = new GymCompetitionDB())
     {
         db.Team.Attach(team);
         db.Entry(team).State = EntityState.Modified;
         db.SaveChanges();
     }
 }