Esempio n. 1
0
        public void ProcessingComplete(BookingContext booking, ProcessingResult result)
        {
            switch (result)
            {
            case ProcessingResult.Success:
                booking.TransitionToState(new BookedState());
                break;

            case ProcessingResult.Fail:
                booking.View.ShowError("Error processing booking");
                booking.TransitionToState(new NewState());
                break;

            case ProcessingResult.Cancel:
                booking.TransitionToState(new ClosedState("Processing Canceled"));
                break;
            }
        }
Esempio n. 2
0
 // Användaren har matat in info och klickat submit
 public override void EnterDetails(BookingContext booking, string attendee, int ticketCount)
 {
     booking.Attendee    = attendee;
     booking.TicketCount = ticketCount;
     booking.TransitionToState(new PendingState());
 }
Esempio n. 3
0
 // Arrangören avblåser evenemanget (eller användaren väljer att göra det)
 public override void Cancel(BookingContext booking)
 {
     booking.TransitionToState(new ClosedState("Booking Canceled"));
 }
Esempio n. 4
0
 // Evenemanget har redan varit
 public override void DatePassed(BookingContext booking)
 {
     booking.TransitionToState(new ClosedState("Booking Expired"));
 }