コード例 #1
0
        public AlbumEditViewModel(AlbumContract album, IUserPermissionContext permissionContext,
            AlbumForEditContract editedAlbum = null)
            : this()
        {
            ParamIs.NotNull(() => album);

            Album = album;
            EditedAlbum = editedAlbum;

            AllowedEntryStatuses = EntryPermissionManager.AllowedEntryStatuses(permissionContext);
        }
コード例 #2
0
ファイル: AlbumModels.cs プロジェクト: realzhaorong/vocadb
        public void CopyNonEditableFields(AlbumForEditContract album)
        {
            ParamIs.NotNull(() => album);

            AllowedEntryStatuses = EntryPermissionManager.AllowedEntryStatuses(MvcApplication.LoginManager);
            ArtistLinks = album.ArtistLinks;
            Deleted = album.Deleted;
            Draft = album.Status == EntryStatus.Draft;
            NameEnglish = album.TranslatedName.English;
            NameJapanese = album.TranslatedName.Japanese;
            NameRomaji = album.TranslatedName.Romaji;
            ValidationResult = album.ValidationResult;
        }
コード例 #3
0
ファイル: AlbumModels.cs プロジェクト: realzhaorong/vocadb
        public AlbumEdit(AlbumForEditContract album)
            : this()
        {
            ParamIs.NotNull(() => album);

            DefaultLanguageSelection = album.TranslatedName.DefaultLanguage;
            Description = album.Description;
            DiscType = album.DiscType;
            Id = album.Id;
            Name = album.Name;
            Names = album.Names;
            Pictures = album.Pictures;
            PVs = album.PVs;
            Status = album.Status;
            Tracks = album.Songs;
            WebLinks = album.WebLinks.Select(w => new WebLinkDisplay(w)).ToArray();

            if (album.OriginalRelease != null) {
                CatNum = album.OriginalRelease.CatNum;
                ReleaseEvent = album.OriginalRelease.EventName;
                var d = album.OriginalRelease.ReleaseDate;
                if (d != null) {
                    ReleaseDay = d.Day;
                    ReleaseMonth = d.Month;
                    ReleaseYear = d.Year;
                }
            }

            CopyNonEditableFields(album);
        }