static void Main(string[] args) { Console.WriteLine("Will you be a enter group by hand(H) or random(R) ?"); KindOfInitilization initilization = UI.GetKindOfInitilization(); switch (initilization) { case KindOfInitilization.ByHand: { UI.EnterInformationAboutGroup(); break; } case KindOfInitilization.Random: { Group form = Initilization.GetRandomInitilizationGroup(); UI.PrintGroup(form); do { Action act = UI.GetAction(); switch (act) { case Action.Add: { form.AddStudent(Initilization.GetRandomStudent()); UI.PrintGroup(form); break; } case Action.Delete: { form.DeleteStudent(form.Students[Initilization.GetRandomIdOfStudent(form)].INN); UI.PrintGroup(form); break; } case Action.Update: { form.UpdateStudent(Initilization.GetRandomIdOfStudent(form)); UI.PrintGroup(form); break; } } } while (true); break; } } }
public void UpdateStudent(int id) { Students[id].Name = Initilization.GetRandomNameOfStudent(Students[id].Gender); Students[id].INN = Initilization.GetRandomInnOfStudent(); }