コード例 #1
0
        public ActionResult UpdateUser(Int64 userID)
        {
            UserPO displayObject = new UserPO();

            try
            {
                List <RolesDO> roles = dataAccessRoles.ViewAllRoles();
                ViewBag.DropDownList = new List <SelectListItem>();
                //Turn all the roles into a option.
                foreach (RolesDO role in roles)
                {
                    ViewBag.DropDownList.Add(new SelectListItem()
                    {
                        Text = role.RoleName, Value = role.RoleID.ToString()
                    });
                }


                UserDO item = dataAccess.ViewUserAtID(userID);
                displayObject = UserMapper.MapDoToPo(item);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(View(displayObject));
        }