예제 #1
0
        public void ProcessingComplete(BookingContext booking, ProcessingResult result)
        {
            switch (result)
            {
            case ProcessingResult.Sucess:
                booking.TransitionToState(new BookedState());
                break;

            case ProcessingResult.Fail:
                booking.View.ShowProcessingError();
                booking.TransitionToState(new NewState());
                break;

            case ProcessingResult.Cancel:
                booking.TransitionToState(new ClosedState("Processing Canceled"));
                break;
            }
        }
예제 #2
0
 public override void DatePassed(BookingContext booking)
 {
     booking.TransitionToState(new ClosedState("We hope you enjoyed the event!"));
 }
예제 #3
0
 public override void EnterDetails(BookingContext booking, string attendee, int ticketCount)
 {
     booking.Attendee    = attendee;
     booking.TicketCount = ticketCount;
     booking.TransitionToState(new PendingState());
 }
예제 #4
0
 public override void Cancel(BookingContext booking)
 {
     booking.TransitionToState(new ClosedState("Booking canceled: Expect a refund"));
 }
예제 #5
0
 public override void DatePassed(BookingContext booking)
 {
     booking.TransitionToState(new ClosedState("Booking Expired"));
 }