public string GetEntrySubTypeName(IEntryBase entryBase, IEnumTranslations enumTranslations, CultureInfo culture)
        {
            switch (entryBase)
            {
            case Album a:
                return(enumTranslations.Translation(a.DiscType, culture));

            case Artist a:
                return(enumTranslations.Translation(a.ArtistType, culture));

            case Song s:
                return(enumTranslations.Translation(s.SongType, culture));
            }

            return(string.Empty);
        }
Пример #2
0
        public bool CreateReport(int eventId, EventReportType reportType, string hostname, string notes, int?versionNumber)
        {
            ParamIs.NotNull(() => hostname);
            ParamIs.NotNull(() => notes);

            return(HandleTransaction(ctx => {
                return new Model.Service.Queries.EntryReportQueries().CreateReport(ctx, PermissionContext,
                                                                                   entryLinkFactory, report => report.Entry.Id == eventId,
                                                                                   (song, reporter, notesTruncated) => new EventReport(song, reportType, reporter, hostname, notesTruncated, versionNumber),
                                                                                   () => reportType != EventReportType.Other ? enumTranslations.Translation(reportType) : null,
                                                                                   eventId, reportType, hostname, notes);
            }));
        }
Пример #3
0
 public override string TranslatedReportTypeName(IEnumTranslations enumTranslations, CultureInfo culture)
 {
     return(enumTranslations.Translation(ReportType, culture));
 }
Пример #4
0
 public override string TranslatedReportTypeName(IEnumTranslations enumTranslations)
 {
     return(enumTranslations.Translation(ReportType));
 }
Пример #5
0
        public (bool created, int reportId) CreateReport(int tagId, TagReportType reportType, string hostname, string notes, int?versionNumber)
        {
            ParamIs.NotNull(() => hostname);
            ParamIs.NotNull(() => notes);

            return(HandleTransaction(ctx =>
            {
                return new Model.Service.Queries.EntryReportQueries().CreateReport(ctx, PermissionContext,
                                                                                   _entryLinkFactory,
                                                                                   (song, reporter, notesTruncated) => new TagReport(song, reportType, reporter, hostname, notesTruncated, versionNumber),
                                                                                   () => reportType != TagReportType.Other ? _enumTranslations.Translation(reportType) : null,
                                                                                   tagId, reportType, hostname, notes);
            }));
        }