public void Insert_Player_Test() { Player player = new Player(44, "Football Guy"); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(player); }
public void Delete_Fav_Team_Test() { Fav_Team fav_team = new Fav_Team(1, 1, 3); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(fav_team); }
public void Update_Player_Stat_Test() { Player_Stat player_Stat = new Player_Stat(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Edit(player_Stat); }
public void Delete_User_Test() { User user = new User("User", "Password", 2); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(user); }
public void Update_Team_Stat_Test() { Team_Stat team_Stat = new Team_Stat(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Edit(team_Stat); }
public void Update_Team_Test() { Team team = new Team("Football Team 2", 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Edit(team); }
public void Insert_Team_Stat_Test() { Team_Stat team_Stat = new Team_Stat(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(team_Stat); }
public void Delete_Team_Play_Test() { Team_Play team_play = new Team_Play(1, 1, 2); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(team_play); }
public void Insert_Fav_Team_Test() { Fav_Team fav_team = new Fav_Team(1, 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(fav_team); }
public void Insert_Player_Stat_Test() { Player_Stat player_Stat = new Player_Stat(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(player_Stat); }
public void Insert_Fav_Player_Test() { Fav_Player fav_player = new Fav_Player(1, 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(fav_player); }
public void Insert_User_Test() { User user = new User("User", "Password"); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(user); }
public void Insert_Team_Test() { Team team = new Team("Football Team"); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(team); }
public void Delete_Player_Stat_Test() { Player_Stat player_Stat = new Player_Stat(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(player_Stat); }
public void Insert_Team_Play_Test() { Team_Play team_play = new Team_Play(1, 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(team_play); }
public void Delete_Team_Stat_Test() { Team_Stat team_Stat = new Team_Stat(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(team_Stat); }
public void Insert_Player_Play_Test() { Player_Play player_play = new Player_Play(1, 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(player_play); }
public void Delete_Player_Play_Test() { Player_Play player_play = new Player_Play(1, 1, 3); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(player_play); }
public void Delete_Player_Test() { Player player = new Player(44, "Football Guy", 2); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(player); }
public void Update_Player_Test() { Player player = new Player(43, "Football Guy", 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Edit(player); }
public void Delete_Team_Test() { Team team = new Team("Football Team", 2); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(team); }
public void Update_User_Test() { User user = new User("User 2", "Password 2", 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Edit(user); }
public void Delete_Fav_Player_Test() { Fav_Player fav_player = new Fav_Player(1, 1, 3); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(fav_player); }
public static List <Team> GetTeams() { var dbManipulator = new Database_Manipulator(); var teams = new List <Team>(); teams = dbManipulator.SelectAllTeams(); return(teams); }
static void InsertTeamStats(List <KeyValuePair <int, Team_Stat> > stats) { Database_Manipulator manipulator = new Database_Manipulator(); foreach (KeyValuePair <int, Team_Stat> stat in stats) { int stat_id = manipulator.Insert(stat.Value); manipulator.Insert(new Team_Play(stat.Key, stat_id)); } }
public static List <StatPlayer> GetPlayers() { var dbManipulator = new Database_Manipulator(); var players = new List <Player>(); var statPlayers = new List <StatPlayer>(); SqlCommand command; players = dbManipulator.SelectAllEntries(); foreach (Player p in players) { var statIds = new List <int>(); var stats = new List <Player_Stat>(); string stat_string = "SELECT Player_Stat_Id FROM Player_Plays WHERE Player_Id = " + p.Id; command = new SqlCommand(stat_string, connection); connection.Open(); var reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { statIds.Add(reader.GetInt32(0)); } } connection.Close(); foreach (int stat in statIds) { string getStats = "SELECT * FROM Player_Stats WHERE Player_Stat_Id = " + stat; command = new SqlCommand(getStats, connection); connection.Open(); reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { stats.Add(new Player_Stat(reader.GetInt32(1), reader.GetInt32(2), reader.GetInt32(3), reader.GetInt32(4), reader.GetInt32(5), reader.GetInt32(6), reader.GetInt32(7), reader.GetInt32(8), reader.GetInt32(9), reader.GetInt32(10), reader.GetInt32(11), reader.GetInt32(12), reader.GetInt32(0))); } } connection.Close(); } statPlayers.Add(new StatPlayer(p, stats)); } return(statPlayers); }