示例#1
0
        private void sub_men_editorial_eli_Click(object sender, EventArgs e)
        {
            this.ocultar_Pantalla();
            StringBuilder errorMessages = new StringBuilder();
            Usuario       user          = new Usuario();

            user.v_usuario = this.usuario;
            frm_editorial_eli FRM_EDITORIAL_ELI = new frm_editorial_eli(this.usuario);

            try
            {
                if (user.VerificarPermiso(user, FRM_EDITORIAL_ELI.ToString()) != 0)
                {
                    FRM_EDITORIAL_ELI.ShowDialog();
                }
            }
            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(),
                                "Eliminar Editorial",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                FRM_EDITORIAL_ELI.Close();
            }
            this.mostrar_Pantalla();
        }
 private void sub_men_editorial_eli_Click(object sender, EventArgs e)
 {
     this.ocultar_Pantalla();
     StringBuilder errorMessages = new StringBuilder();
     Usuario user = new Usuario();
     user.v_usuario = this.usuario;
     frm_editorial_eli FRM_EDITORIAL_ELI = new frm_editorial_eli(this.usuario);
     try
     {
         if (user.VerificarPermiso(user, FRM_EDITORIAL_ELI.ToString()) != 0)
         {
             FRM_EDITORIAL_ELI.ShowDialog();
         }
     }
     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(),
         "Eliminar Editorial",
         MessageBoxButtons.OK,
         MessageBoxIcon.Warning);
         FRM_EDITORIAL_ELI.Close();
     }
     this.mostrar_Pantalla();
 }