private void btnDelete_Click(object sender, EventArgs e) { ContactClass c = new ContactClass(); c.ContactID = Int32.Parse(txtboxContactID.Text); c.deleteCustomer(); clearAddCustomerForm(); dgvAllCustomers.DataSource = loadAllCustomers(); }
private void btnDelete_Click(object sender, EventArgs e) { if (txtboxFirstName.Text == "" || txtboxLastName.Text == "" || textBoxNIC.Text == "" || txtboxAddress.Text == "" || txtboxContactNumber.Text == "" || adults.Text == "" || children.Text == "") { MessageBox.Show("Please enter field you want to delete"); } else { ContactClass c = new ContactClass(); c.ContactID = Int32.Parse(txtboxContactID.Text); c.deleteCustomer(); clearAddCustomerForm(); dgvAllCustomers.DataSource = loadAllCustomers(); } }