Esempio n. 1
0
        private static IQueryable <OutcomeEntity> ApplyCategoryKey(IQueryable <OutcomeEntity> sql, IKey categoryKey)
        {
            if (!categoryKey.IsEmpty)
            {
                sql = sql.Where(o => o.Categories.Any(c => c.CategoryId == categoryKey.AsGuidKey().Guid));
            }

            return(sql);
        }
Esempio n. 2
0
 public string UrlOverview(YearModel year, IKey categoryKey)
 {
     if (categoryKey.IsEmpty)
     {
         return(UrlOverview(year));
     }
     else
     {
         return($"/{year.Year}/overview/{categoryKey.AsGuidKey().Guid}");
     }
 }
Esempio n. 3
0
 public string UrlOverview(MonthModel month, IKey categoryKey)
 {
     if (categoryKey.IsEmpty)
     {
         return(UrlOverview(month));
     }
     else
     {
         return($"/{month.Year}/{month.Month}/overview/{categoryKey.AsGuidKey().Guid}");
     }
 }
Esempio n. 4
0
        public async Task PinOutcomeCreate(IKey categoryKey, string categoryName, Color?backgroundColor)
        {
            if (SecondaryTile.Exists(OutcomeCreateFormat))
            {
                return;
            }

            string guid = null;

            if (!categoryKey.IsEmpty)
            {
                guid = categoryKey.AsGuidKey().Guid.ToString();
            }

            string tileId = String.Format(OutcomeCreateFormat, guid ?? "Empty");

            string displayName = "Create Outcome";

            if (!categoryKey.IsEmpty)
            {
                displayName += $" in '{categoryName}'";
            }

            SecondaryTile tile = new SecondaryTile(
                tileId,
                displayName,
                "OutcomeCreate" + (!categoryKey.IsEmpty ? "&CategoryKey=" + guid : String.Empty),
                new Uri("ms-appx:///Assets/Square150x150Logo.scale-200.png"),
                TileSize.Square150x150
                );

            tile.VisualElements.Square71x71Logo             = new Uri("ms-appx:///Assets/Square71x71Logo.scale-200.png");
            tile.VisualElements.Square150x150Logo           = new Uri("ms-appx:///Assets/Square150x150Logo.scale-200.png");
            tile.VisualElements.ShowNameOnSquare150x150Logo = true;
            tile.RoamingEnabled = false;

            if (backgroundColor != null)
            {
                tile.VisualElements.BackgroundColor = ColorConverter.Map(backgroundColor.Value);
            }

            await tile.RequestCreateAsync();
        }
Esempio n. 5
0
 public string UrlTrends(YearModel year, IKey categoryKey)
 => $"/{year.Year}/trends/{categoryKey.AsGuidKey().Guid}";
Esempio n. 6
0
 public string UrlTrends(IKey categoryKey)
 => $"/trends/{categoryKey.AsGuidKey().Guid}";