Exemplo n.º 1
0
        // GET: Profile/Create
        public ActionResult CreateIndividualProfile()
        {
            var countryList = new SelectList(countryRepository.GetCountries(), "Id", "Name").ToList();
            //var titleList = new SelectList(titleRepository.GetTitle(), "Id", "Title").ToList();
            var titleList = new SelectList(titleRepository.GetTitle()
                                           .Select(
                                               m => new SelectListItem()
            {
                Value = m.Id.ToString(),
                Text  = (m.Title)
            }
                                               ), "Value", "Text").ToList();
            var vipList         = new SelectList(vipRepository.GetVip(), "Id", "Description").ToList();
            var nationalityList = new SelectList(nationalityRepository.GetNationality(), "Id", "Name").ToList();

            var profileTypeId = profileTypeRepository.GetProfileType(ProfileTypeName.INDIVIDUAL).FirstOrDefault().Id;

            var preferenceGroupList = new SelectList(preferenceGroupRepository.GetPreferenceGroup(), "Id", "Name").ToList();

            IndividualProfileVM model = new IndividualProfileVM();

            model.ProfileTypeId = profileTypeId;
            model.IsActive      = true;

            ViewBag.TitleList           = titleList;
            ViewBag.VipList             = vipList;
            ViewBag.CountryList         = countryList;
            ViewBag.NationalityList     = nationalityList;
            ViewBag.PreferenceGroupList = preferenceGroupList;
            return(View(model));
        }