public ReleaseEventFindResultContract(ReleaseEventSeries series, ContentLanguagePreference languagePreference, int seriesNumber, string seriesSuffix, string eventName)
 {
     Series       = new ReleaseEventSeriesContract(series, languagePreference);
     SeriesNumber = seriesNumber;
     SeriesSuffix = seriesSuffix;
     EventName    = eventName;
 }
        public ReleaseEventContract(ReleaseEvent ev, ContentLanguagePreference languagePreference, bool includeSeries = false, bool includeSeriesLinks = false)
            : this()
        {
            ParamIs.NotNull(() => ev);

            AdditionalNames = ev.Names.GetAdditionalNamesStringForLanguage(languagePreference);
            Category        = ev.Category;
            CustomName      = ev.CustomName;
            Date            = ev.Date;
            Deleted         = ev.Deleted;
            Description     = ev.Description;
            EndDate         = ev.EndDate;
            Id          = ev.Id;
            Name        = ev.TranslatedName[languagePreference];
            PictureMime = ev.PictureMime;
            SongList    = ObjectHelper.Convert(ev.SongList, s => new SongListBaseContract(s));
            Status      = ev.Status;
            UrlSlug     = ev.UrlSlug;
            Venue       = ObjectHelper.Convert(ev.Venue, v => new VenueContract(v, languagePreference, includeSeriesLinks));
            VenueName   = ev.VenueName;
            Version     = ev.Version;

            if (includeSeries && ev.HasSeries)
            {
                Series = new ReleaseEventSeriesContract(ev.Series, languagePreference, includeSeriesLinks);
            }
        }
 public ReleaseEventFindResultContract(ReleaseEventSeries series, int seriesNumber, string seriesSuffix, string eventName)
 {
     Series       = new ReleaseEventSeriesContract(series);
     SeriesNumber = seriesNumber;
     SeriesSuffix = seriesSuffix;
     EventName    = eventName;
 }
Esempio n. 4
0
        public ReleaseEventForApiContract(ReleaseEvent rel, ReleaseEventOptionalFields fields)
        {
            Date         = rel.Date;
            Id           = rel.Id;
            Name         = rel.Name;
            SeriesNumber = rel.SeriesNumber;
            SeriesSuffix = rel.SeriesSuffix;
            UrlSlug      = rel.UrlSlug;

            if (rel.Series != null)
            {
                SeriesId = rel.Series.Id;
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Description))
            {
                Description = rel.Description;
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Series) && rel.Series != null)
            {
                Series = new ReleaseEventSeriesContract(rel.Series);
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.SongList) && rel.SongList != null)
            {
                SongList = new SongListBaseContract(rel.SongList);
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.WebLinks))
            {
                WebLinks = rel.WebLinks.Select(w => new WebLinkForApiContract(w)).ToArray();
            }
        }
        public ReleaseEventForApiContract(ReleaseEvent rel, ContentLanguagePreference languagePreference, ReleaseEventOptionalFields fields, IEntryThumbPersister thumbPersister)
        {
            Category     = rel.Category;
            Date         = rel.Date;
            EndDate      = rel.EndDate;
            Id           = rel.Id;
            Name         = rel.TranslatedName[languagePreference];
            SeriesNumber = rel.SeriesNumber;
            SeriesSuffix = rel.SeriesSuffix;
            Status       = rel.Status;
            UrlSlug      = rel.UrlSlug;
            VenueName    = rel.VenueName;
            Version      = rel.Version;

            if (rel.HasSeries)
            {
                SeriesId = rel.Series.Id;
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.AdditionalNames))
            {
                AdditionalNames = rel.Names.GetAdditionalNamesStringForLanguage(languagePreference);
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Artists))
            {
                Artists = rel.Artists.Select(a => new ArtistForEventContract(a, languagePreference)).ToArray();
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Description))
            {
                Description = rel.Description;
            }

            if (thumbPersister != null && fields.HasFlag(ReleaseEventOptionalFields.MainPicture))
            {
                MainPicture = EntryThumbForApiContract.Create(EntryThumb.Create(rel) ?? EntryThumb.Create(rel.Series), thumbPersister);
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Names))
            {
                Names = rel.Names.Select(n => new LocalizedStringContract(n)).ToArray();
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Series) && rel.HasSeries)
            {
                Series = new ReleaseEventSeriesContract(rel.Series, languagePreference);
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.SongList) && rel.SongList != null)
            {
                SongList = new SongListBaseContract(rel.SongList);
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.WebLinks))
            {
                WebLinks = rel.WebLinks.Select(w => new WebLinkForApiContract(w)).ToArray();
            }
        }
		public ReleaseEventFindResultContract(ReleaseEventSeries series, int seriesNumber, string seriesSuffix, string eventName) {

			Series = new ReleaseEventSeriesContract(series);
			SeriesNumber = seriesNumber;
			SeriesSuffix = seriesSuffix;
			EventName = eventName;

		}
		public ReleaseEventContract(ReleaseEvent ev, bool includeSeries = false)
			: this() {

			ParamIs.NotNull(() => ev);

			Date = ev.Date;
			Description = ev.Description;
			Id = ev.Id;
			Name = ev.Name;

			if (includeSeries && ev.Series != null)
				Series = new ReleaseEventSeriesContract(ev.Series);

		}
