private void simpleButtonSave_Click(object sender, EventArgs e) { if (dxValidationProviderClient.Validate()) { // Get the data from the binding source bindingSourceClient.EndEdit(); // Pull the object from the data source _clientObj = bindingSourceClient.DataSource as ClientInformation; if (EditMode) { _clientObj?.Update(); } else { // Save the data to the database _clientObj?.Insert(); } // close the screen DialogResult = DialogResult.OK; } }