TournamentForm . populated teams list
This commit is contained in:
@ -10,6 +10,7 @@ namespace TrackerLibrary.DataAccess
|
||||
PrizeModel CreatePrize(PrizeModel model);
|
||||
PersonModel CreatePerson(PersonModel model);
|
||||
TeamModel CreateTeam(TeamModel model);
|
||||
List<TeamModel> GetTeam_All();
|
||||
List<PersonModel> GetPerson_All();
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,5 +99,22 @@ namespace TrackerLibrary.DataAccess
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public List<TeamModel> GetTeam_All()
|
||||
{
|
||||
List<TeamModel> output;
|
||||
using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString(db)))
|
||||
{
|
||||
output = connection.Query<TeamModel>("dbo.spTeam_GetAll").ToList();
|
||||
|
||||
foreach(TeamModel team in output)
|
||||
{
|
||||
var p = new DynamicParameters();
|
||||
p.Add("@TeamId", team.Id);
|
||||
team.TeamMembers = connection.Query<PersonModel>("dbo.spTeamMembers_GetByTeam",p, commandType: CommandType.StoredProcedure).ToList();
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,5 +93,10 @@ namespace TrackerLibrary.DataAccess
|
||||
{
|
||||
return PeopleFile.FullFilePath().LoadFile().ConvertToPersonModels();
|
||||
}
|
||||
|
||||
public List<TeamModel> GetTeam_All()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user