Exemplo n.º 1
0
 protected virtual void addButton_Click(object sender, EventArgs e)
 {
     if (fieldsOK())
     {
         if (businessControl.findPersonByDni(dnitextBox.Text) != null)
         {
             MessageBox.Show("Person with this DNI already exists", "Error");
         }
         else
         {
             Person p = new Person(dnitextBox.Text, nametextBox.Text, addresstextBox.Text, citytextBox.Text, postalcodetextBox.Text, driverLicensedateTimePicker.Value);
             businessControl.addPerson(p);
             newReservationForm.addPersonFormConfirmed(p.dni);
         }
     }
     else
     {
         MessageBox.Show("Missing Fields", "Error");
     }
 }