Skip to content

Instantly share code, notes, and snippets.

@nul800sebastiaan
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nul800sebastiaan/b38d05bf9af8272f5548 to your computer and use it in GitHub Desktop.
Save nul800sebastiaan/b38d05bf9af8272f5548 to your computer and use it in GitHub Desktop.
TicketOrderModel.cs
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