yavsc/src/Yavsc.Server/ViewModels/Manage/ChangePasswordViewModel.cs

24 lines
834 B
C#
Raw Normal View History

2018-03-26 19:27:29 +02:00
using System.ComponentModel.DataAnnotations;
2019-09-04 01:25:36 +01:00
using Yavsc.Attributes.Validation;
2018-03-26 19:27:29 +02:00
namespace Yavsc.ViewModels.Manage
{
public class ChangePasswordViewModel
{
2019-09-04 01:25:36 +01:00
[YaRequired]
2018-03-26 19:27:29 +02:00
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
2019-09-04 01:25:36 +01:00
[YaRequired]
[YaStringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
2018-03-26 19:27:29 +02:00
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}