public void SetNote(int AthleteID, string Key, string Note) { if (AthleteID == 0) { return; } // existing athlete Athlete Athlete = getAthlete(AthleteID); if (Athlete == null) { return; } PublicNote note = new PublicNote(Athlete, DateTime.Now); note.Key = System.Web.HttpUtility.UrlDecode(Key); note.Note = System.Web.HttpUtility.UrlDecode(Note); // only add a note that either has a Key, a Note or Both. if (!(string.IsNullOrWhiteSpace(note.Key) && string.IsNullOrWhiteSpace(note.Note))) { Athlete.AddNote(note); } else { //hmm } }
public void SetAvailability(int AthleteID, string Championship, bool Available, string Transport, string PreferredEvent, string PersonalBest) { if (AthleteID == 0) { return; } // existing athlete Athlete Athlete = getAthlete(AthleteID); if (Athlete == null) { return; } DeclaredAvailibilityInformation info = new DeclaredAvailibilityInformation(Athlete, DateTime.Now); info.Championship = System.Web.HttpUtility.UrlDecode(Championship); info.Availability = Available ? "Available" : "Not Available"; info.TransportMethod = System.Web.HttpUtility.UrlDecode(Transport); info.PreferredEvent = System.Web.HttpUtility.UrlDecode(PreferredEvent); info.PersonalBest = System.Web.HttpUtility.UrlDecode(PersonalBest); //info.EnteredDate = System.DateTime.Now; Athlete.AddNote(info); }