/* * Creates or updates customer, and closes dialog. */ private void btnSave_Click(object sender, RoutedEventArgs e) { if (areAllValuesValid()) { if (mFacade.IsACustomerLoaded()) // update current customer { mFacade.UpdateCurrentCustomer(txtCustName.Text, txtCustAddress.Text); } else // create a new customer { mFacade.CreateCustomer(txtCustName.Text, txtCustAddress.Text); } this.Close(); } }