public AddRemoveGUI(PrimaryEnrollee primary) { InitializeComponent(); PrimEnr = primary; foreach (DependentEnrollee DepEnr in primary.dependents) { comboBox1.Items.Add(DepEnr.getFullname()); } }
//adding dependent to an Enrollee public string addDependent(String fullname, String relationship, PrimaryEnrollee P) { //creating dependent enrollee DependentEnrollee d = new DependentEnrollee(fullname, relationship); //linking dependent enrollee to their primary P.dependents.Add(d); return("Successfully added"); }
//removing dependent from Enrollee public string removeDependent(int index, PrimaryEnrollee P) { //removing dependent from Primary Enrollee P.dependents.RemoveAt(index); return("Successfully Removed"); }