public void AddProspect(DProspect prospect) { if (prospect.DraftYear == 0) { prospect.DraftYear = Conversions.GetDraftYearFromBirthYear(prospect.BirthDay); } db.AddProspect(prospect); }
public bool ProspectExists(DProspect prospect) { try { var existingProspect = db.GetProspect(prospect.Name, prospect.BirthDay); } catch (Exception e) { return(false); } return(true); }
/* ******************************************************* * */ public void AddProspect(DProspect prospect) { using (var cmd = new SqlCmdExt(_connectionString)) { cmd.CreateCmd(@" INSERT INTO Prospect ( Name, TeamId, Height, Weight, PositionId, HandednessId, BirthDay, DraftYear, BirthCity, BirthCountry, Notes ) VALUES ( @Name, @TeamId, @Height, @Weight, @PositionId, @HandednessId, @BirthDay, @DraftYear, @BirthCity, @BirthCountry, @Notes )"); cmd.SetInArg("@Name", prospect.Name); cmd.SetInArg("@TeamId", prospect.Team.Id); cmd.SetInArg("@Height", prospect.Height); cmd.SetInArg("@Weight", prospect.Weight); cmd.SetInArg("@PositionId", GetPositionId(prospect.Position)); cmd.SetInArg("@HandednessId", GetHandednessId(prospect.Handedness)); cmd.SetInArg("@BirthDay", prospect.BirthDay); cmd.SetInArg("@DraftYear", prospect.DraftYear); cmd.SetInArg("@BirthCity", prospect.BirthCity); cmd.SetInArg("@BirthCountry", prospect.BirthCountry); cmd.SetInArg("@Notes", prospect.Notes); cmd.ExecuteInsertUpdateDelete(); } }
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); }
public void AddProspect(DProspect prospect) { }
public bool ProspectExists(DProspect prospect) { return(false); }