Example #1
0
        // GET: /EntrantUser/Hobbie/
        public async Task <ActionResult> Index()
        {
            var entrantId = await _infoExtractor.ExtractEntrantId(User.Identity.GetUserId());

            var assignedHobbies = await _queryBuilder
                                  .For <Task <IEnumerable <AssignedHobbie> > >()
                                  .With(new GetAssignedHobbiesCriterion {
                EntrantId = entrantId
            });

            return(View(assignedHobbies));
        }
Example #2
0
        // GET: /EntrantUser/UnitedStateExams/
        public async Task <ActionResult> Index()
        {
            var entrantId = await _infoExtractor.ExtractEntrantId(User.Identity.GetUserId());

            var usExam = await _queryBuilder
                         .For <Task <IEnumerable <UnitedStateExam> > >()
                         .With(new GetUnitedStateExamsOfEntrantCriterion {
                EntrantId = entrantId
            });

            return(View(usExam));
        }
Example #3
0
        // GET: /EntrantUser/SchoolMark/
        public async Task <ActionResult> Index()
        {
            var entrantId = await _infoExtractor.ExtractEntrantId(User.Identity.GetUserId());

            var schoolMarks = await _queryBuilder
                              .For <Task <IEnumerable <SchoolMark> > >()
                              .With(new GetSchoolMarksOfEntrantCriterion {
                EntrantId = entrantId
            });

            return(View(schoolMarks));
        }
Example #4
0
        // GET: EntrantUser/Recomendations
        public async Task <ActionResult> Index()
        {
            var entrantId = await _infoExtractor.ExtractEntrantId(User.Identity.GetUserId());

            var entrant = await _queryBuilder
                          .For <Task <Entrant> >()
                          .With(new GetEntrantForCharacterizerCriterion {
                EntrantId = entrantId
            });

            var educationLines = await _queryBuilder
                                 .For <Task <List <EducationLine> > >()
                                 .With(new GetEducationLinesForCharacterizerCriterion());

            //Рекомендации:
            //1. По методу сравнения расстояний мд характеристиками
            ViewBag.DistanceRecomendations = await _distanceRecomendator.GetRecomendation(entrant, educationLines);

            //2. По методу многокритериального анализа
            ViewBag.MulticriterialRecomendations =
                await _multicriterialAnalysisRecomendator.Calculate(entrant, educationLines);

            //3. По говнокоду AHP метод
            //TODO: выпилить этот говнокод вместе с проектом после публикации статьи(или переписать)
            await CalculateAhp(entrant, educationLines);

            return(View());
        }
Example #5
0
        // GET: /EntrantUser/Olympiad/

        public async Task <ActionResult> Index()
        {
            var entrantId = await _infoExtractor.ExtractEntrantId(User.Identity.GetUserId());

            var participationinolympiads = await _queryBuilder
                                           .For <Task <IEnumerable <ParticipationInOlympiad> > >()
                                           .With(new GetAllParticipationInOlympiadCriterion {
                EntrantId = entrantId
            });

            return(View(participationinolympiads));
        }
Example #6
0
        // GET: /EntrantUser/Orientation/
        public async Task <ActionResult> Index()
        {
            var entrantId = await _infoExtractor.ExtractEntrantId(User.Identity.GetUserId());

            var entrant =
                await
                _queryBuilder.For <Task <Entrant> >()
                .With(new GetEntrantForCharacterizerCriterion {
                EntrantId = entrantId
            });

            //Предпочтения пользователя по предметам и пр.
            var entrantCharacteristics = await _entrantCharacterizer.Calculate(entrant);

            //add true for complicated method
            ViewBag.Preferences = entrantCharacteristics;

            return(View());
        }
Example #7
0
        public OlympiadControllerTest()
        {
            _requestContext = SubstituteRequerstContext();

            _infoExtractor.ExtractEntrantId("").ReturnsForAnyArgs(Task.FromResult(EntrantId));
        }