using System.ComponentModel.DataAnnotations;

namespace LeafWeb.WebCms.Models
{
	public class ContactForm
	{
		[Display(Name = "Name")]
		[Required(ErrorMessage = "Name required")]
		[RegularExpression(@"[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Please provide full name")]
		public string Name { get; set; }

		[Display(Name = "Email address")]
		[Required(ErrorMessage = "An email address is required")]
		[DataType(DataType.EmailAddress)]
		[RegularExpression(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}", ErrorMessage = "Must be an email address")]
		public string Email { get; set; }

		[UIHint("Multiline")]
		[Required(ErrorMessage = "A message is required")]
		[MinLength(32, ErrorMessage = "Minimum of 32 characters")]
		[MaxLength(1024, ErrorMessage = "Maximum of 1024 characters")]
		public string Message { get; set; }
	}
}