Example #1
0
        private static void SaveAlbumIdToProfile(int albumId, string userName, int galleryId)
        {
            IUserProfile profile = ProfileController.GetProfile(userName);

            IUserGalleryProfile pg = profile.GetGalleryProfile(galleryId);

            pg.UserAlbumId = albumId;

            ProfileController.SaveProfile(profile);
        }
        public void SetMetaDataVisibility(bool isVisible, int galleryId)
        {
            try
            {
                IUserProfile profile = ProfileController.GetProfile();
                profile.GetGalleryProfile(galleryId).ShowMediaObjectMetadata = isVisible;
                ProfileController.SaveProfile(profile);
            }
            catch (Exception ex)
            {
                AppErrorController.LogError(ex);

#if DEBUG
                throw;
#endif
            }
        }
Example #3
0
        private void SaveProfile(IUserProfile userProfile)
        {
            // Get reference to user's album. We need to do this *before* saving the profile, because if the user disabled their user album,
            // this method will return null after saving the profile.
            IAlbum album = UserController.GetUserAlbum(GalleryId);

            IUserGalleryProfile profile = userProfile.GetGalleryProfile(GalleryId);

            if (!profile.EnableUserAlbum)
            {
                AlbumController.DeleteAlbum(album);
            }

            if (!profile.EnableUserAlbum)
            {
                profile.UserAlbumId = 0;
            }

            ProfileController.SaveProfile(userProfile);
        }
        private void UpdateUserAlbumProfileSetting(bool enableUserAlbum)
        {
            HelperFunctions.BeginTransaction();

            try
            {
                foreach (IUserAccount user in UserController.GetAllUsers())
                {
                    IUserProfile profile = ProfileController.GetProfile(user.UserName);

                    profile.GetGalleryProfile(GalleryId).EnableUserAlbum = enableUserAlbum;

                    ProfileController.SaveProfile(profile);
                }
                HelperFunctions.CommitTransaction();
                HelperFunctions.PurgeCache();
            }
            catch
            {
                HelperFunctions.RollbackTransaction();
                throw;
            }
        }
Example #5
0
        private void SaveProfile(IUserProfile userProfile)
        {
            // Get reference to user's album. We need to do this *before* saving the profile, because if the user disabled their user album,
            // this method will return null after saving the profile.
            IAlbum album = UserController.GetUserAlbum(GalleryId);

            IUserGalleryProfile profile = userProfile.GetGalleryProfile(GalleryId);

            if (!profile.EnableUserAlbum)
            {
                AlbumController.DeleteAlbum(album);
            }

            if (!profile.EnableUserAlbum)
            {
                profile.UserAlbumId = 0;
            }

            ProfileController.SaveProfile(userProfile);
        }