OperateLogServices.cs 1.7 KB

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