public DbRepository() { Context = new Context(); users = Context.Users.ToList(); historyItems = Context.TotalHistory.ToList(); userBudgets = Context.UserBudgets.ToList(); var repo = new RepositoryJson(); categories = repo.categories; }
public List <Category> SelectOnlyExpenseCategories() { var repo = new RepositoryJson(); List <Category> some = new List <Category>(); for (int i = 0; i < 7; i++) { some.Add(repo.categories[i]); } return(some); }
public void UpdateHistory() { _repo.historyItems = _repo.Context.TotalHistory.ToList(); var json = new RepositoryJson(); foreach (var historyItem in _repo.historyItems) { if (historyItem.Category == null) { historyItem.Category = json.categories.FirstOrDefault(cat => cat.Id == historyItem.CategoryId); } } }