Created
October 1, 2009 18:05
-
-
Save orjan/199130 to your computer and use it in GitHub Desktop.
asp.net wizard api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum Steps | |
{ | |
// Next and previous is always available if not the first step | |
Standard, | |
Verification, | |
// End-step, thanks for your order | |
Confirmation, | |
// End-step, Transition to cancel is always available but not from confirmation | |
Cancel | |
} | |
public class CustomerOrderFlow : Flow<CustomerStorage> | |
{ | |
public CustomerOrderFlow() | |
{ | |
// TODO: add system name and display name | |
// TODO: a problem with enterprise-details is that you don't know if it's available when the flow starts | |
// TODO: i think that Steps should be moved to interfaces instead | |
// ConfirmationStep, CancelStep, StandardStep and hidden from this implementation like | |
/* | |
Step(...); | |
Verification(...); | |
Cancel(...); | |
Confirmation(...); | |
*/ | |
Step(Steps.Standard, "/controls/customer-details.ascx") | |
// This transition makes it possible to skip enterprise-details even if Customer.IsEnterprise | |
.Transition(Steps.Verification); | |
Step(Steps.Standard, "/controls/enterprise-details.ascx", s => s.Customer.IsEnterprise); | |
Step(Steps.Verification, "/controls/verification.ascx"); | |
Step(Steps.Confirmation, "/controls/confirmation.ascx"); // E.g thank you for your order | |
Step(Steps.Cancel, "/controls/cancel.ascx"); // E.g. cancel and redirect | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment