OperateLogServices.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.Log;
  6. using Bowin.Common.Linq.Entity;
  7. using EMIS.ViewModel;
  8. using EMIS.DataLogic.Log;
  9. using System.Linq.Expressions;
  10. using EMIS.Entities.Log;
  11. namespace EMIS.CommonLogic.Log
  12. {
  13. public class OperateLogServices : BaseServices, IOperateLogServices
  14. {
  15. public OperateLogDAL OperateLogDAL { get; set; }
  16. public IGridResultSet<OperateLogView> GetOperateLogViewList(ConfiguretView searchCondition, DateTime startTime, DateTime endTime
  17. , int pageIndex, int pageSize)
  18. {
  19. var q = OperateLogDAL.GetOperateLogView(x => (x.OperateTime >= startTime && x.OperateTime <= endTime), x => true);
  20. if (!string.IsNullOrEmpty(searchCondition.ConditionValue) && !string.IsNullOrEmpty(searchCondition.Attribute))
  21. q = q.DynamicWhere(searchCondition.Attribute, searchCondition.Condition, searchCondition.ConditionValue);
  22. return q.OrderByDescending(x => x.OperateTime).ToGridResultSet<OperateLogView>(pageIndex, pageSize);
  23. }
  24. public IList<OperateLogView> GetOperateLogViewList(ConfiguretView searchCondition, DateTime startTime, DateTime endTime)
  25. {
  26. var q = OperateLogDAL.GetOperateLogView(x => (x.OperateTime >= startTime && x.OperateTime <= endTime), x => true);
  27. if (!string.IsNullOrEmpty(searchCondition.ConditionValue) && !string.IsNullOrEmpty(searchCondition.Attribute))
  28. q = q.DynamicWhere(searchCondition.Attribute, searchCondition.Condition, searchCondition.ConditionValue);
  29. return q.OrderByDescending(x => x.OperateTime).ToList();
  30. }
  31. public void Delete(IList<Guid?> logIDList)
  32. {
  33. this.LogUnitOfWork.RemoveLogs(logIDList);
  34. }
  35. }
  36. }