Exemplo n.º 1
0
        public static List <MenteeViewModel> GetMentees(ref DAO.ApplicationContext context)
        {
            int menteeType = DomainHelper.GetValueByKeyValue(ref context, "PersonType", "Mentee").id;

            var data = (from r in context.People
                        where r.PersonTypeId == menteeType
                        select r).AsEnumerable()
                       .Select(x => new MenteeViewModel
            {
                Mentee = x,
            });


            return((List <MenteeViewModel>)data.ToList());
        }
Exemplo n.º 2
0
        public static IEnumerable <SelectListItem> GetMenteesDropdownList(ref DAO.ApplicationContext context)
        {
            int menteeType = DomainHelper.GetValueByKeyValue(ref context, "PersonType", "Mentee").id;

            var data = (from r in context.People
                        where r.PersonTypeId == menteeType
                        select r).AsEnumerable()
                       .Select(x => new SelectListItem
            {
                Text  = x.LastName + ", " + x.FirstName,
                Value = x.id.ToString()
            }).ToList();

            data.Insert(0, new SelectListItem {
                Value = "0", Text = "Please select ..."
            });

            return(data);
        }