Exemplo n.º 1
0
        private void buttonPlaceOrder_Click(object sender, EventArgs e)
        {
            // Get data from UI and calculations
            orderBLL.productID  = 1;
            orderBLL.totalPrice = total;
            orderBLL.quantity   = totalQuantity;


            // Insert data into database
            bool success = orderDAL.Insert(orderBLL);

            // If successful then value is true, else false
            if (success == true)
            {
                // Data successfully inserted
                MessageBox.Show("Order Placed successfully");
            }
            else
            {
                // Data failed to be inserted
                MessageBox.Show("Order Failed");
            }

            OrderSummary orderSummary = new OrderSummary();

            orderSummary.Show();
            this.Hide();
        }
Exemplo n.º 2
0
 private void OnPayAndCloseOrder(object parameter)
 {
     try
     {
         MainScreen.Order.SubmitOrder();
         List <string> lines        = MainScreen.Order.ToPlainText();
         OrderSummary  orderSummary = new OrderSummary(MainScreen.Order, MainScreen.User);
         orderSummary.Show();
         MainScreen.Order = new Order(MainScreen.User.user_id);
         LoadOrder(MainScreen.Order);
     }
     catch (Exception e)
     {
         Console.WriteLine("{0} Exception caught.", e);
     }
 }