public Object GetIndiceGlobalPorParametroEstudianteYOBS(ClassEstudiante student)
        {
            try
            {
                object indice = null;
                string q      = String.Format("select " +

                                              "SUM(A.CALIFICACION * C.UV) / SUM(C.UV) AS INDICE " +

                                              "FROM TBL_CALIFICACIONES A " +
                                              "INNER JOIN TBL_CLASES_PLAN_ESTUDIOS B " +
                                              "ON A.ID_CLASE_PLAN_ESTUDIOS = B.ID_CLASE_PLAN_ESTUDIOS " +
                                              "INNER JOIN TBL_CLASES C " +
                                              "ON B.ID_CLASE = C.ID_CLASE " +
                                              "INNER JOIN TBL_ESTUDIANTES D " +
                                              "ON A.ID_ESTUDIANTES = D.ID_ESTUDIANTE " +

                                              "where D.NUMERO_CUENTA = '{0}' ", student.NUMERO_CUENTA);

                this.comando = new SqlCommand(q, this.conexion);
                this.OpenConexion();
                this.reader = this.comando.ExecuteReader();

                while (reader.Read())
                {
                    indice = reader["INDICE"];
                }

                CloseConexion();


                return(indice);
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); this.CloseConexion(); return(null); }
        }
 public frmPronosticoAprobacion(ClassConexion conexion, ClassEstudiante estudiante)
 {
     try { InitializeComponent();
           this.conexion   = conexion;
           this.estudiante = estudiante; }
     catch (Exception ex) { MessageBox.Show(ex.ToString()); }
 }
