Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.