private void BtnEliminar_Click(object sender, EventArgs e) { if (dgvContactos.SelectedCells.Count > 0) { ContactoNegocio neg = new ContactoNegocio(); Contacto C = (Contacto)dgvContactos.CurrentRow.DataBoundItem; try { using (var popup = new Confirmacion(@"eliminar """ + C.ToString() + @"""")) { var R = popup.ShowDialog(); if (R == DialogResult.OK) { bool conf = popup.R; if (C != null && conf == true) { neg.EliminarLogico(C.IdContacto); LlenarTabla(); } } } } catch (Exception ex) { Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog(); } } else { Mensaje m = new Mensaje("Ningun item seleccionado."); m.ShowDialog(); } }
private void DetallesContacto_Load(object sender, EventArgs e) { try { this.Text = c.ToString(); LlenarTablaT(); LlenarTablaD(); } catch (Exception ex) { Mensaje m = new Mensaje(ex.ToString()); m.ShowDialog(); } }