Exemple #1
0
 public void Prepare()
 {
     if (CurrentState == null)
     {
         CurrentState = new Preparing();
     }
 }
Exemple #2
0
 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);
 }
Exemple #4
0
 public void UpdateState(IInvoiceState state) => _state = state;
Exemple #5
0
 public Invoice(ICollection <InvoicePosition> itemList)
 {
     ItemList = itemList;
     _state   = new NewState(this);
 }