// Save Button click private void customerSaveButton_Click(object sender, EventArgs e) { // Check if inputs are valid if (validateInputs()) { // If valid, obtain data from form controls ID = DataInterface.getNextID("customerId", "customer", DataInterface.getCustomerIDList()); name = customerNameTextBox.Text; address = customerAddressTextBox.Text; address2 = customerAddress2TextBox.Text; city = customerCityTextBox.Text; zipCode = customerZipCodeTextBox.Text; country = customerCountryTextBox.Text; phone = customerPhoneTextBox.Text; active = customerActiveCheckBox.Checked; // Send data to DataInterface to create new customer DataInterface.createCustomer(name, address, city, country, zipCode, phone, active, currentUser, address2); // Set CustomerMainForm's reference to this form, show CustomerMainForm, close this form CustomerMainForm.addCustomer = this; customerForm.Show(); CustomerMainForm.addCustomer.Close(); } }