Ejemplo n.º 1
0
        public IActionResult ProfileEdit(ProfileViewModel profileEdit)
        {
            User userTemp = new User();
            var  user     = authProvider.GetCurrentUser();

            userTemp.Username = user.Username;
            var container = profileDAO.GetProfile(userTemp.Username);

            profileDAO.UpdatedProfile(profileEdit);
            profileEdit.ProfileId  = container.ProfileId;
            profileEdit.AvatarName = container.AvatarName;
            profileDAO.SaveGameOptions(profileEdit, profileEdit.GamesSelected);
            profileDAO.GameNames(profileEdit);
            profileDAO.SaveGenreOptions(profileEdit, profileEdit.GenresSelected);
            profileDAO.GenreNames(profileEdit);
            profileDAO.UpdatedProfile(profileEdit);

            return(RedirectToAction("Profile", "Account"));
        }