private static void SaveAlbumIdToProfile(int albumId, string userName) { ProfileEntity profileEntity = ProfileController.GetProfile(userName); profileEntity.UserAlbumId = albumId; ProfileController.SaveProfile(profileEntity); }
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); }
/// <summary> /// Persists the current user's sort preference for the specified <paramref name="album" />. No action is taken if the /// album is virtual. Anonymous user data is stored in session only; logged on users' data are permanently stored. /// </summary> /// <param name="album">The album whose sort preference is to be preserved.</param> /// <param name="sortByMetaName">Name of the metadata item to sort by.</param> /// <param name="sortAscending">Indicates the sort direction.</param> private static void PersistUserSortPreference(IAlbum album, MetadataItemName sortByMetaName, bool sortAscending) { if (album.IsVirtualAlbum) { return; } var profile = ProfileController.GetProfile(); var aProfile = profile.AlbumProfiles.Find(album.Id); if (aProfile == null) { profile.AlbumProfiles.Add(new AlbumProfile(album.Id, sortByMetaName, sortAscending)); } else { aProfile.SortByMetaName = sortByMetaName; aProfile.SortAscending = sortAscending; } ProfileController.SaveProfile(profile); }