Пример #1
0
        // 调用事件函数

        public void OnDataChange(object sender, CreateOrderEventArgs args)
        {
            if (CreateOrder != null)
            {
                CreateOrder(this, args);
            }
        }
Пример #2
0
        public void CreateOrder(object sender, CreateOrderEventArgs args)
        {
            Order order = new Order(args.ID, args.Customer, args.Items);

            // 更新窗体控件
            if (orders.Contains(order))
            {
                MessageBox.Show($"Add Order Error: Order with id {order.OrderId} already exists!");
            }
            os.AddOrder(order);
        }