public void addRegistrant(Registrant reg) { if (!Registrants.Contains(reg)) { Registrants.Add(reg); } }
public void AddSwimmer(Registrant aSwimmer) { if (Registrants.Contains(aSwimmer)) { throw new Exception(string.Format("Swimmer {0},{1} is already entered", aSwimmer.Name, aSwimmer.Number)); } Registrants.Add(aSwimmer); }
public void removeRegistrant(Registrant reg) { if (reg != null && Registrants.Contains(reg)) { Registrants.Remove(reg); } if (Registrants.Count < 2) { Registrants.Clear(); DataManager.GroupManager.removeGroup(this, Division); } }
public void EnterSwimmersTime(Registrant registrant, string swimTime) { Swimmer swimmer = registrant as Swimmer; if (Registrants.Contains(registrant)) { int locator = Registrants.IndexOf(registrant); Swim correspondingSwim = Swims[locator] as Swim; correspondingSwim.SwimTime = swimTime; swimmer.AddAsBestTime(swimMeet.PoolType, Distance, Stroke, TimeSpan.Parse("00:" + swimTime)); return; } throw new Exception("Swimmer has not entered event"); }
public void AddSwimmer(Registrant swimmer) { //if (Registrants[numOfRegistrants].RegistrationNumer == swimmer.RegistrationNumer) //{ // throw new Exception("Swimmer " + Registrants[numOfRegistrants].Name + " " + Registrants[numOfRegistrants].RegistrationNumer + "is already entered"); //} //else //{ // registrants[numOfRegistrants++] = swimmer; //} if (Registrants.Contains(swimmer)) { throw new Exception("Swimmer " + swimmer.Name + ", " + swimmer.RegistrationNumber + ", is already entered"); } else { registrants[numOfRegistrants++] = swimmer; } }
public void EnterSwimmersTime(Swimmer swimmer, string time) { for (int i = 0; i < numOfRegistrants; i++) { if (Registrants[i].RegistrationNumber == swimmer.RegistrationNumber) { EventInfo[i].TimeSwam = time; swimmer.AddAsBestTime(swimMeet.type, stroke, distance, TimeSpan.ParseExact(time, @"mm\:ss\.ff", System.Globalization.CultureInfo.InvariantCulture)); } else if (!Registrants.Contains(swimmer)) { throw new Exception("Swimmer has not entered event"); } } }