Esempio n. 1
0
        private async void LoadData()
        {
            IList <Product> goods = await FilterByCategories();

            _categories = Mapper.Map <IList <Category>, IList <WpTerms> >(await _categoryService.GetAllAsync());

            lbCategories.ItemsSource = _categories;

            var orders = await _servicesForWindow.GetOrders();

            AllOrdersTable.ItemsSource = orders;

            try
            {
                Statistics statistics = new Statistics()
                {
                    AllOrdersCount       = orders.Count,
                    AllProductsCount     = goods.Count,
                    LastOrderMadeDate    = orders.Max(x => x.PostDate),
                    LastProductMadeDate  = goods.Max(x => x.PostDate),
                    DeletedProductsCount = goods.Count(x => x.PostStatus == "publish"),
                    DeletedOrdersCount   = orders.Count(x => x.PostStatus == "publish"),
                };

                gbStatistics.DataContext = statistics;
            }
            catch { }
        }
Esempio n. 2
0
 private async void LoadData()
 {
     AllOrdersTable.ItemsSource = await _servicesForWindow.GetOrders();
 }