OperateLogDAL.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories.Log;
  6. using EMIS.ViewModel.Log;
  7. using EMIS.Entities.Log;
  8. using System.Linq.Expressions;
  9. namespace EMIS.DataLogic.Log
  10. {
  11. public class OperateLogDAL
  12. {
  13. public OperateRepository OperateRepository { get; set; }
  14. public VWUserRepository VWUserRepository { get; set; }
  15. public IQueryable<OperateLogView> GetOperateLogView(Expression<Func<Log_Operate, bool>> exp, Expression<Func<VW_Sys_User, bool>> userExp)
  16. {
  17. var q = (from o in OperateRepository.GetList(exp)
  18. join vu in VWUserRepository.GetList(userExp) on o.UserID equals vu.UserID
  19. orderby o.OperateTime descending
  20. select new OperateLogView {
  21. OperateID = o.OperateID,
  22. UserID = vu.UserID,
  23. LoginID = vu.LoginID,
  24. UserName = vu.Name,
  25. IP = o.IP,
  26. TableName = o.TableName,
  27. SourceUrl = o.SourceUrl,
  28. Operate = o.Operate,
  29. Detail = o.Detail,
  30. IsSuccess = o.IsSuccess,
  31. IsSuccessDesc = ((o.IsSuccess == true) ? "是" : "否"),
  32. OperateTime = o.OperateTime
  33. });
  34. return q;
  35. }
  36. }
  37. }