Esempio n. 1
0
        public bool AddPlayerToTeam(string PlayerID, string TeamID, int Role)
        {
            List <string[]> param = new List <string[]>()
            {
                new string[] { "@PlayerID", PlayerID },
                new string[] { "@TeamID", TeamID },
                new string[] { "@Role", Role.ToString() },
            };
            var result = SQLConnection.ExecuteNonSearchQueryParameters("INSERT INTO UserTeams (UserID,TeamID,Role) VALUES (@PlayerID,@TeamID,@Role)", param);

            return(result);
        }
Esempio n. 2
0
        public bool EditTeam(TeamDTO teamDTO)
        {
            List <string[]> param = new List <string[]>()
            {
                new string[] { "@TeamID", teamDTO.TeamID },
                new string[] { "@TeamName", teamDTO.TeamName },
                new string[] { "@MinimumElo", teamDTO.MinimumElo.ToString() },
                new string[] { "@IsPrivate", (Convert.ToInt32(teamDTO.IsPrivate)).ToString() },
                new string[] { "@Description", teamDTO.Description },
                new string[] { "@CountryOfOrigin", ((int)teamDTO.Country).ToString() },
                new string[] { "@SpokenLanguage", ((int)teamDTO.Language).ToString() },
                new string[] { "@MinimumAge", teamDTO.MinimumAge.ToString() },
                new string[] { "@PlayedGame", ((int)teamDTO.PlayedGame).ToString() },
            };

            return(SQLConnection.ExecuteNonSearchQueryParameters($"UPDATE Teams SET `TeamName` = @TeamName, `MinimumElo` = @MinimumElo, `IsPrivate` = @IsPrivate, `Description` = @Description, `CountryOfOrigin` = @CountryOfOrigin, `SpokenLanguage` = @SpokenLanguage, `MinimumAge` = @MinimumAge, `PlayedGame` = @PlayedGame WHERE TeamID = @TeamID", param));
        }
Esempio n. 3
0
        public bool CreateTeam(TeamDTO teamDTO)
        {
            List <string[]> param = new List <string[]>()
            {
                new string[] { "@TeamID", teamDTO.TeamID },
                new string[] { "@TeamName", teamDTO.TeamName },
                new string[] { "@MinimumElo", teamDTO.MinimumElo.ToString() },
                new string[] { "@IsPrivate", (Convert.ToInt32(teamDTO.IsPrivate)).ToString() },
                new string[] { "@Description", teamDTO.Description },
                new string[] { "@CountryOfOrigin", ((int)teamDTO.Country).ToString() },
                new string[] { "@SpokenLanguage", ((int)teamDTO.Language).ToString() },
                new string[] { "@MinimumAge", teamDTO.MinimumAge.ToString() },
                new string[] { "@PlayedGame", ((int)teamDTO.PlayedGame).ToString() },
            };
            var result = SQLConnection.ExecuteNonSearchQueryParameters($"INSERT INTO Teams (TeamID,TeamName,MinimumElo,IsPrivate,Description,CountryOfOrigin,SpokenLanguage,MinimumAge,PlayedGame) VALUES (@TeamID, @TeamName,@MinimumElo,@IsPrivate,@Description,@CountryOfOrigin,@SpokenLanguage,@MinimumAge,@PlayedGame);", param);

            return(result);
        }