Exemplo n.º 1
0
        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.";
            }
        }
Exemplo n.º 2
0
 //
 // 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);
 }