public void Prepare() { if (CurrentState == null) { CurrentState = new Preparing(); } }
private void DefineNextState(IInvoiceState NextState) { if (NextState.LastAcceptableState.GetType().Equals(CurrentState.GetType())) { CurrentState = NextState; } else { throw new Exception("problem with workflow in kitchen"); } }
private InvoiceStatus MaptoStateEntity(IInvoiceState status) { if (status is OpenState) { return(InvoiceStatus.Open); } else if (status is CloseState) { return(InvoiceStatus.Close); } else if (status is PayState) { return(InvoiceStatus.Pay); } return(InvoiceStatus.Open); }
public void UpdateState(IInvoiceState state) => _state = state;
public Invoice(ICollection <InvoicePosition> itemList) { ItemList = itemList; _state = new NewState(this); }