예제 #1
0
        private async void LoadBottlePages()
        {
            LoadingService.ShowLoadingStatus(true);
            var bottlePages = await _stockBusinessLogic.GetHotProductPages();

            Bottles = new ObservableCollection <BottleModel>(
                from b in bottlePages
                select new BottleModel
            {
                PageId   = b.PageId,
                PageName = b.PageName
            });

            foreach (var bottle in Bottles)
            {
                bottle.BottleDetails = await LoadBottles(bottle.PageId);
            }
            LoadingService.ShowLoadingStatus(false);
        }
예제 #2
0
        private async void LoadHotCategories(LoadHotCategoriesMessage message)
        {
            LoadingService.ShowLoadingStatus(true);
            try
            {
                var hotProductPages = await _stockBussinessLogic.GetHotProductPages();

                var categories = new ObservableCollection <HotProductModel>(
                    from h in hotProductPages
                    select new HotProductModel
                {
                    PageId   = h.PageId,
                    PageName = h.PageName
                });

                HotCategories = new ObservableCollection <HotProductModel>(categories);

                // Load for First Category
                if (HotCategories.Count > 0)
                {
                    LoadHotProducts(HotCategories.FirstOrDefault().PageId);
                }
            }
            catch (UserNotAuthorizedException)
            {
                NavigateService.Instance.NavigateToLogin();
            }
            finally
            {
                OperationsCompletedInLogin++;
                if (IsSwitchUserStarted)
                {
                    OperationsCompletedInSwitchUser++;
                }
                LoadingService.ShowLoadingStatus(false);
            }
        }