ManageViewModels.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System.Collections.Generic;
  2. using System.ComponentModel.DataAnnotations;
  3. using Microsoft.AspNet.Identity;
  4. using Microsoft.Owin.Security;
  5. namespace Winsoft.GOV.XF.WX.Models
  6. {
  7. public class IndexViewModel
  8. {
  9. public bool HasPassword { get; set; }
  10. public IList<UserLoginInfo> Logins { get; set; }
  11. public string PhoneNumber { get; set; }
  12. public bool TwoFactor { get; set; }
  13. public bool BrowserRemembered { get; set; }
  14. }
  15. public class ManageLoginsViewModel
  16. {
  17. public IList<UserLoginInfo> CurrentLogins { get; set; }
  18. public IList<AuthenticationDescription> OtherLogins { get; set; }
  19. }
  20. public class FactorViewModel
  21. {
  22. public string Purpose { get; set; }
  23. }
  24. public class SetPasswordViewModel
  25. {
  26. [Required]
  27. [StringLength(100, ErrorMessage = "{0} 必须至少包含 {2} 个字符。", MinimumLength = 6)]
  28. [DataType(DataType.Password)]
  29. [Display(Name = "新密码")]
  30. public string NewPassword { get; set; }
  31. [DataType(DataType.Password)]
  32. [Display(Name = "确认新密码")]
  33. [Compare("NewPassword", ErrorMessage = "新密码和确认密码不匹配。")]
  34. public string ConfirmPassword { get; set; }
  35. }
  36. public class ChangePasswordViewModel
  37. {
  38. [Required]
  39. [DataType(DataType.Password)]
  40. [Display(Name = "当前密码")]
  41. public string OldPassword { get; set; }
  42. [Required]
  43. [StringLength(100, ErrorMessage = "{0} 必须至少包含 {2} 个字符。", MinimumLength = 6)]
  44. [DataType(DataType.Password)]
  45. [Display(Name = "新密码")]
  46. public string NewPassword { get; set; }
  47. [DataType(DataType.Password)]
  48. [Display(Name = "确认新密码")]
  49. [Compare("NewPassword", ErrorMessage = "新密码和确认密码不匹配。")]
  50. public string ConfirmPassword { get; set; }
  51. }
  52. public class AddPhoneNumberViewModel
  53. {
  54. [Required]
  55. [Phone]
  56. [Display(Name = "电话号码")]
  57. public string Number { get; set; }
  58. }
  59. public class VerifyPhoneNumberViewModel
  60. {
  61. [Required]
  62. [Display(Name = "代码")]
  63. public string Code { get; set; }
  64. [Required]
  65. [Phone]
  66. [Display(Name = "电话号码")]
  67. public string PhoneNumber { get; set; }
  68. }
  69. public class ConfigureTwoFactorViewModel
  70. {
  71. public string SelectedProvider { get; set; }
  72. public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
  73. }
  74. }