Last active
August 29, 2015 14:15
-
-
Save nul800sebastiaan/b38d05bf9af8272f5548 to your computer and use it in GitHub Desktop.
TicketOrderModel.cs
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
using System.ComponentModel.DataAnnotations; | |
namespace Awesome.FormDemo.Models | |
{ | |
public class TicketOrderModel | |
{ | |
public TicketOrderModel() | |
{ | |
StepIndex = 0; | |
PersonalInfoStep = new PersonalInfoStep(); | |
TicketOrderStep = new TicketOrderStep(); | |
TermsAgreementStep = new TOSAgreementStep(); | |
} | |
public bool Previous { get; set; } | |
public bool Next { get; set; } | |
public int StepIndex { get; set; } | |
public PersonalInfoStep PersonalInfoStep { get; set; } | |
public TicketOrderStep TicketOrderStep { get; set; } | |
public TOSAgreementStep TermsAgreementStep { get; set; } | |
} | |
public class PersonalInfoStep | |
{ | |
[Required] | |
public string Name { get; set; } | |
[Required, EmailAddress] | |
public string Email { get; set; } | |
} | |
public class TicketOrderStep | |
{ | |
[Required] | |
public int EventId { get; set; } | |
[Required] | |
public int NumberOfTickets { get; set; } | |
} | |
public class TOSAgreementStep | |
{ | |
[Required] | |
[Display(Name = "I agree to the terms and conditions")] | |
[Compare("IsTrue", ErrorMessage = "Please agree to Terms and Conditions")] | |
public bool Agreed { get; set; } | |
public bool IsTrue | |
{ get { return true; } } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment