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!")); }
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")); }
public override void DatePassed(BookingContext booking) { booking.TransitionToState(new ClosedState("Booking Expired")); }