コード例 #1
0
 public OrderControl()
 {
     InitializeComponent();
     CurrentOrder     = new Order(new Customer());
     OrderSummaryView = new OrderSummaryControl();
     // Binding data of Temporary Order To OrderSummaryControl
     BindingOrderDataToOrderView(CurrentOrder, OrderSummaryView);
     ScanProduct += ScanItem;
 }
コード例 #2
0
        //binding ordersummary
        private void BindingOrderDataToOrderView(Order orderData, OrderSummaryControl orderUI)
        {
            Binding bindingOrderSubTotal = new Binding("SubTotal", orderData, "SubTotal", true, DataSourceUpdateMode.OnPropertyChanged);

            orderUI.DataBindings.Add(bindingOrderSubTotal);

            Binding bindingOrderTax = new Binding("Tax", orderData, "Tax", true, DataSourceUpdateMode.OnPropertyChanged);

            orderUI.DataBindings.Add(bindingOrderTax);

            Binding bindingOrderDiscount = new Binding("Discount", orderData, "Discount", true, DataSourceUpdateMode.OnPropertyChanged);

            orderUI.DataBindings.Add(bindingOrderDiscount);

            Binding bindingOrderTotal = new Binding("Total", orderData, "Total", true, DataSourceUpdateMode.OnPropertyChanged);

            orderUI.DataBindings.Add(bindingOrderTotal);
        }