1
0
mirror of https://github.com/chyzy/RSystem-MVC synced 2024-12-25 02:15:28 +01:00
RSystem-MVC-Fork/RSystem/Models/Account and Identity Models/AccountViewModels.cs
2018-04-17 11:20:49 +02:00

120 lines
3.7 KiB
C#

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using RSystem.ViewModels;
namespace RSystem.Models
{
public class ExternalLoginConfirmationViewModel
{
[Required]
[Display(Name = "Email")]
public string Email { get; set; }
}
public class ExternalLoginListViewModel
{
public string ReturnUrl { get; set; }
}
public class SendCodeViewModel
{
public string SelectedProvider { get; set; }
public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
public string ReturnUrl { get; set; }
public bool RememberMe { get; set; }
}
public class VerifyCodeViewModel
{
[Required]
public string Provider { get; set; }
[Required]
[Display(Name = "Code")]
public string Code { get; set; }
public string ReturnUrl { get; set; }
[Display(Name = "Remember this browser?")]
public bool RememberBrowser { get; set; }
public bool RememberMe { get; set; }
}
public class ForgotViewModel
{
[Required]
[Display(Name = "Email")]
public string Email { get; set; }
}
public class LoginViewModel
{
[Required(ErrorMessageResourceType = typeof(App_LocalResources.Account.Login),
ErrorMessageResourceName = "ReqPESEL")]
[RegularExpression(@"^[0-9]{11}",ErrorMessageResourceType = typeof(App_LocalResources.Account.Login),
ErrorMessageResourceName = "RegexPESEL")]
public string PESEL { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
public class RegisterViewModel
{
[Required(ErrorMessage = "PESEL jest wymagany.")]
[RegularExpression(@"^[0-9]{11}$",ErrorMessage = "Pesel powinien składać się z 11 cyfr.")]
public string PESEL { get; set; }
[Required(ErrorMessage = "Adres E-mail jest wymagany.")]
[EmailAddress(ErrorMessage = "Niepoprawny adres E-mail.")]
[Display(Name = "Email")]
public string Email { get; set; }
[Required(ErrorMessage = "Hasło jest wymagane")]
[StringLength(100, ErrorMessage = "{0} Hasło musi zawierać conajmniej {2} znaków.", MinimumLength = 6)]
[DataType(DataType.Password,ErrorMessage = "Twoje hasło jest za słabe.")]
[Display(Name = "Hasło")]
public string Password { get; set; }
[Required(ErrorMessage = "Potwierdź hasło.")]
[DataType(DataType.Password)]
[Display(Name = "Potwierdź hasło.")]
[Compare("Password", ErrorMessage = "Hasła nie są identyczne.")]
public string ConfirmPassword { get; set; }
}
public class ResetPasswordViewModel
{
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
public string Code { get; set; }
}
public class ForgotPasswordViewModel
{
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
}
}