Beispiel #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;
        }
Beispiel #2
0
        public DetailPage(Goods selectedgoods, List <string> GoodsNameFromCart, List <CartGoods> GoodsFromCart, List <int> PieceList1)
        {
            InitializeComponent();
            GoodsName     = GoodsNameFromCart;
            GoodsCartList = GoodsFromCart;
            PieceList     = PieceList1;
            GetValueForShopCartInfo(GoodsCartList);
            List <Goods> goods1 = GoodsDatabase.GetItemsNotDoneAsync().Result;


            Goods goods = new Goods();

            for (int i = 0; i < goods1.Count; i++)
            {
                if (selectedgoods.Name.Equals(goods1[i].Name))
                {
                    goods = goods1[i];
                }
            }
            var category          = GoodsCategoryDatabase.GetItemAsync(goods.GoodsCategoryID).Result;
            var information       = GoodsInformationDatabase.GetItemAsync(goods.GoodsInformationID).Result;
            var queryofcatefories = GoodsCategoryDatabase.GetItemsNotDoneAsync().Result;
            var queryofimage      = GoodsImageDatabase.GetItemAsync(goods.GoodsImageID).Result;

            ListViewOfCategories.ItemsSource = queryofcatefories;
            Name.Text            = goods.Name;
            YearOfRealising.Text = information.YearOfRealising.ToString();
            Category.Text        = category.Category;
            Type.Text            = information.Type.ToString();
            Price.Text           = goods.Price.ToString() + " Kc";
            Buy_Button.Tag       = goods.Name;
            Description.Text     = information.Description.ToString();

            ImageOfAlbum.Source = new BitmapImage(new Uri($"{queryofimage.ImageName}", UriKind.Relative));
        }
Beispiel #3
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;
        }
Beispiel #4
0
        public void AddGoodsInformation()
        {
            //DisplayDatabase();
            int[]    Year        = new int[] { 1999, 2000, 2001, 2001, 2002, 2003, 2002, 2005 };
            string[] Type        = new string[] { "CD", "CD", "CD+DVD", "CD+LP", "CD", "CD", "CD+DVD audio", "CD+Blu-ray" };
            string[] Description = new string[] { "Cras pede libero, dapibus nec, pretium sit amet, tempor quis. Nulla non lectus sed nisl molestie malesuada. Quisque tincidunt scelerisque libero.", "Phasellus rhoncus. Quisque tincidunt scelerisque libero. Fusce dui leo, imperdiet in, aliquam sit amet, feugiat eu, orci. Nullam at arcu a est sollicitudin euismod.", "Etiam ligula pede, sagittis quis, interdum ultricies, scelerisque eu. Aenean fermentum risus id tortor. ", "Integer tempor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam dui sem, fermentum vitae, sagittis id, malesuada in, quam. Aenean vel massa quis mauris vehicula lacinia. Etiam posuere lacus quis dolor.", "Integer tempor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam dui sem, fermentum vitae, sagittis id, malesuada in, quam. Aenean vel massa quis mauris vehicula lacinia. Etiam posuere lacus quis dolor.", "Nulla non arcu lacinia neque faucibus fringilla. Duis sapien nunc, commodo et, interdum suscipit, sollicitudin et, dolor. Fusce wisi.", "Proin mattis lacinia justo. Et harum quidem rerum facilis est et expedita distinctio. Sed vel lectus. Donec odio tempus molestie, porttitor ut, iaculis quis, sem.", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce dui leo, imperdiet in, aliquam sit amet, feugiat eu, orci. Nullam at arcu a est sollicitudin euismod. Nunc auctor. Aliquam erat volutpat. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?" };

            for (int i = 0; i < Year.Length; i++)
            {
                GoodsInformation information = new GoodsInformation();
                information.YearOfRealising = Year[i];
                information.Type            = Type[i];
                information.Description     = Description[i];

                GoodsInformationDatabase.SaveItemAsync(information);
            }
        }
Beispiel #5
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;
            }
        }
Beispiel #6
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;
        }
Beispiel #7
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;
        }
Beispiel #8
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;
            }
        }