Ngày tải lên :
29/03/2014, 14:20
... code:
IdProduct: 46 -Price: 100 0
IdProduct:27-Price: 200 0
IdProduct: 14 -Price: 500
IdProduct:11-Price:3 50
IdProduct: 46 -Price: 100 0
This result might seem unexpected because the rst and the last rows appear to be identical. ... relationships
publicclassCustomer{
publicstringName;
publicstringCity;
publicOrder[]Orders;
}
publicstructOrder{
publicintQuantity;
publicProductProduct;
publicCustomerCustomer;
}
publicclassProduct{
publicintIdProduct;
publicdecimalPrice;
publicstringProductName;
publicOrder[]Orders;
}
Let’s ...
customers=NewCustomer(){
NewCustomerWith{.Name="Paolo",.City="Brescia",
.Country=Countries.Italy,.Orders=NewOrder(){
NewOrderWith{.IdOrder=1,.Quantity=3,.IdProduct=1,
.Shipped=False,.Month="January"},
NewOrderWith{.IdOrder=2,.Quantity=5,.IdProduct=2,
.Shipped=True,.Month="May"}}},
NewCustomerWith{.Name="Marco",.City="Torino",
.Country=Countries.Italy,.Orders=NewOrder(){
NewOrderWith{.IdOrder=3,.Quantity= 10, .IdProduct=1,
.Shipped=False,.Month="July"},
NewOrderWith{.IdOrder= 4, .Quantity= 20, .IdProduct=3,
.Shipped=True,.Month="December"}}},
NewCustomerWith{.Name="James",.City="Dallas",
.Country=Countries.USA,.Orders=NewOrder(){
NewOrderWith{.IdOrder=5,.Quantity= 20, .IdProduct=3,
.Shipped=True,.Month="December"}}},
NewCustomerWith{.Name="Frank",.City="Seattle",
.Country=Countries.USA,.Orders=NewOrder(){
NewOrderWith{.IdOrder=6,.Quantity= 20, .IdProduct=5,
.Shipped=False,.Month="July"}}}}
products=NewProduct(){
NewProductWith{.IdProduct=1,.Price= 10} ,
NewProductWith{.IdProduct=2,.Price= 20} ,
NewProductWith{.IdProduct=3,.Price= 30} ,
NewProductWith{.IdProduct= 4, .Price= 40 },
NewProductWith{.IdProduct=5,.Price= 50} ,
NewProductWith{.IdProduct=6,.Price= 60} }
www.it-ebooks.info
...