示例#1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Order        newOrder        = new Order();
            OrderDetails newOrderDetails = new OrderDetails();

            newOrder.AddDetails(newOrderDetails);
            FormAdd formAdd = new FormAdd(newOrder, newOrderDetails);

            formAdd.Show();
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FormAdd formAdd = (FormAdd)this.Owner;

            formAdd.Show();
            textBoxID.DataBindings.Add("Text", OrderDetailBindingSource, "OrderID");
            cbBoxMerchant.DataBindings.Add("SelectedItem", OrderDetailBindingSource, "Mechant");
            cbBoxCustomer.DataBindings.Add("SelectedItem", OrderDetailBindingSource, "Customer");
            orderModified.OrderDetails.Add(orderDetails);
            OrderBindingSource.ResetBindings(false);
            OrderDetailBindingSource.ResetBindings(false);
        }