using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.DataLogic.Repositories; using EMIS.ViewModel.PaymentManage; using System.Linq.Expressions; using EMIS.Entities; namespace EMIS.DataLogic.PaymentManage { public class WorktimeRateDAL { public CollegeRepository CollegeRepository { get; set; } public WorktimeRateRepository WorktimeRateRepository { get; set; } public IQueryable GetWorktimeRateViewQueryable(Expression> exp) { var sql = (from rate in WorktimeRateRepository.GetList(exp) join college in CollegeRepository.Entities on rate.CollegeID equals college.CollegeID into dcollege from college in dcollege.DefaultIfEmpty() select new WorktimeRateView { WorktimeRateID = rate.WorktimeRateID, CollegeID = rate.CollegeID, CollegeNo = college.No, CollegeName = college.Name, TeachingModeID = rate.TeachingModeID, TeachingMethodID = rate.TeachingMethodID, PaymentLevelID = rate.PaymentLevelID, StudentCountStart = rate.StudentCountStart, StudentCountEnd = rate.StudentCountEnd, WorktimeRate = rate.WorktimeRate }); return sql; } } }