Example #1
0
        //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();
        }