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

            user.v_usuario = this.usuario;
            frm_materia_eli FRM_MATERIA_ELI = new frm_materia_eli(this.usuario);

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