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

            user.v_usuario = this.usuario;
            frm_carrera_eli FRM_CARRERA_ELI = new frm_carrera_eli(this.usuario);

            try
            {
                if (user.VerificarPermiso(user, FRM_CARRERA_ELI.ToString()) != 0)
                {
                    FRM_CARRERA_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 Carrera",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                FRM_CARRERA_ELI.Close();
            }
            this.mostrar_Pantalla();
        }
예제 #2
0
 private void sub_men_carrera_eli_Click(object sender, EventArgs e)
 {
     this.ocultar_Pantalla();
     StringBuilder errorMessages = new StringBuilder();
     Usuario user = new Usuario();
     user.v_usuario = this.usuario;
     frm_carrera_eli FRM_CARRERA_ELI = new frm_carrera_eli(this.usuario);
     try
     {
         if (user.VerificarPermiso(user, FRM_CARRERA_ELI.ToString()) != 0)
         {
             FRM_CARRERA_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 Carrera",
         MessageBoxButtons.OK,
         MessageBoxIcon.Warning);
         FRM_CARRERA_ELI.Close();
     }
     this.mostrar_Pantalla();
 }