Beispiel #1
0
        private void tex_nombre_editorial_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((int)e.KeyChar == (int)Keys.Enter)
            {
                try
                {
                    ingreso = 1;
                    edi.v_nombre_editorial = tex_nombre_editorial.Text;
                    edi.v_usuario_m        = this.usuario;

                    if ((edi.ConsultarEditorialIA(edi)).v_Dpais.Length != 0)
                    {
                        tex_nombre_editorial.Text = edi.v_nombre_editorial;
                        tex_direccion.Text        = edi.v_direccion_editorial;

                        tex_nombre_editorial.Enabled = false;
                        tex_direccion.Enabled        = true;

                        if (edi.v_estado == 'I')
                        {
                            che_activar_editorial.Enabled = true;
                            che_activar_editorial.Checked = false;
                        }

                        this.mostrarLista();
                        com_pais.Enabled = true;
                    }
                }
                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());


                    this.inicializarDatos();
                    MessageBox.Show(ex.Errors[0].Message.ToString(),
                                    "Modificar Editorial",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                    ingreso = 0;
                }
            }
        }