Esempio n. 1
0
        public List <DetalleInscripcion> ListaDetalles()//para admin
        {
            List <DetalleInscripcion> lista = new List <DetalleInscripcion>();

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     ssql    = "select * from DetallesInscripcion";
                SqlCommand comando = new SqlCommand(ssql, con);
                comando.CommandType = CommandType.Text;
                IDataReader lector = comando.ExecuteReader();
                while (lector.Read())
                {
                    lista.Add(new DetalleInscripcion(lector.GetInt64(0),
                                                     MatriculaDAL.ObtenerPorId(lector.GetInt64(1)),
                                                     ModuloDAL.ObtenerPorId(lector.GetInt64(2)),
                                                     lector.GetDecimal(3),
                                                     lector.GetDecimal(4),
                                                     lector.GetDecimal(5),
                                                     lector.GetDecimal(6),
                                                     lector.GetDecimal(7),
                                                     lector.GetDecimal(8),
                                                     lector.GetInt64(9)));
                }
                con.Close();
            }
            return(lista);
        }
Esempio n. 2
0
        public List <DetalleInscripcion> notasAlumnosPorId(Int64 pId)
        {
            List <DetalleInscripcion> lista = new List <DetalleInscripcion>();

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     ssql      = "select a.*, b.* from DetallesInscripcion as a inner join Matriculas as b on a.MatriculaId = b.Id where a.Status=0 and b.EstudianteId={0}";
                string     sentencia = string.Format(ssql, pId);
                SqlCommand comando   = new SqlCommand(sentencia, con);
                comando.CommandType = CommandType.Text;
                IDataReader lector = comando.ExecuteReader();
                while (lector.Read())
                {
                    lista.Add(new DetalleInscripcion(lector.GetInt64(0),
                                                     MatriculaDAL.ObtenerPorId(lector.GetInt64(1)),
                                                     ModuloDAL.ObtenerPorId(lector.GetInt64(2)),
                                                     lector.GetDecimal(3),
                                                     lector.GetDecimal(4),
                                                     lector.GetDecimal(5),
                                                     lector.GetDecimal(6),
                                                     lector.GetDecimal(7),
                                                     lector.GetDecimal(8),
                                                     lector.GetInt64(9)));
                }
                con.Close();
            }
            return(lista);
        }
Esempio n. 3
0
        public List <DetalleInscripcion> buscarPorCodigo(string pTexto)
        {
            List <DetalleInscripcion> lista = new List <DetalleInscripcion>();

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     script  = @"select a.*,b.*,c.* from DetallesInscripcion as a inner join Matriculas as b on a.MatriculaId=b.Id inner join 
                                Estudiantes as c on b.EstudianteId=c.Id where c.Codigo like '%{0}%'";
                string     ssql    = string.Format(script, pTexto);
                SqlCommand comando = new SqlCommand(ssql, con);
                comando.CommandType = CommandType.Text;
                IDataReader lector = comando.ExecuteReader();
                while (lector.Read())
                {
                    lista.Add(new DetalleInscripcion(lector.GetInt64(0),
                                                     MatriculaDAL.ObtenerPorId(lector.GetInt64(1)),
                                                     ModuloDAL.ObtenerPorId(lector.GetInt64(2)),
                                                     lector.GetDecimal(3),
                                                     lector.GetDecimal(4),
                                                     lector.GetDecimal(5),
                                                     lector.GetDecimal(6),
                                                     lector.GetDecimal(7),
                                                     lector.GetDecimal(8),
                                                     lector.GetInt64(9)));
                }
            }
            return(lista);
        }
Esempio n. 4
0
        public static DetalleInscripcion obtenerPorId(Int64 pId)
        {
            DetalleInscripcion detalle = new DetalleInscripcion();

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     ssql      = "select * from DetallesInscripcion where Id={0}";
                string     sentencia = string.Format(ssql, pId);
                SqlCommand comando   = new SqlCommand(sentencia, con);
                comando.CommandType = CommandType.Text;
                IDataReader lector = comando.ExecuteReader();
                if (lector.Read())
                {
                    detalle.Id          = lector.GetInt64(0);
                    detalle.MatriculaId = MatriculaDAL.ObtenerPorId(lector.GetInt64(1));
                    detalle.ModuloId    = ModuloDAL.ObtenerPorId(lector.GetInt64(2));
                    detalle.Nota1       = lector.GetDecimal(3);
                    detalle.Nota2       = lector.GetDecimal(4);
                    detalle.Nota3       = lector.GetDecimal(5);
                    detalle.Nota4       = lector.GetDecimal(6);
                    detalle.Nota5       = lector.GetDecimal(7);
                    detalle.NotaFinal   = lector.GetDecimal(8);
                    detalle.Status      = lector.GetInt64(9);
                }
                con.Close();
            }
            return(detalle);
        }