Example #1
0
        private void CheckButton_Click(object sender, EventArgs e)
        {
            if (OrdersListBox.SelectedIndex == -1)
            {
                return;
            }

            var index = OrdersListBox.SelectedIndex;
            var order = Orders[index];

            var checkOrderForm = new CheckOrderForm {
                Order = order
            };

            checkOrderForm.ShowDialog();
        }
Example #2
0
        private void CheckoutButton_Click(object sender, EventArgs e)
        {
            if (ClientListBox.SelectedIndex == -1 && Order.State)
            {
                return;
            }

            Order.Client = CustomerList[ClientListBox.SelectedIndex];
            orderRep.SetTotal(Order);
            orderRep.Create(Order);

            var newOrderDialog = new CheckOrderForm {
                Order = Order
            };

            newOrderDialog.ShowDialog();
        }