Exemplo n.º 1
0
        public ActionResult Index(SkillFilter filter = null)
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            if (filter != null && filter.SelectedSkillIds != null && filter.SelectedSkillIds.Count() > 0)
            {
                ViewBag.Workers = Manager.GetWorkers().Where(w => filter.SelectedSkillIds.Intersect(w.Skills.Select(s => s.SkillId)).Count() > 0).ToList();
            }
            else
            {
                ViewBag.Workers = Manager.GetWorkers().ToList();
            }
            var choiseList = ChoiceListHelper.Create(Manager.GetSkills(), (t => t.SkillId), (t => t.Code));

            ViewBag.ChoiseList = choiseList;

            return(View(filter));
        }
Exemplo n.º 2
0
        //
        // GET: /Account/Manage

        public ActionResult Manage(ManageMessageId?message)
        {
            ViewBag.StatusMessage =
                message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : "";

            ViewBag.ReturnUrl = Url.Action("Manage");

            var user = Manager.GetUserProfile();

            var skills = new MultiSelectList(Manager.GetSkills(), "SkillId", "Code", user.Worker != null ?
                                             user.Worker.Skills.Select(s => s.SkillId.ToString()) : null);

            ViewBag.Skills = skills;

            var choiseList = ChoiceListHelper.Create(Manager.GetSkills(), (t => t.SkillId), (t => t.Code));

            ViewBag.ChoiseList = choiseList;
            ViewBag.Worker     = user.Worker;

            return(View());
        }