0c9347fbb29c60065bc90f27be85c87ec69ed0bc
[wsti_pai.git] / ManageViewModels.cs
1 using System.Collections.Generic;
2 using System.ComponentModel.DataAnnotations;
3 using Microsoft.AspNet.Identity;
4 using Microsoft.Owin.Security;
5
6 namespace Projects.Models
7 {
8     public class IndexViewModel
9     {
10         public bool HasPassword { get; set; }
11         public IList<UserLoginInfo> Logins { get; set; }
12         public string PhoneNumber { get; set; }
13         public bool TwoFactor { get; set; }
14         public bool BrowserRemembered { get; set; }
15     }
16
17     public class ManageLoginsViewModel
18     {
19         public IList<UserLoginInfo> CurrentLogins { get; set; }
20         public IList<AuthenticationDescription> OtherLogins { get; set; }
21     }
22
23     public class FactorViewModel
24     {
25         public string Purpose { get; set; }
26     }
27
28     public class SetPasswordViewModel
29     {
30         [Required]
31         [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
32         [DataType(DataType.Password)]
33         [Display(Name = "New password")]
34         public string NewPassword { get; set; }
35
36         [DataType(DataType.Password)]
37         [Display(Name = "Confirm new password")]
38         [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
39         public string ConfirmPassword { get; set; }
40     }
41
42     public class ChangePasswordViewModel
43     {
44         [Required]
45         [DataType(DataType.Password)]
46         [Display(Name = "Current password")]
47         public string OldPassword { get; set; }
48
49         [Required]
50         [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
51         [DataType(DataType.Password)]
52         [Display(Name = "New password")]
53         public string NewPassword { get; set; }
54
55         [DataType(DataType.Password)]
56         [Display(Name = "Confirm new password")]
57         [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
58         public string ConfirmPassword { get; set; }
59     }
60
61     public class AddPhoneNumberViewModel
62     {
63         [Required]
64         [Phone]
65         [Display(Name = "Phone Number")]
66         public string Number { get; set; }
67     }
68
69     public class VerifyPhoneNumberViewModel
70     {
71         [Required]
72         [Display(Name = "Code")]
73         public string Code { get; set; }
74
75         [Required]
76         [Phone]
77         [Display(Name = "Phone Number")]
78         public string PhoneNumber { get; set; }
79     }
80
81     public class ConfigureTwoFactorViewModel
82     {
83         public string SelectedProvider { get; set; }
84         public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
85     }
86 }