You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2 KiB

  1. using NFine.Code;
  2. using NFine.Domain.Entity.SystemManage;
  3. using NFine.Domain.IRepository.SystemManage;
  4. using NFine.Repository.SystemManage;
  5. namespace NFine.Application.SystemManage
  6. {
  7. public class UserLogOnApp
  8. {
  9. private IUserLogOnRepository service = new UserLogOnRepository();
  10. public UserLogOnEntity GetForm(string keyValue)
  11. {
  12. return service.FindEntity(keyValue);
  13. }
  14. public void UpdateForm(UserLogOnEntity userLogOnEntity)
  15. {
  16. service.Update(userLogOnEntity);
  17. }
  18. public void RevisePassword(string userPassword,string keyValue)
  19. {
  20. UserLogOnEntity userLogOnEntity = new UserLogOnEntity();
  21. if (keyValue == "SYS")
  22. keyValue = NFine.Code.OperatorProvider.Provider.GetCurrent().UserId;
  23. userLogOnEntity.F_Id = keyValue;
  24. userLogOnEntity.F_UserSecretkey = Md5.md5(Common.CreateNo(), 16).ToLower();
  25. userLogOnEntity.F_UserPassword = Md5.md5(DESEncrypt.Encrypt(Md5.md5(userPassword, 32).ToLower(), userLogOnEntity.F_UserSecretkey).ToLower(), 32).ToLower();
  26. service.Update(userLogOnEntity);
  27. }
  28. }
  29. }