Exemplo n.º 1
0
        public ActionResult Edit(string id)
        {
            MembershipUser     user = Membership.GetUser(id);
            UserProfileManager pMgr = new UserProfileManager(user);

            var userModules = ModRepository.GetUserModules((Guid)user.ProviderUserKey);
            var allModules  = new List <IModule>();          //ModRepository.GetAllStaticModules();

            EditUserViewModel viewModel = new EditUserViewModel()
            {
                UserId      = (Guid)user.ProviderUserKey,
                Email       = user.Email,
                UserProfile = pMgr.UserProfile,
                UserModules = userModules,
                AllModules  = allModules.Where(module => userModules.FirstOrDefault(mod => mod.Id == module.Id) == null)
            };

            // add the list with all available database types
            // TODO: Move this code to the profile-related namespace
            List <object> databaseTypes = new List <object>();

            return(View(viewModel));
        }