Exemple #1
0
        private void btnOrder_Click(object sender, EventArgs e)
        {
            IPayment paymentData = paymentFactory.CreatePayment(cboxPayment.SelectedIndex);
            IOrder   orderData   = orderFactory.CreateOrder(cboxOrder.SelectedIndex);

            String message = "";

            foreach (var orderItem in order)
            {
                message += orderItem.Quantity().ToString() + " x " + orderItem.ProductName() + "\n";
            }
            message += paymentData.Feedback() + "\n";
            message += orderData.Feedback() + "\n";

            MessageBox.Show(message);

            order.Clear();
            message = "";
            refresh();
            cboxOrder.SelectedIndex   = 0;
            cboxPayment.SelectedIndex = 0;
        }