示例#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;
            }
        }
 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());
 }
 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"));
 }