private void btnAddDave_Click(object sender, EventArgs e) { Dave d = new Dave(txtName.Text, txtDOB.Text, txtDESC.Text); if (txtName.Text != "" && txtDOB.Text != "" && txtDESC.Text != "") { family.AddDave(d); rtxt1.Text = "Successfully added " + d.GetNickname() + " to the family."; family.WriteToPersistantStorage(); } else { rtxt1.Text = "Please make sure to add accurate date to the fields."; } }
// // Method will add a 'Dave' to the DaveList: member for // recording numDaves will only increment when reading from file. public void AddDave(Dave d) { this.DavesList.Add(d); }