public static void CreateFlickrAlbums(string username)
    {
        PhotoAlbumProvider provider = PhotoAlbumService.Instance;

        Dictionary <String, String> defaultAlbums =
            new Dictionary <string, string>();

        defaultAlbums.Add("Forest Album", "forest");
        defaultAlbums.Add("Summer Album", "summer");
        defaultAlbums.Add("Water Album", "water");

        List <Album> albums = provider.GetAlbums(username);

        foreach (Album album in albums)
        {
            // start from scratch
            if (defaultAlbums.ContainsKey(album.Name))
            {
                // delete photos first
                foreach (Photo photo in album.Photos)
                {
                    provider.PhotoDeletePermanent(photo);
                }
                provider.AlbumDeletePermanent(album);
            }
        }

        foreach (string albumName in defaultAlbums.Keys)
        {
            CreateFlickrAlbums(username, albumName, defaultAlbums[albumName]);
        }

        RepopulateSiteMap();
    }
    private static void DeleteFlickAlbum(string username,
                                         string albumName)
    {
        PhotoAlbumProvider provider = PhotoAlbumService.Instance;
        List <Album>       albums   = provider.GetAlbums(username);

        foreach (Album album in albums)
        {
            // start from scratch
            if (album.Name.Equals(albumName))
            {
                // delete photos first
                foreach (Photo photo in album.Photos)
                {
                    provider.PhotoDeletePermanent(photo);
                }
                provider.AlbumDeletePermanent(album);
            }
        }
    }