コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }