using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.ViewModel.Log; using Bowin.Common.Linq.Entity; using EMIS.ViewModel; using EMIS.DataLogic.Log; using System.Linq.Expressions; using EMIS.Entities.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); } } }