public Child(Child c) { ID = c.ID; MotherID = c.MotherID; FirstName = c.FirstName; LastName = c.LastName; haveSpecNeeds = c.haveSpecNeeds; BirthDate = c.BirthDate; foreach (string str in c.SpecialNeeds) { SpecialNeeds.Add(str); } }
/// <summary> /// initializes a child with the given parameters /// </summary> /// <param name="id">ID</param> /// <param name="momid">ID of the mother</param> /// <param name="fname">first name</param> /// <param name="lname">last name</param> /// <param name="spec">special needs</param> /// <param name="birth">birth date</param> public Child(string id, string momid, string fname, string lname, /*bool havespec,*/ List <string> spec, DateTime birth) { ID = id; MotherID = momid; FirstName = fname; LastName = lname; HaveSpecialNeeds = !(spec == null || spec.Count == 0); //specNeeds = spec; if (HaveSpecialNeeds) { for (int i = 0; spec != null && i < spec.Count; i++) { SpecialNeeds.Add(spec[i]); } } BirthDate = birth; }