public ActionResult NewAppliance()
        {
            UserProfile currentUser = GetCurrentUser();

            if (currentUser.RoleId != (int)UserRoleTypes.Applicant)
            {
                return(Redirect("/Home/Index"));
            }

            List <SelectListItem> skills = _skillsRepository.GetAll().
                                           Select(r => new SelectListItem {
                Value = r.Id.ToString(), Text = r.SkillName
            }).
                                           ToList();

            List <SelectListItem> skillLevels = _skillsRepository.GetSkillLevels().
                                                Select(r => new SelectListItem {
                Value = r.Id.ToString(), Text = r.ValueName
            }).
                                                ToList();

            List <SelectListItem> skillAttributes = _skillAttrsRepository.GetAll().
                                                    Select(r => new SelectListItem {
                Value = r.Id.ToString(), Text = r.Name
            }).
                                                    ToList();

            CreateApplianceModel dataModel = new CreateApplianceModel();

            for (int i = 0; i < DEFAULT_APPLIANCE_ABILITIES; i++)
            {
                Ability ability = new Ability();
                dataModel.ApplianceAbilities.Add(ability);
            }

            ViewBag.Skills          = skills;
            ViewBag.SkillLevels     = skillLevels;
            ViewBag.SkillAttributes = skillAttributes;

            return(View(dataModel));
        }
Beispiel #2
0
        public ActionResult NewProfession()
        {
            CreateProfessionModel newProfession = new CreateProfessionModel();

            List <SelectListItem> skills = _skillsRepository.GetAll().
                                           Select(r => new SelectListItem {
                Value = r.Id.ToString(), Text = r.SkillName
            }).
                                           ToList();

            List <SelectListItem> skillLevels = _skillsRepository.GetSkillLevels().
                                                Select(r => new SelectListItem {
                Value = r.Id.ToString(), Text = r.ValueName
            }).
                                                ToList();

            ViewBag.Skills      = skills;
            ViewBag.SkillLevels = skillLevels;

            return(View(newProfession));
        }
 public List <Skills> Get()
 {
     return(_repository.GetAll());
 }