Exemple #1
0
        public CatalogPage(GoodsCategory item, List <string> GoodsNameCart1, List <CartGoods> GoodsCartList1, List <int> GoodsPiece)
        {
            InitializeComponent();
            GoodsNameCart = GoodsNameCart1;
            GoodsCartList = GoodsCartList1;
            Piece         = GoodsPiece;
            AddGoodsCategory();
            AddGoodsInformation();
            AddGoodsImage();
            AddGoodsToCatalog();
            DisplayDatabase();
            GetValueForShopCartInfo(GoodsCartList);


            List <Goods>            goods1            = GoodsDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsCategory>    goodscategory1    = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsInformation> goodsinformation1 = GoodsInformationDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsImage>       goodsimage1       = GoodsImageDatabase.GetItemsNotDoneAsync().Result;

            var query = from goods in goods1
                        join goodscategory in goodscategory1 on goods.GoodsCategoryID equals goodscategory.GoodsCategoryID
                        where goodscategory.Category == item.Category
                        join goodsinformation in goodsinformation1 on goods.GoodsInformationID equals goodsinformation.GoodsInformationID
                        join goodsimage in goodsimage1 on goods.GoodsImageID equals goodsimage.ImageID
                        select new { Name = goods.Name, Price = goods.Price, Category = goodscategory.Category, Type = goodsinformation.Type, ImageName = goodsimage.ImageName };

            GoodsListview.ItemsSource = query;
        }
Exemple #2
0
        private void Search_Click(object sender, RoutedEventArgs e)
        {
            string SearchWord                         = Search.Text.ToString();
            var    queryofsearchingword               = GoodsDatabase.GetSearchWord(SearchWord).Result;
            List <GoodsCategory>    goodscategory1    = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsInformation> goodsinformation1 = GoodsInformationDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsImage>       goodsimage1       = GoodsImageDatabase.GetItemsNotDoneAsync().Result;

            var query = from goods in queryofsearchingword
                        join goodscategory in goodscategory1 on goods.GoodsCategoryID equals goodscategory.GoodsCategoryID
                        join goodsinformation in goodsinformation1 on goods.GoodsInformationID equals goodsinformation.GoodsInformationID
                        join goodsimage in goodsimage1 on goods.GoodsImageID equals goodsimage.ImageID
                        select new { Name = goods.Name, Price = goods.Price, Category = goodscategory.Category, Type = goodsinformation.Type, ImageName = goodsimage.ImageName };

            GoodsListview.ItemsSource = query;
        }
Exemple #3
0
        private void ListViewOfCategories_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ListViewOfCategories.SelectedItem != null)
            {
                var item = ListViewOfCategories.SelectedItem as GoodsCategory;


                List <Goods>            goods1            = GoodsDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsCategory>    goodscategory1    = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsInformation> goodsinformation1 = GoodsInformationDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsImage>       goodsimage1       = GoodsImageDatabase.GetItemsNotDoneAsync().Result;

                var query = from goods in goods1
                            join goodscategory in goodscategory1 on goods.GoodsCategoryID equals goodscategory.GoodsCategoryID
                            where goodscategory.Category == item.Category
                            join goodsinformation in goodsinformation1 on goods.GoodsInformationID equals goodsinformation.GoodsInformationID
                            join goodsimage in goodsimage1 on goods.GoodsImageID equals goodsimage.ImageID
                            select new { Name = goods.Name, Price = goods.Price, Category = goodscategory.Category, Type = goodsinformation.Type, ImageName = goodsimage.ImageName };

                GoodsListview.ItemsSource = query;
            }
        }
Exemple #4
0
        private void DisplayDatabase()
        {
            List <Goods>            goods1            = GoodsDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsCategory>    goodscategory1    = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsInformation> goodsinformation1 = GoodsInformationDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsImage>       goodsimage1       = GoodsImageDatabase.GetItemsNotDoneAsync().Result;

            var query = from goods in goods1
                        join goodscategory in goodscategory1 on goods.GoodsCategoryID equals goodscategory.GoodsCategoryID
                        join goodsinformation in goodsinformation1 on goods.GoodsInformationID equals goodsinformation.GoodsInformationID
                        join goodsimage in goodsimage1 on goods.GoodsImageID equals goodsimage.ImageID
                        select new { Name = goods.Name, Price = goods.Price, Category = goodscategory.Category, Type = goodsinformation.Type, ImageName = goodsimage.ImageName };

            var queryofcategories = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;

            Debug.WriteLine(goods1.Count);
            foreach (Goods Item in goods1)
            {
                Debug.WriteLine(Item);
            }
            GoodsListview.ItemsSource        = query;
            ListViewOfCategories.ItemsSource = queryofcategories;
        }