Esempio n. 8
0
        public ReleaseEventContract(ReleaseEvent ev, bool includeSeries = false)
            : this()
        {
            ParamIs.NotNull(() => ev);

            Date        = ev.Date;
            Description = ev.Description;
            Id          = ev.Id;
            Name        = ev.Name;

            if (includeSeries && ev.Series != null)
            {
                Series = new ReleaseEventSeriesContract(ev.Series);
            }
        }
Esempio n. 9
0
        public ArchivedEventSeriesVersionDetailsContract(ArchivedReleaseEventSeriesVersion archived, ArchivedReleaseEventSeriesVersion comparedVersion, IUserPermissionContext permissionContext)
        {
            ParamIs.NotNull(() => archived);

            ArchivedVersion    = new ArchivedEventSeriesVersionContract(archived);
            ComparedVersion    = comparedVersion != null ? new ArchivedEventSeriesVersionContract(comparedVersion) : null;
            ReleaseEventSeries = new ReleaseEventSeriesContract(archived.Entry, permissionContext.LanguagePreference);
            Name = ReleaseEventSeries.Name;

            ComparableVersions = archived.Entry.ArchivedVersionsManager
                                 .GetPreviousVersions(archived, permissionContext)
                                 .Select(a => ArchivedObjectVersionWithFieldsContract.Create(a, a.Diff.ChangedFields.Value, a.CommonEditEvent))
                                 .ToArray();

            Versions = ComparedEventSeriesContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
Esempio n. 10
0
        public ReleaseEventContract(ReleaseEvent ev, bool includeSeries = false)
            : this()
        {
            ParamIs.NotNull(() => ev);

            CustomName  = ev.CustomName;
            Date        = ev.Date;
            Description = ev.Description;
            Id          = ev.Id;
            Name        = ev.Name;
            PictureMime = ev.PictureMime;
            SongList    = ObjectHelper.Convert(ev.SongList, s => new SongListBaseContract(s));
            UrlSlug     = ev.UrlSlug;
            Venue       = ev.Venue;
            Version     = ev.Version;

            if (includeSeries && ev.Series != null)
            {
                Series = new ReleaseEventSeriesContract(ev.Series);
            }
        }
		public ReleaseEventForApiContract(ReleaseEvent rel, ReleaseEventOptionalFields fields) {
			
			Date = rel.Date;
			Id = rel.Id;
			Name = rel.Name;
			SeriesNumber = rel.SeriesNumber;
			SeriesSuffix = rel.SeriesSuffix;

			if (rel.Series != null) {
				SeriesId = rel.Series.Id;
			}

			if (fields.HasFlag(ReleaseEventOptionalFields.Description)) {
				Description = rel.Description;
			}

			if (fields.HasFlag(ReleaseEventOptionalFields.Series) && rel.Series != null) {
				Series = new ReleaseEventSeriesContract(rel.Series);
			}

		}
Esempio n. 12
0
        public ReleaseEventForApiContract(ReleaseEvent rel, ReleaseEventOptionalFields fields)
        {
            Date         = rel.Date;
            Id           = rel.Id;
            Name         = rel.Name;
            SeriesNumber = rel.SeriesNumber;
            SeriesSuffix = rel.SeriesSuffix;

            if (rel.Series != null)
            {
                SeriesId = rel.Series.Id;
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Description))
            {
                Description = rel.Description;
            }

            if (fields.HasFlag(ReleaseEventOptionalFields.Series) && rel.Series != null)
            {
                Series = new ReleaseEventSeriesContract(rel.Series);
            }
        }
Esempio n. 13
0
 public void CopyNonEditableProperties(ReleaseEventSeriesContract seriesContract)
 {
     if (seriesContract != null) {
         SeriesId = seriesContract.Id;
         SeriesName = seriesContract.Name;
     }
 }
Esempio n. 14
0
 public EventEdit(ReleaseEventSeriesContract seriesContract)
     : this()
 {
     CopyNonEditableProperties(seriesContract);
 }