Exemplo n.º 1
0
        public void AddOrder(ICustomer customer, Meal meal)
        {
            if (meal is Pizza && meal.Count > 1)
            {
                customer.AddOrder(new Soup {
                    Count = 1, SpType = SoupType.Ezo, Price = 0
                });
            }

            customer.AddOrder(meal);
        }
Exemplo n.º 2
0
 private void AddOrderButton_Click(object sender, EventArgs e)
 {
     try
     {
         OrderDTO order = new OrderDTO
         {
             ShipperIDKEY  = Convert.ToInt32(ShipperIDOrderBox.Text),
             CustomerIDKEY = _customerID,
             Comment       = CommentBox.Text,
             Date          = DateTime.Now,
         };
         _customer.AddOrder(order);
         var pos = new newPositionForm(_customer, order.OrderID);
         pos.Show();
         this.Hide();
     }
     catch
     {
         MessageBox.Show("Invalid data");
     }
 }