Exemplo n.º 1
0
        public SongEditViewModel(SongContract song, IUserPermissionContext permissionContext,
            SongForEditContract editedSong = null)
            : this()
        {
            ParamIs.NotNull(() => song);

            Song = song;
            AllowedEntryStatuses = EntryPermissionManager.AllowedEntryStatuses(permissionContext);
            EditedSong = editedSong;
        }
Exemplo n.º 2
0
        public void CopyNonEditableFields(SongForEditContract song)
        {
            ParamIs.NotNull(() => song);

            AllowedEntryStatuses = EntryPermissionManager.AllowedEntryStatuses(MvcApplication.LoginManager);
            Deleted = song.Deleted;
            Draft = song.Song.Status == EntryStatus.Draft;
            Name = song.Song.Name;
            ValidationResult = song.ValidationResult;
        }
Exemplo n.º 3
0
        public SongEdit(SongForEditContract song)
            : this()
        {
            ParamIs.NotNull(() => song);

            ArtistLinks = song.Artists;
            DefaultLanguageSelection = song.TranslatedName.DefaultLanguage;
            Id = song.Song.Id;
            Lyrics = song.Lyrics.Select(l => new LyricsForSongModel(l)).ToArray();
            NameEnglish = song.TranslatedName.English;
            NameJapanese = song.TranslatedName.Japanese;
            NameRomaji = song.TranslatedName.Romaji;
            Names = song.Names;
            Notes = song.Notes;
            OriginalVersion = song.OriginalVersion ?? new SongContract();
            PVs = song.PVs;
            SongType = song.Song.SongType;
            Status = song.Song.Status;
            WebLinks = song.WebLinks.Select(w => new WebLinkDisplay(w)).ToArray();

            CopyNonEditableFields(song);
        }