PageRenderTime 31ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/MvcMusicStore/Models/AccountModels.cs

#
C# | 67 lines | 56 code | 11 blank | 0 comment | 0 complexity | d4a8a2fccab44af915e1c841c5c925e1 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Globalization;
  5. using System.Web.Mvc;
  6. using System.Web.Security;
  7. namespace Mvc3ToolsUpdateWeb_Default.Models
  8. {
  9. public class ChangePasswordModel
  10. {
  11. [Required]
  12. [DataType(DataType.Password)]
  13. [Display(Name = "Current password")]
  14. public string OldPassword { get; set; }
  15. [Required]
  16. [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
  17. [DataType(DataType.Password)]
  18. [Display(Name = "New password")]
  19. public string NewPassword { get; set; }
  20. [DataType(DataType.Password)]
  21. [Display(Name = "Confirm new password")]
  22. [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
  23. public string ConfirmPassword { get; set; }
  24. }
  25. public class LogOnModel
  26. {
  27. [Required]
  28. [Display(Name = "User name")]
  29. public string UserName { get; set; }
  30. [Required]
  31. [DataType(DataType.Password)]
  32. [Display(Name = "Password")]
  33. public string Password { get; set; }
  34. [Display(Name = "Remember me?")]
  35. public bool RememberMe { get; set; }
  36. }
  37. public class RegisterModel
  38. {
  39. [Required]
  40. [Display(Name = "User name")]
  41. public string UserName { get; set; }
  42. [Required]
  43. [DataType(DataType.EmailAddress)]
  44. [Display(Name = "Email address")]
  45. public string Email { get; set; }
  46. [Required]
  47. [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
  48. [DataType(DataType.Password)]
  49. [Display(Name = "Password")]
  50. public string Password { get; set; }
  51. [DataType(DataType.Password)]
  52. [Display(Name = "Confirm password")]
  53. [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
  54. public string ConfirmPassword { get; set; }
  55. }
  56. }