using System.ComponentModel.DataAnnotations;

namespace iyixiGames.Web.Models
{
    public class RegisterViewModel
    {
        [Required(ErrorMessage = "用户名是必填项。")]
        [StringLength(50, MinimumLength = 3, ErrorMessage = "用户名长度必须在3到50个字符之间。")]
        [Display(Name = "用户名")]
        public string Username { get; set; }

        [Required(ErrorMessage = "电子邮件是必填项。")]
        [EmailAddress(ErrorMessage = "请输入有效的电子邮件地址。")]
        [StringLength(255, ErrorMessage = "电子邮件长度不能超过255个字符。")]
        [Display(Name = "电子邮件")]
        public string Email { get; set; }

        [Required(ErrorMessage = "全名是必填项。")]
        [StringLength(100, ErrorMessage = "全名长度不能超过100个字符。")]
        [Display(Name = "全名")]
        public string FullName { get; set; }

        [Required(ErrorMessage = "密码是必填项。")]
        [StringLength(100, MinimumLength = 6, ErrorMessage = "密码长度必须至少为6个字符。")]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [Compare("Password", ErrorMessage = "密码和确认密码不匹配。")]
        public string ConfirmPassword { get; set; }
    }
}