private void BtnDelete_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtCode.Text)) { frmMessageBoxFillNull frm = new frmMessageBoxFillNull(); frm.ShowDialog(); } else { frmMessageBoxDelete frm = new frmMessageBoxDelete(); if (frm.ShowDialog() == DialogResult.OK) { int id = Int32.Parse(txtCode.Text); // s.city = (AlmacenDisecWS.city)cboCity.SelectedItem; // s.city.country = (AlmacenDisecWS.country)cboCountry.SelectedItem; int result = serviceDA.deleteSupplier(id); reiniciar(); frmSearchSupplier fm = Owner as frmSearchSupplier; fm.dgvSearch.AutoGenerateColumns = false; fm.dgvSearch.DataSource = ""; this.Close(); } } }