Exemple #5
0
        public void GetJoinedDatatable(string selectedtext)
        {
            List <Goods> goods1 = new List <Goods>();

            if (selectedtext.Equals("dle nazvu"))
            {
                goods1 = GoodsDatabase.GetGoodsByName().Result;
            }
            else if (selectedtext.Equals("od nejlevnejsiho"))
            {
                goods1 = GoodsDatabase.GetGoodsByLowestPrice().Result;
            }
            else if (selectedtext.Equals("od nejdrazsiho"))
            {
                goods1 = GoodsDatabase.GetGoodsByHighestPrice().Result;
            }

            List <GoodsCategory>    goodscategory1    = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsInformation> goodsinformation1 = GoodsInformationDatabase.GetItemsNotDoneAsync().Result;
            List <GoodsImage>       goodsimage1       = GoodsImageDatabase.GetItemsNotDoneAsync().Result;

            var query = from goods in goods1
                        join goodscategory in goodscategory1 on goods.GoodsCategoryID equals goodscategory.GoodsCategoryID
                        join goodsinformation in goodsinformation1 on goods.GoodsInformationID equals goodsinformation.GoodsInformationID
                        join goodsimage in goodsimage1 on goods.GoodsImageID equals goodsimage.ImageID
                        select new { Name = goods.Name, Price = goods.Price, Category = goodscategory.Category, Type = goodsinformation.Type, ImageName = goodsimage.ImageName };

            var queryofcategories = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;

            Debug.WriteLine(goods1.Count);
            foreach (Goods Item in goods1)
            {
                Debug.WriteLine(Item);
            }
            GoodsListview.ItemsSource        = query;
            ListViewOfCategories.ItemsSource = queryofcategories;
        }
Exemple #6
0
        private void OrderBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string value = OrderBox.SelectedItem.ToString();

            ComboBoxItem cbi          = (ComboBoxItem)OrderBox.SelectedItem;
            string       selectedText = cbi.Content.ToString();

            if (selectedText.Equals("neseřazeno"))
            {
            }

            if (selectedText.Equals("dle nazvu"))
            {
                GetJoinedDatatable(selectedText);
            }

            if (selectedText.Equals("od nejlevnejsiho"))
            {
                GetJoinedDatatable(selectedText);
            }

            if (selectedText.Equals("od nejdrazsiho"))
            {
                GetJoinedDatatable(selectedText);
            }

            if (selectedText.Equals("od nejnovejsiho"))
            {
                List <Goods>            goods1            = GoodsDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsCategory>    goodscategory1    = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsInformation> goodsinformation1 = GoodsInformationDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsImage>       goodsimage1       = GoodsImageDatabase.GetItemsNotDoneAsync().Result;

                var query = from goods in goods1
                            join goodscategory in goodscategory1 on goods.GoodsCategoryID equals goodscategory.GoodsCategoryID
                            join goodsinformation in goodsinformation1 on goods.GoodsInformationID equals goodsinformation.GoodsInformationID
                            join goodsimage in goodsimage1 on goods.GoodsImageID equals goodsimage.ImageID
                            orderby goodsinformation.YearOfRealising descending
                            select new { Name = goods.Name, Price = goods.Price, Category = goodscategory.Category, Type = goodsinformation.Type, ImageName = goodsimage.ImageName };

                var queryofcategories = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;

                Debug.WriteLine(goods1.Count);
                foreach (Goods Item in goods1)
                {
                    Debug.WriteLine(Item);
                }
                GoodsListview.ItemsSource        = query;
                ListViewOfCategories.ItemsSource = queryofcategories;
            }

            if (selectedText.Equals("od nejstarsiho"))
            {
                List <Goods>            goods1            = GoodsDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsCategory>    goodscategory1    = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsInformation> goodsinformation1 = GoodsInformationDatabase.GetItemsNotDoneAsync().Result;
                List <GoodsImage>       goodsimage1       = GoodsImageDatabase.GetItemsNotDoneAsync().Result;

                var query = from goods in goods1
                            join goodscategory in goodscategory1 on goods.GoodsCategoryID equals goodscategory.GoodsCategoryID
                            join goodsinformation in goodsinformation1 on goods.GoodsInformationID equals goodsinformation.GoodsInformationID
                            join goodsimage in goodsimage1 on goods.GoodsImageID equals goodsimage.ImageID
                            orderby goodsinformation.YearOfRealising
                            select new { Name = goods.Name, Price = goods.Price, Category = goodscategory.Category, Type = goodsinformation.Type, ImageName = goodsimage.ImageName };

                var queryofcategories = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;

                Debug.WriteLine(goods1.Count);
                foreach (Goods Item in goods1)
                {
                    Debug.WriteLine(Item);
                }
                GoodsListview.ItemsSource        = query;
                ListViewOfCategories.ItemsSource = queryofcategories;
            }
        }