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); }
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 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."); } }