Using YaStringLength and YaRequired
This commit is contained in:
parent
7d9495e326
commit
9457ba71d1
62 changed files with 396 additions and 150 deletions
|
|
@ -1,10 +1,11 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Manage
|
||||
{
|
||||
public class AddPhoneNumberViewModel
|
||||
{
|
||||
[Required]
|
||||
[YaRequired]
|
||||
[Phone]
|
||||
[Display(Name = "Phone number")]
|
||||
public string PhoneNumber { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Manage
|
||||
{
|
||||
public class ChangePasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[YaRequired]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Current password")]
|
||||
public string OldPassword { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[YaRequired]
|
||||
[YaStringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "New password")]
|
||||
public string NewPassword { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,35 +1,36 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Manage
|
||||
{
|
||||
|
||||
public class DoDirectCreditViewModel {
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string PaymentType { get; set;}
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string PayerName { get; set;}
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string FirstName { get; set;}
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string LastName { get; set;}
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string CreditCardNumber { get; set;}
|
||||
public string CreditCardType { get; set;}
|
||||
public string Cvv2Number { get; set;}
|
||||
public string CardExpiryDate { get; set;}
|
||||
public string IpnNotificationUrl { get; set; }
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string Street1 { get; set; }
|
||||
public string Street2 { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string Country { get; set; }
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string PostalCode { get; set; }
|
||||
public string Phone { get; set; }
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string CurrencyCode { get; set; }
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string Amount { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Manage
|
||||
{
|
||||
public class SetAddressViewModel
|
||||
{
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string Street1 { get; set; }
|
||||
public string Street2 { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string Country { get; set; }
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string PostalCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Manage
|
||||
{
|
||||
public class SetPasswordViewModel
|
||||
{
|
||||
[Required]
|
||||
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[YaRequired]
|
||||
[YaStringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "New password")]
|
||||
public string NewPassword { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Attributes.Validation;
|
||||
|
||||
namespace Yavsc.ViewModels.Manage
|
||||
{
|
||||
public class VerifyPhoneNumberViewModel
|
||||
{
|
||||
[Required]
|
||||
[YaRequired]
|
||||
public string Code { get; set; }
|
||||
|
||||
[Required]
|
||||
[YaRequired]
|
||||
[Phone]
|
||||
[Display(Name = "Phone number")]
|
||||
public string PhoneNumber { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue