Esempio n. 1
0
        public SongListEdit(SongListForEditContract contract)
            : this()
        {
            ParamIs.NotNull(() => contract);

            CurrentName = contract.Name;
            Description = contract.Description;
            FeaturedCategory = contract.FeaturedCategory;
            Id = contract.Id;
            Name = contract.Name;
            SongLinks = contract.SongLinks;

            CanCreateFeaturedLists = EntryPermissionManager.CanManageFeaturedLists(MvcApplication.LoginManager);
        }
Esempio n. 2
0
        public void AddSongToList(int listId, int songId, string newListName = null)
        {
            if (listId != 0) {

                Service.AddSongToList(listId, songId);

            } else if (!string.IsNullOrWhiteSpace(newListName)) {

                var contract = new SongListForEditContract {
                    Name = newListName,
                    SongLinks = new[] {new SongInListEditContract {SongId = songId, Order = 1 }}
                };

                songListQueries.UpdateSongList(contract, null);

            }
        }
		public void SetUp() {
			
			repository = new FakeSongListRepository();
			userWithSongList = new User("User with songlist", "123", "*****@*****.**", 123);
			permissionContext = new FakePermissionContext(new UserWithPermissionsContract(userWithSongList, ContentLanguagePreference.Default));

			imagePersister = new InMemoryImagePersister();
			queries = new SongListQueries(repository, permissionContext, new FakeEntryLinkFactory(), imagePersister);

			var song1 = new Song(TranslatedString.Create("Project Diva desu.")) { Id = 1};
			var song2 = new Song(TranslatedString.Create("World is Mine")) { Id = 2};

			repository.Add(userWithSongList);
			repository.Add(song1, song2);

			songListContract = new SongListForEditContract {
				Name = "Mikunopolis Setlist",
				Description = "MIKUNOPOLIS in LOS ANGELES - Hatsune Miku US debut concert held at Nokia Theatre for Anime Expo 2011 on 2nd July 2011.",
				SongLinks = SongInListEditContracts(song1, song2)
			};

		}