private void but_modificar_editorial_Click(object sender, EventArgs e) { if (tex_nombre_editorial.Text.Length == 0) { MessageBox.Show("Debe ingresar un Nombre", "Modificar Editorial", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (ingreso != 1) { MessageBox.Show("Debe ingresar el nombre y presionar enter", "Modificar Editorial", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { /////// { StringBuilder errorMessages = new StringBuilder(); edi.v_nombre_editorial = tex_nombre_editorial.Text; edi.v_Dpais = com_pais.SelectedItem.ToString(); edi.v_direccion_editorial = tex_direccion.Text; edi.v_usuario_m = this.usuario; if (che_activar_editorial.Checked == true) { edi.v_estado = 'A'; } try { if (edi.ModificarEditorial(edi) != 0) { MessageBox.Show("Editorial modifacada correctamente" + "\n" + "Nombre: " + edi.v_nombre_editorial, "Modificar Editorial", MessageBoxButtons.OK, MessageBoxIcon.Information); this.inicializarDatos(); tex_direccion.Enabled = false; tex_nombre_editorial.Enabled = true; che_activar_editorial.Enabled = false; che_activar_editorial.Checked = false; ingreso = 0; SLpais.Clear(); com_pais.DataSource = null; com_pais.Show(); edi.v_pais.Clear(); } } catch (SqlException ex) { for (int i = 0; i < ex.Errors.Count; i++) { errorMessages.Append("Index #" + i + "\n" + "Message: " + ex.Errors[i].Message + "\n" + "LineNumber: " + ex.Errors[i].LineNumber + "\n" + "Source: " + ex.Errors[i].Source + "\n" + "Procedure: " + ex.Errors[i].Procedure + "\n"); } Console.WriteLine(errorMessages.ToString()); MessageBox.Show(ex.Errors[0].Message.ToString(), "Modificar Editorial", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }