12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 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<StaffStandardView> GetStaffStandardViewQueryable(Expression<Func<TP_StaffStandard, bool>> exp,
- Expression<Func<CF_Department, bool>> departmentExp,
- Expression<Func<CF_College, bool>> 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;
- }
- }
- }
|