Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     OrderList.Order       order    = new OrderList.Order();
     OrderList.Goods       good     = new OrderList.Goods();
     OrderList.OrderDetail detail   = new OrderList.OrderDetail();
     OrderList.Customer    customer = new OrderList.Customer();
     customer.Name   = customerName;
     customer.Id     = customerId;
     good.Name       = goodsName;
     good.Id         = goodsId;
     good.Price      = price;
     detail.Quantity = quantity;
     detail.Goods    = good;
     order.AddDetails(detail);
     order.Customer = customer;
     order.Id       = i;
     OrderList.OrderService service = new OrderList.OrderService();
     service.AddOrder(order);
     i++;
     DialogResult result = MessageBox.Show("订单添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
 }