User.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Model
  7. {
  8. // 定义实体类
  9. public class User
  10. {
  11. public User()
  12. {
  13. }
  14. public User(string user,string password) : this()
  15. {
  16. this.Username = user;
  17. this.Password = password;
  18. }
  19. public User(string user, string password, PermissionLevel level):this(user,password)
  20. {
  21. this.PermissionLevel = level;
  22. }
  23. public int Id { get; set; }
  24. public string Username { get; set; }
  25. public string Password { get; set; }
  26. public PermissionLevel PermissionLevel { get; set; }=PermissionLevel.操作工;
  27. public bool CanCloseSoftware { get; set; }
  28. // 如果将来加 Email,就在这里加 public string Email { get; set; }
  29. }
  30. public enum PermissionLevel
  31. {
  32. 无权限 = -1,
  33. 操作工 = 0,
  34. 工程师 = 1,
  35. 技术员 = 2,
  36. 管理员 = 3,
  37. 开发者 = 4,
  38. }
  39. }