123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- 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 WorktimeAdditionDAL
- {
- public WorktimeAdditionRepository WorktimeAdditionRepository { get; set; }
- public CoursematerialRepository CoursematerialRepository { get; set; }
- public GrademajorRepository GrademajorRepository { get; set; }
- public FacultymajorRepository FacultymajorRepository { get; set; }
- public SchoolyearRepository SchoolyearRepository { get; set; }
- public StaffRepository StaffRepository { get; set; }
- public DepartmentRepository DepartmentRepository { get; set; }
- public CollegeRepository CollegeRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- public IQueryable<WorktimeAdditionView> GetWorktimeAdditionViewQueryable(Expression<Func<TP_WorktimeAddition, bool>> exp,
- Expression<Func<CF_Department, bool>> departmentExp,
- Expression<Func<CF_Grademajor, bool>> gradeExp,
- Expression<Func<CF_Facultymajor, bool>> facultyExp)
- {
- var sql = (from addition in WorktimeAdditionRepository.GetList(exp)
- join course in CoursematerialRepository.Entities on addition.CoursematerialID equals course.CoursematerialID
- join schoolyear in SchoolyearRepository.Entities on addition.SchoolyearID equals schoolyear.SchoolyearID
- join teacher in UserRepository.Entities on addition.UserID equals teacher.UserID
- join staff in StaffRepository.Entities on teacher.UserID equals staff.UserID
- join department in DepartmentRepository.Entities.Where(departmentExp) on staff.DepartmentID equals department.DepartmentID
- join college in CollegeRepository.Entities on staff.CollegeID equals college.CollegeID
- join grade in GrademajorRepository.Entities.Where(gradeExp) on addition.GrademajorID equals grade.GrademajorID
- join faculty in FacultymajorRepository.Entities.Where(facultyExp) on grade.FacultymajorID equals faculty.FacultymajorID
- join courseCollege in CollegeRepository.Entities on addition.CourseCollegeID equals courseCollege.CollegeID
- select new WorktimeAdditionView
- {
- WorktimeAdditionID = addition.WorktimeAdditionID,
- UserID = addition.UserID,
- CollegeID = staff.CollegeID,
- CollegeNo = college.No,
- CollegeName = college.Name,
- SchoolyearID = addition.SchoolyearID,
- SchoolyearCode = schoolyear.Code,
- TeacherName = teacher.Name,
- GradeYearID = grade.GradeID,
- StudentCollegeID = faculty.CollegeID,
- StandardID = faculty.StandardID,
- GrademajorID = grade.GrademajorID,
- GrademajorName = grade.Name,
- CoursematerialID = course.CoursematerialID,
- CourseCode = course.CourseCode,
- CourseName = course.CourseName,
- CourseCollegeID = addition.CourseCollegeID,
- CourseCollegeNo = courseCollege.No,
- CourseCollegeName = courseCollege.Name,
- EducationMissionClassName = addition.EducationMissionClassName,
- TeachingModeID = addition.TeachingModeID,
- TeachType = addition.TeachType,
- StudentCount = addition.StudentCount,
- CourseTime = addition.CourseTime,
- Month=addition.Month,
- Remark = addition.Remark
- });
- return sql;
- }
- }
- }
|