BlAuthoryUser.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using ProjectBase.Data.BaseDAL;
  2. using ProjectBase.Data.Encrypt;
  3. using ProjectBase.Data.Logs;
  4. using SIASUN.Autopilot.DAL.IDALSQL;
  5. using SIASUN.Autopilot.Model;
  6. using System;
  7. namespace SIASUN.Autopilot.BLL
  8. {
  9. public class BlAuthoryUser : BaseBLL<MoAuthoryUser>
  10. {
  11. private IDalAuthoryUser dalAuthoryUser;
  12. /// <summary>
  13. /// 构造函数
  14. /// </summary>
  15. public BlAuthoryUser() : base()
  16. {
  17. base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
  18. dalAuthoryUser = base.baseDal as IDalAuthoryUser;
  19. dalAuthoryUser.OnOperationLog += new OperationLogEventHandler(BlLogOperation.OnOperationLog);
  20. }
  21. /// <summary>
  22. /// 登录账户和密码验证
  23. /// </summary>
  24. /// <param name="userAccount">账户</param>
  25. /// <param name="userPasswd">密码</param>
  26. /// <param name="message">反馈信息</param>
  27. /// <returns></returns>
  28. //public bool VerifyLogin(string userAccount, string userPasswd, out string message)
  29. //{
  30. // try
  31. // {
  32. // message = "";
  33. // MoAuthoryUser user = FindByID(userAccount);
  34. // if (user == null)
  35. // {
  36. // message = "不存在账号!";
  37. // return false;
  38. // }
  39. // //string encrptPasswd = EncodeHelper.MD5Encrypt(userPasswd);
  40. // //如果该用户的密码是初始密码,让用户修改密码
  41. // if (user.LoginPasswd.Equals(EncodeHelper.EncryptString("000000")))
  42. // {
  43. // message = "您的密码为初始密码,请点击开始菜单修改密码!";
  44. // return false;
  45. // }
  46. // if (userPasswd.Equals(user.LoginPasswd))
  47. // {
  48. // SysEnvironment.CurrentLoginName = user.UserName;
  49. // SysEnvironment.CurrentLoginGroupId = user.GroupId;
  50. // //bool flag = BLLFactory<BlackWhite>.Instance.VerifyBlackWhite(user.LoginAccount,SysEnvironment.Ip,out message);
  51. // //if (!flag)
  52. // //{
  53. // // return false;
  54. // //}
  55. // ////登录成功后记录到用户登录日志中
  56. // //MoLogLogIn moLogIn = new MoLogLogIn
  57. // //{
  58. // // Account = user.LoginAccount,
  59. // // Name = user.UserName,
  60. // // GroupId = user.GroupId,
  61. // // Description = "用户登录",
  62. // // Ip = SysEnvironment.Ip,
  63. // // Mac = SysEnvironment.Mac,
  64. // // Time = DateTime.Now
  65. // //};
  66. // //if (BLLFactory<BlLogLogIn>.Instance.Insert(moLogIn))
  67. // //{
  68. // // return true;
  69. // //}
  70. // //else
  71. // //{
  72. // // message = "记录用户登录日志失败";
  73. // // return false;
  74. // //}
  75. // }
  76. // else
  77. // {
  78. // message = "密码错误!";
  79. // return false;
  80. // }
  81. // }
  82. // catch (Exception ex)
  83. // {
  84. // LogHelper.log.Error(string.Format("修改数据库plc_info出现错误:{0}", ex));
  85. // message = ex.ToString();
  86. // return false;
  87. // }
  88. //}
  89. }
  90. }