Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OrderList.OrderService service = new OrderList.OrderService();
            uint   i    = Convert.ToUInt32(textBox1.Text);
            uint   Id   = Convert.ToUInt32(textBox3.Text);
            String name = textBox2.Text;

            OrderList.Customer customer = new OrderList.Customer(Id, name);
            service.UpdateCustomer(i, customer);
            DialogResult result = MessageBox.Show("订单修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
Exemplo n.º 2
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);
 }