private void SetCategoryCount() { //declating container vars float foodcount = 0; float clothescount = 0; float utilitiescount = 0; float misccount = 0; //setting vars foreach (var item in SQLiteDataAccess.GetItems()) { if (item.Category == Categories.Food) { foodcount += item.ItemPrice; } if (item.Category == Categories.clothes) { clothescount += item.ItemPrice; } if (item.Category == Categories.Utilities) { utilitiescount += item.ItemPrice; } if (item.Category == Categories.Misc) { misccount += item.ItemPrice; } } //sending to forms FoodCount_Label.Content = $"Food:{foodcount} TND"; UtilitiesCount_Label.Content = $"Utilities:{utilitiescount} TND"; ClothesCount_Label.Content = $"Clothes:{clothescount} TND"; MiscCount_Label.Content = $"Misc:{misccount} TND"; }
private void RefreshHistoryDataGrid() { history.Items_DataGrid.ItemsSource = items = SQLiteDataAccess.GetItems(); }