Пример #1
0
        public static bool Delete(RankingGenre genre)
        {
            var db        = HohoemaLiteDb.GetLocalLiteRepository();
            var genreCode = genre.ToString();

            return(db.Delete <RankingGenreTagsInfo>(x => x.GenreCode == genreCode) > 0);
        }
Пример #2
0
 public bool Upsert(RankingGenre genre, IEnumerable <RankingGenreTagEntry> tags)
 {
     return(_collection.Upsert(new RankingTagsGenreGroupedEntry()
     {
         GenreCode = genre.ToString(),
         Tags = tags.ToList(),
         UpdateAt = DateTime.Now
     }));
 }
Пример #3
0
        public RankingTagsGenreGroupedEntry Get(RankingGenre genre)
        {
            if (genre == RankingGenre.All)
            {
                return(null);
            }

            var genreCode = genre.ToString();

            return(_collection.FindOne(x => x.GenreCode == genreCode));
        }
Пример #4
0
        public static bool Upsert(RankingGenre genre, IEnumerable <RankingGenreTag> tags)
        {
            var db = HohoemaLiteDb.GetLocalLiteRepository();

            db.Upsert(new RankingGenreTagsInfo()
            {
                GenreCode = genre.ToString(),
                Tags      = tags.ToList(),
                UpdateAt  = DateTime.Now
            });
            return(true);
        }
Пример #5
0
        public static RankingGenreTagsInfo Get(RankingGenre genre)
        {
            if (genre == RankingGenre.All)
            {
                return(null);
            }

            var db        = HohoemaLiteDb.GetLocalLiteRepository();
            var genreCode = genre.ToString();

            return(db.SingleOrDefault <RankingGenreTagsInfo>(x => x.GenreCode == genreCode));
        }
Пример #6
0
        HohoemaPin IPinablePage.GetPin()
        {
            var genreName = RankingGenre.Translate();
            var tag       = SelectedRankingTag.Value?.Tag;
            var pickedTag = PickedTags.FirstOrDefault(x => x.Tag == tag);

            Dictionary <string, string> pairs = new Dictionary <string, string>();

            pairs.Add(RankingCategoryPageNavigationConstants.RankingGenreQueryKey, RankingGenre.ToString());
            if (!string.IsNullOrEmpty(pickedTag.Tag) && pickedTag.Tag != "all")
            {
                pairs.Add(RankingCategoryPageNavigationConstants.RankingGenreTagQueryKey, pickedTag.Tag);
            }

            return(new HohoemaPin()
            {
                Label = pickedTag != null ? $"{pickedTag.Label} - {genreName}" : $"{genreName}",
                PageType = HohoemaPageType.RankingCategory,
                Parameter = pairs.ToQueryString()
            });
        }
Пример #7
0
        public bool Delete(RankingGenre genre)
        {
            var genreCode = genre.ToString();

            return(_collection.DeleteMany(x => x.GenreCode == genreCode) > 0);
        }
Пример #8
0
 public static INavigationParameters SetRankingGenre(this INavigationParameters parameters, RankingGenre rankingGenre)
 {
     parameters.Add(RankingGenreQueryKey, Uri.EscapeDataString(rankingGenre.ToString()));
     return(parameters);
 }