Пример #1
0
        public async void LoadItems(int productId)
        {
            IsLoading = true;
            Product   = await _localDatabaseService.GetProductFromId(productId);

            Categories = _localDatabaseService.GetCategoryFromId(Product.Category01).Result.Title;
            if (Product.Category02 != null)
            {
                Categories += ", " + _localDatabaseService.GetCategoryFromId((int)Product.Category02).Result.Title;
            }
            if (Product.Category03 != null)
            {
                Categories += ", " + _localDatabaseService.GetCategoryFromId((int)Product.Category03).Result.Title;
            }
            IsFavorite   = Product.IsFavorite;
            CurrentImage = Product.Image01;
            if (Product.Image02 != null)
            {
                HasMultipleImages = true;
                if (Product.Image03 != null)
                {
                    HasThreeImages = true;
                }
            }
            IsLoading = false;
        }
Пример #2
0
        public async Task LoadRandomProduct()
        {
            RandomProduct = await _localDatabaseService.GetRandomProduct();

            RandomProductCategories = _localDatabaseService.GetCategoryFromId(RandomProduct.Category01).Result.Title;
            if (RandomProduct.Category02 != null)
            {
                RandomProductCategories += ", " + _localDatabaseService.GetCategoryFromId((int)RandomProduct.Category02).Result.Title;
            }
            if (RandomProduct.Category03 != null)
            {
                RandomProductCategories += ", " + _localDatabaseService.GetCategoryFromId((int)RandomProduct.Category03).Result.Title;
            }
        }
Пример #3
0
        public async void LoadItems(int categoryId)
        {
            IsLoading = true;
            if (categoryId == -1)
            {
                Category = new Category {
                    Title = "All"
                };
                Products = await _localDatabaseService.GetProducts(SearchName);
            }
            else
            {
                Category = await _localDatabaseService.GetCategoryFromId(categoryId);

                Products = await _localDatabaseService.GetProductsFromCategory(Category.Id, SearchName);
            }

            IsLoading = false;
        }