public void EnterSwimmersTime(Registrant registrant, string time) { int match = 0; for (int i = 0; i < this.NoOfRegistrantInEvent; i++) { if (EventRegistrantList[i] == registrant) { EventRegistrantSwim[i].TimeSwam = time; match++; } } if (match == 0) { throw new Exception(registrant.Name + " has not entered " + this.Name); } }
public void EnterSwimmersTime(Registrant registrant, string time) { TimeSpan myTime = TimeSpan.Parse("00:" + time); int match = 0; foreach (KeyValuePair <Registrant, Swim> entry in ListOfRegistrantSwim) { if (entry.Key == registrant) { ListOfRegistrantSwim[registrant].TimeSwam = myTime; match++; Swimmer aSwimmer = registrant as Swimmer; if (aSwimmer != null) { aSwimmer.AddAsBestTime(SwimMeet.PType, Stroke, Distance, myTime); } } } if (match == 0) { throw new Exception(registrant.Name + " has not entered " + this.Name); } }
public void AddSwimmer(Registrant registrant) { registrant.Club = this; }