Beispiel #1
0
        async Task ExecuteLoadItemsCommand(DateTime target_date)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Items.Clear();
                using (var db = new MyContext())
                {
                    ///var result = db.Tra_Income.Where(x => x.Money >= 1)
                    //                            .OrderByDescending(x => x.Payment_Date)
                    //                            .OrderByDescending(x => x.Id)
                    //                            .AsEnumerable();
                    Income income = new Income(db);

                    var result = income.Get_Income_List(target_date);

                    //var items = await DataStore.GetItemsAsync(true);
                    foreach (var item in result)
                    {
                        Items.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }