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

            user.v_usuario = this.usuario;
            frm_materia_mod FRM_MATERIA_MOD = new frm_materia_mod(this.usuario);

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