Пример #1
0
        private void sub_men_editorial_agr_Click(object sender, EventArgs e)
        {
            this.ocultar_Pantalla();
            StringBuilder errorMessages = new StringBuilder();
            Usuario       user          = new Usuario();

            user.v_usuario = this.usuario;
            frm_editorial_agr FRM_EDITORIAL_AGR = new frm_editorial_agr(this.usuario);

            try
            {
                if (user.VerificarPermiso(user, FRM_EDITORIAL_AGR.ToString()) != 0)
                {
                    FRM_EDITORIAL_AGR.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(),
                                "Agregar Editorial",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                FRM_EDITORIAL_AGR.Close();
            }
            this.mostrar_Pantalla();
        }
Пример #2
0
 private void sub_men_editorial_agr_Click(object sender, EventArgs e)
 {
     this.ocultar_Pantalla();
     StringBuilder errorMessages = new StringBuilder();
     Usuario user = new Usuario();
     user.v_usuario = this.usuario;
     frm_editorial_agr FRM_EDITORIAL_AGR = new frm_editorial_agr(this.usuario);
     try
     {
         if (user.VerificarPermiso(user, FRM_EDITORIAL_AGR.ToString()) != 0)
         {
             FRM_EDITORIAL_AGR.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(),
         "Agregar Editorial",
         MessageBoxButtons.OK,
         MessageBoxIcon.Warning);
         FRM_EDITORIAL_AGR.Close();
     }
     this.mostrar_Pantalla();
 }