Ejemplo n.º 1
0
        public List <PeriodoEducativo> getPeriodosEducativos()
        {
            List <PeriodoEducativo> periodosEducativos = new List <PeriodoEducativo>();
            ConexionSql             conexion           = new ConexionSql();
            SqlCommand comandoSql = new SqlCommand("PAS_P_IL_PIL", conexion.getconexionSql());

            comandoSql.CommandType = System.Data.CommandType.StoredProcedure;
            comandoSql.Parameters.Add(new SqlParameter("@IND_IL_PIL", "2"));
            try
            {
                SqlDataReader lector = comandoSql.ExecuteReader();
                while (lector.Read())
                {
                    periodosEducativos.Add(new PeriodoEducativo(lector["FECHA"].ToString(), lector["VALOR"].ToString()));
                }
            }
            catch (SqlException excepcionSql)
            {
                throw excepcionSql;
            }
            finally
            {
                conexion.cerrarConexion();
            }
            return(periodosEducativos);
        }
Ejemplo n.º 2
0
        public List <PeriodoEducativo> getDiasInscripcion(String periodoEducativo)
        {
            List <PeriodoEducativo> diasInscripcion = new List <PeriodoEducativo>();
            ConexionSql             conexionSql     = new ConexionSql();
            SqlCommand comandoSql = new SqlCommand("PAS_FECHAS_GRAF", conexionSql.getconexionSql());

            comandoSql.CommandType = System.Data.CommandType.StoredProcedure;
            comandoSql.Parameters.Add(new SqlParameter("@PERIODO", periodoEducativo.Split('|')[0]));
            comandoSql.Parameters.Add(new SqlParameter("@IND_MP", (periodoEducativo.Contains("MP") ? "MP" : "")));
            comandoSql.Parameters.Add(new SqlParameter("@IND_IL_PIL", "2"));
            try
            {
                SqlDataReader lector = comandoSql.ExecuteReader();
                while (lector.Read())
                {
                    diasInscripcion.Add(new PeriodoEducativo(lector["FECHA"].ToString(), lector["VALOR"].ToString()));
                }
            }
            catch (SqlException excepcionSql)
            {
                throw excepcionSql;
            }
            finally
            {
                conexionSql.cerrarConexion();
            }
            return(diasInscripcion);
        }
        public List <InscripcionGeneral> getDiasInscripcion(String periodoInscripcion)
        {
            List <InscripcionGeneral> diasInscripcion = new List <InscripcionGeneral>();
            List <SqlParameter>       parametrosSql   = new List <SqlParameter>();

            parametrosSql.Add(new SqlParameter("@PERIODO", periodoInscripcion.Split('|')[0]));
            parametrosSql.Add(new SqlParameter("@IND_MP", (periodoInscripcion.Contains("MP")?"MP":"")));
            parametrosSql.Add(new SqlParameter("@IND_IL_PIL", "2"));
            ConexionSql conexion   = new ConexionSql();
            SqlCommand  comandoSql = new SqlCommand("PAS_HISTORICO", conexion.getconexionSql());

            comandoSql.CommandType = System.Data.CommandType.StoredProcedure;
            foreach (SqlParameter parametro in parametrosSql)
            {
                comandoSql.Parameters.Add(parametro);
            }
            try
            {
                SqlDataReader lector = comandoSql.ExecuteReader();
                while (lector.Read())
                {
                    diasInscripcion.Add(new InscripcionGeneral(lector["NOMBRE"].ToString(), int.Parse(lector["TOTALSORT"].ToString()), int.Parse(lector["TOTALINSC"].ToString())));
                }
            }
            catch (SqlException excepcionSql)
            {
                throw excepcionSql;
            }
            finally {
                conexion.cerrarConexion();
            }
            return(diasInscripcion);
        }
Ejemplo n.º 4
0
        private List <AreaAcademica> obtenerEntidades(List <SqlParameter> parametrosSql)
        {
            List <AreaAcademica> areasAcademicas = new List <AreaAcademica>();
            ConexionSql          conexion        = new ConexionSql();
            SqlCommand           comandoSql      = new SqlCommand("PAS_XREGION_AREA", conexion.getconexionSql());

            comandoSql.CommandType = System.Data.CommandType.StoredProcedure;
            foreach (SqlParameter parametro in parametrosSql)
            {
                comandoSql.Parameters.Add(parametro);
            }
            try
            {
                SqlDataReader lector = comandoSql.ExecuteReader();
                while (lector.Read())
                {
                    String x = lector["NOMBRE"].ToString() + " " + lector["TOTALSORT"].ToString() + " " + lector["TOTALINSC"].ToString();
                    areasAcademicas.Add(new AreaAcademica(lector["NOMBRE"].ToString(), int.Parse(lector["TOTALSORT"].ToString()), int.Parse(lector["TOTALINSC"].ToString())));
                }
            }
            catch (SqlException excepcionSql)
            {
                throw excepcionSql;
            }
            finally
            {
                conexion.cerrarConexion();
            }
            return(areasAcademicas);
        }
        private List <ProgramaEducativo> obtenerEntidades(List <SqlParameter> parametrosSql)
        {
            List <ProgramaEducativo> programasEducativos = new List <ProgramaEducativo>();
            ConexionSql conexion   = new ConexionSql();
            SqlCommand  comandoSql = new SqlCommand("PAS_XPROGRAMA", conexion.getconexionSql());

            comandoSql.CommandType = System.Data.CommandType.StoredProcedure;
            foreach (SqlParameter parametro in parametrosSql)
            {
                comandoSql.Parameters.Add(parametro);
            }
            try
            {
                SqlDataReader lector = comandoSql.ExecuteReader();
                while (lector.Read())
                {
                    string x = lector["NOMBRE"].ToString() + " " + lector["TOTALSORT"].ToString() + " " + lector["TOTALINSC"].ToString();
                    programasEducativos.Add(new ProgramaEducativo(lector["NOMBRE"].ToString(), int.Parse(lector["TOTALSORT"].ToString()), int.Parse(lector["TOTALINSC"].ToString())));
                }
            }
            catch (SqlException excepcionSql)
            {
                throw excepcionSql;
            }
            finally
            {
                conexion.cerrarConexion();
            }
            return(programasEducativos);
        }