private DTeam InstantiateTeam(SqlCmdExt cmd) { var team = new DTeam { Id = cmd.GetInt("Id"), Name = cmd.GetString("Name"), League = GetLeague(cmd.GetInt("LeagueId")) }; return team; }
private DProspect InstantiateProspect(SqlCmdExt cmd) { var dProspect = new DProspect { Id = cmd.GetInt("Id"), Name = cmd.GetString("Name"), Team = GetTeam(cmd.GetInt("TeamId")), Height = cmd.GetInt("Height"), Weight = cmd.GetInt("Weight"), Position = GetPosition(cmd.GetInt("PositionId")), Handedness = GetHandedness(cmd.GetInt("HandednessId")), BirthDay = cmd.GetDateTime("BirthDay"), DraftYear = cmd.GetInt("DraftYear"), BirthCity = cmd.GetString("BirthCity"), BirthCountry = cmd.GetString("BirthCountry"), Notes = cmd.GetString("Notes") }; return dProspect; }
private void LoadHandednessPairs() { var idToHandedness = new Dictionary<int, string>(); var handednessToId = new Dictionary<string, int>(); using (var cmd = new SqlCmdExt(_connectionString)) { cmd.CreateCmd(@" SELECT Id, Hand FROM Handedness "); cmd.ExecuteSelect(); while (cmd.Read()) { var id = cmd.GetInt("Id"); var hand = cmd.GetString("Hand"); idToHandedness.Add(id, hand); handednessToId.Add(hand, id); } } _idToHandedness = idToHandedness; _handednessToId = handednessToId; }
private DLeague InstantiateLeague(SqlCmdExt cmd) { var league = new DLeague { Id = cmd.GetInt("Id"), Name = cmd.GetString("Name") }; return league; }
/* ******************************************************* * */ private void LoadPositionPairs() { var idToPosition = new Dictionary<int, string>(); var positionToId = new Dictionary<string, int>(); using (var cmd = new SqlCmdExt(_connectionString)) { cmd.CreateCmd(@" SELECT Id, Position FROM Position "); cmd.ExecuteSelect(); while (cmd.Read()) { var id = cmd.GetInt("Id"); var position = cmd.GetString("Position"); idToPosition.Add(id, position); positionToId.Add(position, id); } } _idToPosition = idToPosition; _positionToId = positionToId; }