Example #1
0
        public void GenerateData()
        {
            MyCategory c1 = new MyCategory(1, "Shoes");
            MyCategory c2 = new MyCategory(2, "Coats");
            MyCategory c3 = new MyCategory(3, "Dresses");

            MyCategories.Add(c1);
            MyCategories.Add(c2);
            MyCategories.Add(c3);

            MyVendor v1 = new MyVendor(1, "Clothing Company", "Los Angeles");
            MyVendor v2 = new MyVendor(2, "Shoes Factory", "Warsaw");
            MyVendor v3 = new MyVendor(3, "Great Shoes Inc.", "Pabianice");
            MyVendor v4 = new MyVendor(4, "Bridal Dresses", "New York");

            MyVendors.Add(v1);
            MyVendors.Add(v2);
            MyVendors.Add(v3);
            MyVendors.Add(v4);

            MyProduct p1 = new MyProduct(1, "Pretty Coat", "Brown", new decimal(199.99), c2, v1);
            MyProduct p2 = new MyProduct(2, "Coat", "Black", new decimal(199.99), c2, v1);
            MyProduct p3 = new MyProduct(3, "High Heels", "Brown", new decimal(259.99), c1, v2);
            MyProduct p4 = new MyProduct(4, "Sneakers", "White", new decimal(99.90), c1, v3);
            MyProduct p5 = new MyProduct(5, "High Boots", "Beige", new decimal(179.99), c1, v2);
            MyProduct p6 = new MyProduct(6, "Pretty White Dress", "White", new decimal(1999.99), c3, v4);
            MyProduct p7 = new MyProduct(7, "Bridal Dress", "White", new decimal(2500), c3, v4);
            MyProduct p8 = new MyProduct(8, "Pretty Dress", "Pink", new decimal(219.99), c3, v1);

            MyProducts.Add(p1);
            MyProducts.Add(p2);
            MyProducts.Add(p3);
            MyProducts.Add(p4);
            MyProducts.Add(p5);
            MyProducts.Add(p6);
            MyProducts.Add(p7);
            MyProducts.Add(p8);
        }
        public void Init()
        {
            //MyCategories.Clear();
            var fooMyCategory = new MyCategory
            {
                CategoryName = "Category1",
                顯示           = false,
            };

            fooMyCategory.MyItems.Add(new MyItem {
                Name = "1 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "m1 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "tem1 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "Item1 4"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem1 5"
            });
            MyCategories.Add(fooMyCategory);


            fooMyCategory = new MyCategory
            {
                CategoryName = "Category3",
                顯示           = false,
            };
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem3 1"
            });
            MyCategories.Add(fooMyCategory);

            fooMyCategory = new MyCategory
            {
                CategoryName = "Category2",
                顯示           = false,
            };
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem2 3"
            });
            MyCategories.Add(fooMyCategory);

            fooMyCategory = new MyCategory
            {
                CategoryName = "Category4",
                顯示           = false,
            };
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "C4 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4CItem 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4CI 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4CIt 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4CItem4 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "4 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4CItem4CItem4 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem4 2"
            });
            MyCategories.Add(fooMyCategory);

            fooMyCategory = new MyCategory
            {
                CategoryName = "Category5",
                顯示           = false,
            };
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem5 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem5 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem5 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem5 1"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem5 2"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem5 3"
            });
            fooMyCategory.MyItems.Add(new MyItem {
                Name = "CItem5 1"
            });
            MyCategories.Add(fooMyCategory);
        }