Beispiel #3
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     try {
         if (this.txtNumeroCuenta.Text != string.Empty /*&& this.txtContraseña.Text != string.Empty*/)
         {
             this.estudiante = this.conexion.GetEstudiante(this.txtNumeroCuenta.Text);
             try
             {
                 if (estudiante.NUMERO_CUENTA.Equals(this.txtNumeroCuenta.Text) /*&& estudiante.Contraseña.Equals(this.txtContraseña.Text)*/)
                 {
                     MessageBox.Show("Bienvenid@ " + estudiante.P_NOMBRE, "!!Exito!!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     this.Hide();
                     frmPrincipal principal = new frmPrincipal(this.conexion, this.estudiante);
                     principal.ShowDialog();
                     this.Close();
                 }
             }
             catch
             {
                 MessageBox.Show(String.Format("Cuenta o clave incorrecta"), "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                 this.txtContraseña.Text   = string.Empty;
                 this.txtNumeroCuenta.Text = string.Empty;
                 this.txtNumeroCuenta.Focus();
                 estudiante = null;
             }
         }
         else if (this.txtNumeroCuenta.Text.Equals(string.Empty) || this.txtContraseña.Text.Equals(string.Empty))
         {
             MessageBox.Show("¡¡¡¡ATENCIÓN!!!!" + "\n" + "Los campos no pueden estar vacios.", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.ToString()); }
 }
Beispiel #4
0
        public frmPrincipal(ClassConexion conexion, ClassEstudiante estudiante)
        {
            try
            {
                InitializeComponent();
                this.conexion   = conexion;
                this.estudiante = estudiante;

                this.toolStripStatusLabelWelcome.Text = "Bienvenid@ " + estudiante.ToString();
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
 public frmAgregarClases(ClassEstudiante estudiante, ClassConexion conexion)
 {
     try
     {
         InitializeComponent();
         this.estudiante = estudiante;
         this.conexion   = conexion;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #6
0
        public frmMostrarClases(ClassConexion conexion, ClassEstudiante estudiante)
        {
            try
            {
                InitializeComponent();
                this.conexion   = conexion;
                this.estudiante = estudiante;
                this.Text       = "Lista de Clases: " + this.estudiante.ToString();

                this.dataGridViewClases.DataSource = conexion.GetAllClasesGridEstudiante(this.estudiante);
                this.lblIndiceGlobal.Text          = "Indice Global: " + this.estudiante.INDICE_GOBAL.ToString();
            }
            catch (Exception ex) { Console.WriteLine(ex.ToString()); this.lblIndiceGlobal.Text = "Indice Global: 0"; }
        }
        public List <ClassAsignatura> GetListaDeAsignaturasCarreraDisponibles(ClassEstudiante student)
        {
            try {
                String sql = String.Format("select A.ID_CLASE_PLAN_ESTUDIOS,B.ID_CLASE,B.NOMBRE_CLASE,B.UV " +
                                           "FROM TBL_CLASES_PLAN_ESTUDIOS A " +
                                           "INNER JOIN TBL_CLASES B " +
                                           "ON A.ID_CLASE = B.ID_CLASE " +
                                           "where A.ID_CLASE_PLAN_ESTUDIOS NOT IN( " +

                                           "select Z.ID_CLASE_PLAN_ESTUDIOS " +
                                           "From TBL_CALIFICACIONES Z " +
                                           "INNER JOIN TBL_ESTUDIANTES X " +
                                           "ON Z.ID_ESTUDIANTES = X.ID_ESTUDIANTE " +
                                           "where X.NUMERO_CUENTA = '{0}' AND Z.OBSERVACION = 'APR')"

                                           , student.NUMERO_CUENTA);

                List <ClassAsignatura> listAsignaturas = new List <ClassAsignatura>();
                this.comando = new SqlCommand(sql, this.conexion);


                this.OpenConexion();
                this.reader = this.comando.ExecuteReader();

                while (reader.Read())
                {
                    listAsignaturas.Add(new ClassAsignatura(

                                            reader["ID_CLASE_PLAN_ESTUDIOS"],
                                            reader["ID_CLASE"],
                                            reader["NOMBRE_CLASE"],
                                            reader["UV"]

                                            ));
                }
                CloseConexion();

                return(listAsignaturas);
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); this.CloseConexion(); return(null); }
        }
        public DataTable GetAllClasesGridEstudiante(ClassEstudiante estu, string OBS)
        {
            try
            {
                String sql = string.Format("select " +
                                           "(cast(E.CODIGO_DEPARTAMENTO as nchar(2))" +
                                           "+ '-' + CAST(C.ID_CLASE as nchar(10))) CODIGO," +
                                           "C.NOMBRE_CLASE, " +
                                           "C.UV, " +
                                           "A.CALIFICACION, " +
                                           "A.PERIODO, " +
                                           "A.FECHA, " +
                                           "A.OBSERVACION " +

                                           "from TBL_CALIFICACIONES A " +
                                           "INNER JOIN TBL_CLASES_PLAN_ESTUDIOS B " +
                                           "ON A.ID_CLASE_PLAN_ESTUDIOS = B.ID_CLASE_PLAN_ESTUDIOS " +
                                           "INNER JOIN TBL_CLASES C " +
                                           "ON B.ID_CLASE = C.ID_CLASE " +
                                           "INNER JOIN TBL_ESTUDIANTES D " +
                                           "ON A.ID_ESTUDIANTES = D.ID_ESTUDIANTE " +
                                           "INNER JOIN TBL_DEPARTAMENTO E " +
                                           "ON C.ID_DEPARTAMENTO = E.ID_DEPARTAMENTO " +
                                           "where D.NUMERO_CUENTA = '{0}' AND A.OBSERVACION = '{1}' " +
                                           "ORDER BY D.ID_ESTUDIANTE, A.PERIODO, A.FECHA ", estu.NUMERO_CUENTA, OBS);

                this.comando = new SqlCommand(sql, this.conexion);

                this.OpenConexion();
                this.comando.ExecuteReader();
                this.CloseConexion();

                this.adapter = new SqlDataAdapter(this.comando);
                System.Data.DataTable tabla = new System.Data.DataTable();
                adapter.Fill(tabla);

                return(tabla);
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); this.CloseConexion(); return(null); }
        }
        public ClassEstudiante GetEstudiante(String numeroCuenta)
        {
            try
            {
                ClassEstudiante Student = new ClassEstudiante();
                string          q       = String.Format("select * from TBL_ESTUDIANTES where  NUMERO_CUENTA='{0}'", numeroCuenta);
                this.comando = new SqlCommand(q, this.conexion);
                this.OpenConexion();
                this.reader = this.comando.ExecuteReader();

                while (reader.Read())
                {
                    Student = new ClassEstudiante(
                        reader["ID_ESTUDIANTE"],
                        reader["INDICE_GLOBAL"],
                        reader["NUMERO_CUENTA"],
                        reader["P_NOMBRE"],
                        reader["S_NOMBRE"],
                        reader["P_APELLIDO"],
                        reader["S_APELLIDO"],
                        reader["FECHA_INGRESO"],
                        reader["ID_DEPARTAMENTO"],
                        reader["ESTADO"]

                        );
                }
                CloseConexion();
                if (Student.Equals(null))
                {
                    Student.NUMERO_CUENTA = "NULL";
                }


                return(Student);
            }
            catch (Exception e) { MessageBox.Show(e.ToString()); this.CloseConexion(); return(null); }
        }