using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.DataLogic.Repositories.Log; using EMIS.ViewModel.Log; using EMIS.Entities.Log; using System.Linq.Expressions; namespace EMIS.DataLogic.Log { public class OperateLogDAL { public OperateRepository OperateRepository { get; set; } public VWUserRepository VWUserRepository { get; set; } public IQueryable GetOperateLogView(Expression> exp, Expression> userExp) { var q = (from o in OperateRepository.GetList(exp) join vu in VWUserRepository.GetList(userExp) on o.UserID equals vu.UserID orderby o.OperateTime descending select new OperateLogView { OperateID = o.OperateID, UserID = vu.UserID, LoginID = vu.LoginID, UserName = vu.Name, IP = o.IP, TableName = o.TableName, SourceUrl = o.SourceUrl, Operate = o.Operate, Detail = o.Detail, IsSuccess = o.IsSuccess, IsSuccessDesc = ((o.IsSuccess == true) ? "是" : "否"), OperateTime = o.OperateTime }); return q; } } }