private void btnPicked_Click(object sender, EventArgs e)
        {
            Order orderToUpdate = GvOperations.GetSelectedOrder(gvDishCollection);

            GvOperations.UpdateOrder(orderToUpdate, OrderStatus.Picked, gvDishCollection);
            //TODO: Send information to server
        }
        private void btnSend_Click(object sender, EventArgs e)
        {
            Order orderToSend = GvOperations.GetSelectedOrder(gvOrders);

            //Solution when we are going to send dishes independently
            //foreach (Dish dish in orderToSend.Dishes)
            //{
            //    if (dish.Status != OrderStatus.NotSend)
            //    {
            //        continue;
            //    }

            //    if (dish.Type == OrderDestination.Bar)
            //    {
            //        SendDishToBar();
            //    }
            //    else if (dish.Type == OrderDestination.Kitchen)
            //    {
            //        SendDishToKitchen();
            //    }
            //    UpdateOrder(orderToSend, OrderStatus.Sended);
            //}
            if (orderToSend.Destination == OrderDestination.Bar)
            {
                SendOrderToBar();
            }
            else if (orderToSend.Destination == OrderDestination.Kitchen)
            {
                SendOrderToKitchen();
            }
            GvOperations.UpdateOrder(orderToSend, OrderStatus.Sended, gvOrders);
        }
コード例 #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Order selectedOrder = GvOperations.GetSelectedOrder(gvOrders);

            if (selectedOrder != null)
            {
                EditOrder editOrderForm = new EditOrder(selectedOrder);
                editOrderForm.ShowDialog();
            }
        }
コード例 #4
0
        private void btnChangeStatus_Click(object sender, EventArgs e)
        {
            Order        currentOrder     = GvOperations.GetSelectedOrder(gvOrders);
            ChangeStatus changeStatusForm = new ChangeStatus(currentOrder.Status);

            changeStatusForm.ShowDialog();
            OrderStatus newStatus = changeStatusForm.GetOrderStatus();

            GvOperations.UpdateOrder(currentOrder, newStatus, gvOrders);
        }
        private void btnInPreparation_Click(object sender, EventArgs e)
        {
            Order orderToUpdate = GvOperations.GetSelectedOrder(gvDishCollection);

            GvOperations.UpdateOrder(orderToUpdate, OrderStatus.Preparation, gvDishCollection);
            ShowDishes dishesForm = new ShowDishes(orderToUpdate);

            dishesForm.ShowDialog();
            GvOperations.UpdateOrder(orderToUpdate, dishesForm.CurrentStatus(), gvDishCollection);
            //TODO: Send information to server
        }
        private void EditOrderButton_Click(object sender, EventArgs e)
        {
            //TODO: Edit existing order in order form
            Order selectedOrder = GvOperations.GetSelectedOrder(gvOrders);

            if (selectedOrder != null)
            {
                EditOrder editOrderForm = new EditOrder(selectedOrder);
                editOrderForm.ShowDialog();
            }
        }
        private void btnDeliver_Click(object sender, EventArgs e)
        {
            Order orderToDeliver = GvOperations.GetSelectedOrder(gvOrders);

            if (orderToDeliver.Status == OrderStatus.ReadyToPick)
            {
                GvOperations.UpdateOrder(orderToDeliver, OrderStatus.Delivered, gvOrders);
            }
            else
            {
                MessageBox.Show("Order is not ready.");
            }
        }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     Order orderToSend = GvOperations.GetSelectedOrder(gvOrders);
     //TODO: Send order to bill printer
 }