using System; using System.Collections.Generic; using System.Linq; using EMIS.ViewModel.Log; using Bowin.Common.Linq.Entity; using EMIS.ViewModel; using EMIS.DataLogic.Log; namespace EMIS.CommonLogic.Log { public class OperateLogServices : BaseServices, IOperateLogServices { public OperateLogDAL OperateLogDAL { get; set; } public IGridResultSet GetOperateLogViewList(ConfiguretView searchCondition, DateTime startTime, DateTime endTime , int pageIndex, int pageSize) { var q = OperateLogDAL.GetOperateLogView(x => (x.OperateTime >= startTime && x.OperateTime <= endTime), x => true); if (!string.IsNullOrEmpty(searchCondition.ConditionValue) && !string.IsNullOrEmpty(searchCondition.Attribute)) q = q.DynamicWhere(searchCondition.Attribute, searchCondition.Condition, searchCondition.ConditionValue); return q.OrderByDescending(x => x.OperateTime).ToGridResultSet(pageIndex, pageSize); } public IList GetOperateLogViewList(ConfiguretView searchCondition, DateTime startTime, DateTime endTime) { var q = OperateLogDAL.GetOperateLogView(x => (x.OperateTime >= startTime && x.OperateTime <= endTime), x => true); if (!string.IsNullOrEmpty(searchCondition.ConditionValue) && !string.IsNullOrEmpty(searchCondition.Attribute)) q = q.DynamicWhere(searchCondition.Attribute, searchCondition.Condition, searchCondition.ConditionValue); return q.OrderByDescending(x => x.OperateTime).ToList(); } public void Delete(IList logIDList) { this.LogUnitOfWork.RemoveLogs(logIDList); } } }