//save information into the customer object and save customer in list private void btnAdd_Click(object sender, RoutedEventArgs e) { Customer aCustomer = CustomerFactory.createCustomerFactory(); try { aCustomer.Name = txtBoxName.Text; aCustomer.Address = txtBoxAddress.Text; } catch { MessageBox.Show("make sure values are correct"); return; } //add customer to the objects customer list objectlist.addCustomer(aCustomer); //Clear textboxes txtBoxName.Clear(); txtBoxAddress.Clear(); //go to next window and close this one NewBooking bf = new NewBooking(aCustomer); bf.Show(); this.Close(); }
//add a new booking to the selcted customer, go to next window private void btnNewBooking_Click(object sender, RoutedEventArgs e) { NewBooking nb = new NewBooking(aCustomer); nb.Show(); this.Close(); }