Example #1
0
        public Propuesta obtenerMejorPropuesta(TipoPropuesta tipo)
        {
            int contador, mejor = 0, ubic = 0;
            Propuesta prop;
            Calificacion cali;
            for (int i = 0; i < getPropuestas().Count; i++)
            {
                prop = (Propuesta)getPropuestas()[i];
                if (tipo.Equals(prop.getTipoPropuesta()))
                {
                    contador = 0;
                    for (int n = 0; n < prop.getCalificaciones().Count; n++)
                    {
                        cali = (Calificacion)prop.getCalificaciones()[n];
                        if (cali.getAprueba().Equals(true))
                        {
                            contador++;
                        }
                    }
                    if (mejor < contador)
                    {
                        mejor = contador;
                        ubic = Int32.Parse(prop.getID());
                    }
                }
            }
            prop = (Propuesta)getPropuestas()[ubic];

            return prop;
        }