private void btnEliminar_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Desea eliminar este registro?", "Profit Contenedor", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { using (Profit_RGEntities context = new Profit_RGEntities()) { context.pEliminarNaviera(Validador); Navegar(2); } } } catch (DataException ex0) { MessageBox.Show(ex0.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex1) { MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }