Esempio n. 1
0
        //Daten in ListView loaded
        private async Task DatenLoaded()
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            ObservableCollection <ListBalance> listBalance = new ObservableCollection <ListBalance>();

            listBalance = await ListBalance.GetBalanceListeAsync(ListViewDaten, datum.Monat, datum.Year);

            var listView = new ListView();

            if (listBalance.Count == 0)
            {
                ListViewItem listItem = GetNotDaten();

                listView.IsItemClickEnabled = false;
                listView.Items.Add(listItem);
                gridListView.Children.Add(listView);
                BalanceListView.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
            }
            else
            {
                //zeigt auf verschiedene Sprachen Cost und Incomen
                if (ListViewDaten == CategoryCostIncomen.Cost)
                {
                    TxtCostsIncomen.Text        = loader.GetString("TxtCostsHome");
                    BalanceListView.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
                }
                else
                {
                    TxtCostsIncomen.Text        = loader.GetString("TxtIncomesHome");
                    BalanceListView.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
                }
            }
        }
        //Daten in ListView loaded
        private async Task DatenLoaded()
        {
            ObservableCollection <ListBalance> listBalance = new ObservableCollection <ListBalance>();

            listBalance = await ListBalance.GetBalanceListeAsync(datePicker.Date.Date);

            BalanceListView.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
        }
Esempio n. 3
0
        private async Task GetDatenAsync(string category, Grid gridCategory, ListView listViewCategory)
        {
            listBalance = new ObservableCollection <ListBalance>();
            var listView = new ListView();

            //If zweit Daten asgewahlt
            if ((bool)index.GetDatumBereich())
            {
                listBalance = await ListBalance.GetBalanceListeAsync(index.GetErsteDatum(), index.GetZweiteDatum(), category);

                if (listBalance.Count == 0)
                {
                    ListViewItem listItem = GetNotDaten();

                    listView.IsItemClickEnabled = false;
                    listView.Items.Add(listItem);
                    gridCategory.Children.Add(listView);
                    listViewCategory.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
                }
                else
                {
                    listViewCategory.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
                }
            }
            //if nur eine Date ausgewahlt
            else
            {
                listBalance = await ListBalance.GetBalanceListeAsync(index.GetErsteDatum(), index.GetZweiteDatum(), category);

                if (listBalance.Count == 0)
                {
                    ListViewItem listItem = GetNotDaten();

                    listView.IsItemClickEnabled = false;
                    listView.Items.Add(listItem);
                    gridCategory.Children.Add(listView);
                    listViewCategory.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
                }
                else
                {
                    listViewCategory.ItemsSource = listBalance.OrderBy(item => item.Datum.TimeOfDay);
                }
            }
        }