private void VerifyCurrentOrderExists(Customer currentCustomer) { if (currentCustomer.getOrder() == null) { throw new InvalidOperationException("Order not started"); } }
public void StartNewOrder(Customer customer) { if (customer.getOrder() != null) { throw new InvalidOperationException("Cannot start a new order while another is still in progress"); } customer.Order = new Order(currentStock); }