Beispiel #1
0
        public bool actualizarPrograma(ProgramaEstudio programa)
        {
            try
            {
                string        id   = programa.id_programa.ToString();
                List <Object> prog = UTILS.PUT("private/programa/" + id, "programa", AuthUser.token, programa.GetType(), programa);

                return(prog != null && prog.Count != 0);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #2
0
 public List <object> GetProgramasEstudios()
 {
     try
     {
         ProgramaEstudio progEst      = new ProgramaEstudio();
         List <object>   lstProgramas = UTILS.GET("private/programa", "programa", AuthUser.token, progEst.GetType());
         if (lstProgramas == null || lstProgramas.Count == 0)
         {
             return(null);
         }
         return(lstProgramas);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #3
0
        public List <object> getCursos()
        {
            try
            {
                Cursos        crs       = new Cursos();
                List <object> lstCursos = UTILS.GET("private/curso", "curso", AuthUser.token, crs.GetType());
                if (lstCursos == null || lstCursos.Count == 0)
                {
                    return(null);
                }
                ProgramaEstudio prg         = new ProgramaEstudio();
                List <object>   lstPrograma = prg.GetProgramasEstudios();
                if (lstPrograma == null)
                {
                    lstPrograma = new List <object>();
                }

                for (int i = 0; i < lstCursos.Count; i++)
                {
                    for (int j = 0; j < lstPrograma.Count; j++)
                    {
                        Cursos          c = (Cursos)lstCursos[i];
                        ProgramaEstudio p = (ProgramaEstudio)lstPrograma[j];
                        if (c.id_programa.Equals(p.id_programa))
                        {
                            c.programaEstudio = p;
                            lstCursos[i]      = c;
                            break;
                        }
                    }
                }
                return(lstCursos);
            } catch (Exception)
            {
                return(null);
            }
        }
Beispiel #4
0
        public List <object> GetProgramasEstudiosCEL()
        {
            ProgramaEstudio progEst      = new  ProgramaEstudio();
            List <object>   lstProgramas = UTILS.GET("private/programa", "programa", AuthUser.token, progEst.GetType());

            if (lstProgramas == null || lstProgramas.Count == 0)
            {
                return(null);
            }
            CEL           cl     = new CEL();
            List <object> lstCel = cl.getCELS();

            if (lstCel == null)
            {
                lstCel = new List <object>();
            }

            for (int i = 0; i < lstProgramas.Count; i++)
            {
                for (int j = 0; j < lstCel.Count; j++)
                {
                    CEL             c  = (CEL)lstCel[j];
                    ProgramaEstudio pg = (ProgramaEstudio)lstProgramas[i];
                    if (pg.id_cel.Equals(c.id_cel))
                    {
                        pg.cel          = c;
                        lstProgramas[i] = pg;
                        break;
                    }
                }
            }

            List <Object> arr = filtrarProgramas(lstProgramas);

            return(arr);
        }
Beispiel #5
0
        public List <Object> GetPostulaciones()
        {
            try
            {
                Postulaciones post = new Postulaciones();

                List <object> lstPostulaciones = UTILS.GET("private/postulacion", "postulacion", AuthUser.token, post.GetType());
                if (lstPostulaciones == null || lstPostulaciones.Count == 0)
                {
                    return(null);
                }
                /**/
                Familia       fam         = new Familia();
                List <object> lstFamilias = fam.GetFamilias();
                if (fam == null)
                {
                    lstFamilias = new List <object>();
                }
                /**/
                Alumno        al     = new Alumno();
                List <object> lstAlu = al.GetAlumnos();
                if (lstAlu == null)
                {
                    return(null);
                }

                /* uniendo familia y  alumno con postulacion*/
                for (int i = 0; i < lstPostulaciones.Count; i++)
                {
                    for (int j = 0; j < lstAlu.Count; j++)
                    {
                        Alumno        a  = (Alumno)lstAlu[j];
                        Postulaciones po = (Postulaciones)lstPostulaciones[i];
                        if (po.id_alumno.Equals(a.id_alumno))
                        {
                            po.alumno           = a;
                            lstPostulaciones[i] = po;
                            break;
                        }
                    }

                    for (int k = 0; k < lstFamilias.Count; i++)
                    {
                        Familia       fa = (Familia)lstFamilias[k];
                        Postulaciones po = (Postulaciones)lstPostulaciones[i];
                        if (po.id_familia.Equals(fa.id_familia))
                        {
                            po.familia          = fa;
                            lstPostulaciones[i] = po;
                            break;
                        }
                    }
                }
                /* llamando a seguro y asegurar que no sea nul o 0*/
                Seguro        se         = new Seguro();
                List <Object> lstSeguros = UTILS.GET("private/seguro", "seguro", AuthUser.token, se.GetType());
                if (lstSeguros != null & lstSeguros.Count > 0)
                {
                    se = (Seguro)lstSeguros[0];
                }

                ProgramaEstudio prog         = new ProgramaEstudio();
                List <Object>   lstProgramas = prog.GetProgramasEstudios();
                if (lstProgramas == null || lstProgramas.Count == 0)
                {
                    return(null);
                }
                List <Object> arr         = prog.filtrarProgramas(lstProgramas);
                List <Object> vigentes    = (List <Object>)arr[0];
                List <Object> finalizados = (List <Object>)arr[1];

                bool            vigente;
                Postulaciones   p;
                ProgramaEstudio pe;
                for (int i = 0; i < lstPostulaciones.Count; i++)
                {
                    vigente  = false;
                    p        = (Postulaciones)lstPostulaciones[i];
                    p.seguro = se;
                    for (int j = 0; j < vigentes.Count; j++)
                    {
                        pe = (ProgramaEstudio)vigentes[j];
                        if (p.id_programa.Equals(pe.id_programa))
                        {
                            p.programaEstudio   = pe;
                            lstPostulaciones[i] = p;
                            vigente             = true;
                            break;
                        }
                    }

                    if (!vigente)
                    {
                        for (int j = 0; j < finalizados.Count; j++)
                        {
                            pe = (ProgramaEstudio)finalizados[j];
                            if (p.id_programa.Equals(pe.id_programa))
                            {
                                p.programaEstudio   = pe;
                                lstPostulaciones[i] = p;
                                break;
                            }
                        }
                    }
                }

                List <Object> filtradas = filtrarPostulaciones(lstPostulaciones, arr);

                return(filtradas);
            } catch (Exception)
            {
                return(null);
            }
        }