using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using EMIS.DataLogic.Repositories; using EMIS.ViewModel.PaymentManage; using EMIS.Entities; namespace EMIS.DataLogic.PaymentManage { public class StaffStandardDAL { public StaffStandardRepository StaffStandardRepository { get; set; } public StaffRepository StaffRepository { get; set; } public UserRepository UserRepository { get; set; } public DepartmentRepository DepartmentRepository { get; set; } public CollegeRepository CollegeRepository { get; set; } public IQueryable GetStaffStandardViewQueryable(Expression> exp, Expression> departmentExp, Expression> collegeExp) { var sql = (from standard in StaffStandardRepository.GetList(exp) join staff in StaffRepository.Entities on standard.UserID equals staff.UserID join user in UserRepository.Entities on staff.UserID equals user.UserID join department in DepartmentRepository.Entities.Where(departmentExp) on staff.DepartmentID equals department.DepartmentID join college in CollegeRepository.Entities.Where(collegeExp) on staff.CollegeID equals college.CollegeID select new StaffStandardView { StaffStandardID = standard.StaffStandardID, UserID = staff.UserID, LoginID = user.LoginID, UserName = user.Name, DepartmentID = department.DepartmentID, DepartmentName = department.Name, CollegeID = college.CollegeID, CollegeNo = college.No, CollegeName = college.Name, Amount = standard.Amount }); return sql; } } }