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); }
public string UrlOverview(YearModel year, IKey categoryKey) { if (categoryKey.IsEmpty) { return(UrlOverview(year)); } else { return($"/{year.Year}/overview/{categoryKey.AsGuidKey().Guid}"); } }
public string UrlOverview(MonthModel month, IKey categoryKey) { if (categoryKey.IsEmpty) { return(UrlOverview(month)); } else { return($"/{month.Year}/{month.Month}/overview/{categoryKey.AsGuidKey().Guid}"); } }
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(); }
public string UrlTrends(YearModel year, IKey categoryKey) => $"/{year.Year}/trends/{categoryKey.AsGuidKey().Guid}";
public string UrlTrends(IKey categoryKey) => $"/trends/{categoryKey.AsGuidKey().Guid}";