public CustomerList()
        {
            _customers = new ObservableCollection<Customer>();

            // Insert customer and corresponding order information into
            Customer c = new Customer() { ID = 1, Name = "Customer1" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "Shanghai" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 2, 1), ShipCity = "Beijing" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "Guangzhou" });
            _customers.Add(c);

            c = new Customer() { ID = 2, Name = "Customer2" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "New York" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 2, 1), ShipCity = "Seattle" });
            _customers.Add(c);

            c = new Customer() { ID = 3, Name = "Customer3" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "Xiamen" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 2, 1), ShipCity = "Shenzhen" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "Tianjin" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "Wuhan" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "Jinan" });
            _customers.Add(c);

            c = new Customer() { ID = 4, Name = "Customer4" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "Lanzhou" });
            _customers.Add(c);
        }
Exemple #2
0
        public CustomerList()
        {
            _customers = new ObservableCollection<Customer>();

            // 插入客户及相关信息
            Customer c = new Customer() { ID = 1, Name = "客户1" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "上海" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 2, 1), ShipCity = "北京" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "广州" });
            _customers.Add(c);

            c = new Customer() { ID = 2, Name = "客户2" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "纽约" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 2, 1), ShipCity = "西雅图" });
            _customers.Add(c);

            c = new Customer() { ID = 3, Name = "客户3" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "厦门" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 2, 1), ShipCity = "深圳" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "天津" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "武汉" });
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 11, 10), ShipCity = "济南" });
            _customers.Add(c);

            c = new Customer() { ID = 4, Name = "客户4" };
            c.Orders.Add(new Order() { ID = 1, Date = new DateTime(2009, 1, 1), ShipCity = "兰州" });
            _customers.Add(c);
        }