yavsc/Yavsc/ViewModels/Account/RegisterViewModel.cs

36 lines
1.4 KiB
C#
Raw Normal View History

2016-05-17 18:22:18 +02:00
using System.ComponentModel.DataAnnotations;
2017-09-24 17:22:25 +02:00
using Yavsc.Attributes.Validation;
2016-05-17 18:22:18 +02:00
namespace Yavsc.ViewModels.Account
{
public class RegisterViewModel
{
2017-09-24 17:22:25 +02:00
// ErrorMessage = "",
2017-09-24 21:45:55 +02:00
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "UserName")]
2017-09-24 17:22:25 +02:00
[StringLength(102)]
2017-09-24 22:02:05 +02:00
[YaRegularExpression(@"[a-zA-Z0-9 .'_-]+", ErrorMessageResourceName="InvalidUserName", ErrorMessageResourceType = typeof(Yavsc.Resources.YavscLocalisation))]
2016-05-17 18:22:18 +02:00
public string UserName { get; set; }
2017-09-24 21:45:55 +02:00
[YaRequired()]
2017-09-24 17:22:25 +02:00
// [EmailAddress]
2016-05-17 18:22:18 +02:00
[Display(Name = "Email")]
public string Email { get; set; }
2017-09-24 21:45:55 +02:00
[StringLength(100, MinimumLength = 6)]
[DataType(DataType.Password)]
// ErrorMessage = "Les mots de passe doivent contenir au moins un caractère spécial, qui ne soit ni une lettre ni un chiffre.")]
2017-09-24 17:22:25 +02:00
2017-09-24 21:45:55 +02:00
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "Password")]
2016-05-17 18:22:18 +02:00
public string Password { get; set; }
2017-09-24 21:45:55 +02:00
[DataType(DataType.Password)]
[Display(ResourceType = typeof(Yavsc.Resources.YavscLocalisation), Name = "PasswordConfirm")]
[Compare("Password", ErrorMessageResourceName = "PassAndConfirmDontMach", ErrorMessageResourceType = typeof(Yavsc.Resources.YavscLocalisation) )]
2016-05-17 18:22:18 +02:00
public string ConfirmPassword { get; set; }
public string GoogleRegId { get; set; }
}
}