public ActionResult Create() { var userGroupList = new SelectList(userGroupRepository.GetUserGroupsWithCurrencyInfo() .Select( m => new SelectListItem() { Value = m.Id.ToString(), Text = (m.Name + " - " + m.CurrencyCode) } ), "Value", "Text").ToList(); ViewBag.UserGroupList = userGroupList; CollegeGroupVM model = new CollegeGroupVM(); model.UserGroupId = userGroupRepository.GetUserGroupByName().FirstOrDefault().ID; return(View(model)); }
public ActionResult Register() { var userGroupList = new SelectList(userGroupRepository.GetUserGroupsWithCurrencyInfo() .Select( m => new SelectListItem() { Value = m.Id.ToString(), Text = (m.Name + " - " + m.CurrencyCode) } ), "Value", "Text").ToList(); ViewBag.UserGroupList = userGroupList; var collegeGroupList = new SelectList(collegeGroupRepository.GetCollegeGroups(), "Id", "Name").ToList(); ViewBag.CollegeGroupList = collegeGroupList; UserVM model = new UserVM(); return(View(model)); }