Created
November 8, 2012 18:06
-
-
Save conrjac/4040495 to your computer and use it in GitHub Desktop.
Update Data Grid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void btnCustAdd_Click(object sender, EventArgs e) | |
{ | |
if ((txtCustFirst.Text.Length == 0) || (txtCustFirst.Text == "First") || (txtCustLast.Text.Length == 0) || (txtCustLast.Text == "Last") || (txtCustHouse.Text.Length == 0) || (txtCustHouse.Text == "House") || (txtCustStreet.Text.Length == 0) || (txtCustStreet.Text == "Street") || (txtCustTown.Text.Length == 0) || (txtCustTown.Text == "Town") || (txtCustCounty.Text.Length == 0) || (txtCustCounty.Text == "County") || (txtCustPostcode.Text.Length == 0) || (txtCustPostcode.Text == "Postcode") || (txtCustHPhone.Text.Length == 0) || (txtCustHPhone.Text == "Home") || (txtCustMPhone.Text.Length == 0) || (txtCustMPhone.Text == "Mobile")) | |
{ | |
MessageBox.Show("Please ensure all fields are not null", "Error"); | |
} | |
else | |
{ | |
try | |
{ | |
Program.AuspexDo.addCustomer(txtCustFirst.Text, txtCustLast.Text, txtCustHouse.Text, txtCustStreet.Text, txtCustTown.Text, txtCustCounty.Text, txtCustPostcode.Text, txtCustHPhone.Text, txtCustMPhone.Text); | |
bindCustomerList(); | |
bindSupplierList(); | |
bindMechanicList(); | |
bindCarList(); | |
bindPartsList(); | |
bindJobRefList(); | |
updateDataGrid(); // this method then calls from the list of type customers in the Auspex Class instance AuspexDo. | |
} | |
catch | |
{ | |
MessageBox.Show("Please ensure fields are entered correctly", "Error"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment