Exemplo n.º 1
0
        public EditUserInterestViewModel prepareEditCurriculumVitaeInterests()
        {
            EditUserInterestViewModel model = new EditUserInterestViewModel();

            model.InterestLevel = 50;

            foreach (Interest item in _interestService.ListInterests().Except((from a in _userService.GetUserInterests()
                                                                               select new Interest()
            {
                Id = a.InterestID,
                AnInterest = a.UserInterest.AnInterest
            }).ToList(), new InterestComparer()).ToList())
            {
                model.Interests.Add(new SelectListItem()
                {
                    Text  = item.AnInterest,
                    Value = item.Id.ToString()
                });
            }

            foreach (IntegratorUserInterest item in _userService.GetUserInterests())
            {
                model.UserInterests.Add(new UserInterestViewModel()
                {
                    Id            = item.Id,
                    Interest      = item.UserInterest.AnInterest,
                    InterestLevel = item.InterestLevel
                });
            }

            return(model);
        }
Exemplo n.º 2
0
        public IActionResult AddUserInterests([FromBody] EditUserInterestViewModel request)
        {
            _entityCRUDResponse = _userService.AddUserInterest(new IntegratorUserInterest()
            {
                Id               = request.Id,
                InterestLevel    = request.InterestLevel,
                IntegratorUserID = _userService.GetUserID(),
                InterestID       = request.InterestID
            });

            return(new JsonResult(_entityCRUDResponse));
        }
Exemplo n.º 3
0
        public IActionResult Interests()
        {
            EditUserInterestViewModel model = _curriculumVitaeViewModelFactory.prepareEditCurriculumVitaeInterests();

            return(View(model));
        }