public void AddRegistration(Guardian guardian, Player player, string connectionString) { int? guardianId = guardian.Id; if (guardianId == null) { GuardianAccessor guardianAccessor = new GuardianAccessor(); guardianId=guardianAccessor.AddGuardian(guardian, connectionString); } PlayerAccessor playerAccessor = new PlayerAccessor(); player.GuardianId = guardianId; playerAccessor.AddPlayer(player, connectionString); }
public void AddPlayerTest() { Player testPlayer = new Player { FirstName = "Ken", LastName = "Versaw", Grade = 3, Gender = Gender.Male, MedicalConditions = "Allegies", NeedUniform = true, JeresySize = "XL", NumberRequest = 41, Buttons = 3, TeamId=null, GuardianId=null }; PlayerAccessor accessor = new PlayerAccessor(); string connection = ConfigurationManager.ConnectionStrings["BennetYouthBasketballDb"].ConnectionString; accessor.AddPlayer(testPlayer, connection); }