private void companyDeleteButton_Click(object sender, EventArgs e) { if (companyIdHidden.Text.Trim() != String.Empty && Ch.IsMatch(companyTextBox.Text.Trim())) { if (MessageBox.Show("Are sure to delete this?", "Confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { SetupGateway setupGateway = new SetupGateway(); string Id = companyIdHidden.Text.Trim(); int rowAffect = setupGateway.DeleteCompany(Id); if (rowAffect > 0) { cMessageBox.Success("Company Deleted"); CompanySetup_Load(sender, e); } else { cMessageBox.Failed("Failed to Delete"); } } } }