Ejemplo n.º 1
0
        public override string Eval(string objectName, string collectionName, int index)
        {
            if (collectionName == nameof(Positions))
            {
                var position = Positions [index];
                if (objectName == "PositionTitle")
                {
                    return(position.FormatTitle());
                }
                if (objectName == "DivisionTitle")
                {
                    return(position.Division.Title);
                }
                if (objectName == NameOf(() => position.IsPrime))
                {
                    return(Positions [index].IsPrime ? GetString("Yes") : string.Empty);
                }
            }

            if (collectionName == nameof(Disciplines))
            {
                var discipline = Disciplines [index];
                var profile    = discipline.EduProgramProfile;
                if (objectName == NameOf(() => profile.EduProgram))
                {
                    return(UniversityFormatHelper.FormatEduProgramTitle(profile.EduProgram.Code, profile.EduProgram.Title));
                }
                if (objectName == NameOf(() => Disciplines [index].EduProgramProfile))
                {
                    return(UniversityFormatHelper.FormatEduProgramProfilePartialTitle(profile.ProfileCode, profile.ProfileTitle));
                }
                if (objectName == NameOf(() => profile.EduLevel))
                {
                    return(profile.EduLevel.Title);
                }
                if (objectName == NameOf(() => discipline.Disciplines))
                {
                    return(discipline.Disciplines);
                }
            }

            if (collectionName == nameof(Education))
            {
                var education = Education [index];
                return(EvalAchievement(education, objectName));
            }

            if (collectionName == nameof(Training))
            {
                var training = Training [index];
                return(EvalAchievement(training, objectName));
            }

            if (collectionName == nameof(Achievements))
            {
                var achievement = Achievements [index];
                return(EvalAchievement(achievement, objectName));
            }

            return(null);
        }