示例#1
0
 public Order(string product, Supplier supplier, int volume, Customer customer)
 {
     this.Product = product;
     this.Supplier = supplier;
     this.Volume = volume;
     this.Customer = customer;
 }
示例#2
0
        public void Initialise()
        {
            Supplier ms = new Supplier("Microsoft", "Redmond");
            Supplier google = new Supplier("Google", "Mountain View");
            Supplier mcDonalds = new Supplier("McDonald's", "Everywhere");
            Supplier ibm = new Supplier("IBM", "Everywhere");
            Customer jack = new Customer("A. Name", "Cambridge");
            Customer david = new Customer("D. Bindings", "Haskelsinki");
            Customer james = new Customer("Joe Coder", "Cambridge");
            Customer brenda = new Customer("Brenda", "Aberdeen");
            Customer morag = new Customer("Morag", "Aberdeen");
            Customer will = new Customer("Mister Newname", "Glasgow");

            Orders = new ObservableCollection<Order> {
                new Order("VS2012", ms, 57, jack),
                new Order("Happy meal", mcDonalds, 1, morag),
                new Order("Google car", google, 3, james),
                new Order("MS Word", ms, 5, david),
                new Order("Nexus 7", google, 1, brenda),
                new Order("Server", ibm, 50, will)
            };
        }