123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel.ExamManage;
- namespace EMIS.DataLogic.ExamManage
- {
- public class ProjectFeeDAL
- {
- public ExaminationProjectFeeTypeRepository ProjectFeeTypeRepository { get; set; }
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- public ExaminationProjectFeeRepository ProjectFeeRepository { get; set; }
- public ExaminationProjectRepository ProjectRepository { get; set; }
- public ExaminationTypeRepository TypeRepository { get; set; }
- public ExaminationProjectSubjectRepository ProjectSubjectRepository { get; set; }
- public ExaminationBatchProjectRepository BatchProjectRepository { get; set; }
- public ExaminationBatchProjectControlRepository ExaminationBatchProjectControlRepository { get; set; }
- public ExaminationProjectFeeRepository ExaminationProjectFeeRepository { get; set; }
- public IQueryable<EMIS.ViewModel.ProjectFeeTypeView> GetProjectFeeTypeGrid(Expression<Func<EX_ExaminationProjectFeeType, bool>> expCampus)
- {
- var query = from a in ProjectFeeTypeRepository.GetList(expCampus)
- join c in DictionaryItemRepository.Entities
- on new { a.FeeTypeID, DictionaryCode = "EX_ExaminationProjectFeeType" } equals new { FeeTypeID = c.Value, c.DictionaryCode }
- select new EMIS.ViewModel.ProjectFeeTypeView
- {
- ExaminationProjectFeeTypeID = a.ExaminationProjectFeeTypeID,
- ExaminationProjectFeeID = a.ExaminationProjectFeeID,
- Fee = a.Fee,
- FeeTypeID = a.FeeTypeID,
- FeeTypeName = c.Name,
- IsRequiredForNew = a.IsRequiredForNew,
- IsResit = a.IsResit,
- IsMaterial = a.IsMaterial,
- IsTrainingFee = a.IsTrainingFee,
- IsResitText = a.IsResit == true ? "是" : "否",
- IsMaterialText = a.IsMaterial == true ? "是" : "否",
- IsTrainingFeeText = a.IsTrainingFee == true ? "是" : "否"
- };
- return query;
- }
- public IQueryable<EMIS.ViewModel.ExaminationProjectView> GetProectListViewGrid(Expression<Func<EX_ExaminationProject, bool>> expFeetype)
- {
- var query = from a in ProjectRepository.Entities.Where(expFeetype)
- join c in DictionaryItemRepository.Entities
- on new { a.ExaminationLevelID, DictionaryCode = "EX_ExaminationLevel" } equals new { ExaminationLevelID = c.Value, c.DictionaryCode }
- join d in DictionaryItemRepository.Entities
- on new { a.IssuedByID, DictionaryCode = "EX_Issuer" } equals new { IssuedByID = d.Value, d.DictionaryCode }
- select new EMIS.ViewModel.ExaminationProjectView
- {
- ExaminationLevelID = a.ExaminationLevelID,
- ExaminationProjectID = a.ExaminationProjectID,
- ExaminationType = a.EX_ExaminationType.Name,
- ExaminationTypeID = a.ExaminationTypeID,
- Name = a.Name,
- IssuedByID = a.IssuedByID,
- ExaminationLevelText = c.Name,
- IssuedByIDText = d.Name,
- EX_ExaminationProjectSubject = a.EX_ExaminationProjectSubject,
- PreposeProjectID = a.PreposeProjectID,
- Remark = a.Remark
- };
- return query;
- }
- public IQueryable<EMIS.ViewModel.ExaminationProjectViewNotSubject> GetProectListViewGridForSelect(Expression<Func<EX_ExaminationProject, bool>> expFeetype)
- {
- var query = from a in ProjectRepository.Entities.Where(expFeetype)
- join c in DictionaryItemRepository.Entities
- on new { a.ExaminationLevelID, DictionaryCode = "EX_ExaminationLevel" } equals new { ExaminationLevelID = c.Value, c.DictionaryCode }
- join d in DictionaryItemRepository.Entities
- on new { a.IssuedByID, DictionaryCode = "EX_Issuer" } equals new { IssuedByID = d.Value, d.DictionaryCode }
- select new EMIS.ViewModel.ExaminationProjectViewNotSubject
- {
- ExaminationLevelID = a.ExaminationLevelID,
- ExaminationProjectID = a.ExaminationProjectID,
- ExaminationType = a.EX_ExaminationType.Name,
- ExaminationTypeID = a.ExaminationTypeID,
- Name = a.Name,
- IssuedByID = a.IssuedByID,
- ExaminationLevelText = c.Name,
- IssuedByIDText = d.Name,
- PreposeProjectID = a.PreposeProjectID,
- Remark = a.Remark
- };
- return query;
- }
- public IQueryable<EMIS.ViewModel.ProjectFeeTypeView> GetProjectFeeType(Expression<Func<EX_ExaminationProjectFeeType, bool>> expFeetype)
- {
- var query = from a in ProjectFeeTypeRepository.Entities.Where(expFeetype)
- join c in DictionaryItemRepository.Entities
- on new { a.FeeTypeID, DictionaryCode = "EX_ExaminationProjectFeeType" } equals new { FeeTypeID = c.Value, c.DictionaryCode }
- select new EMIS.ViewModel.ProjectFeeTypeView
- {
- ExaminationProjectFeeTypeID = a.ExaminationProjectFeeTypeID,
- ExaminationProjectFeeID = a.ExaminationProjectFeeID,
- Fee = a.Fee,
- FeeTypeID = a.FeeTypeID,
- FeeTypeName = c.Name,
- IsRequiredForNew = a.IsRequiredForNew,
- IsResitText = a.IsResit == true ? "是" : "否",
- IsMaterialText = a.IsMaterial == true ? "是" : "否",
- IsTrainingFeeText = a.IsTrainingFee == true ? "是" : "否",
- IsResit = a.IsResit,
- IsMaterial = a.IsMaterial,
- IsTrainingFee = a.IsTrainingFee,
- };
- return query;
- }
- public IQueryable<EMIS.ViewModel.ExaminationProjectFeeView> GetProjectFee(Expression<Func<EX_ExaminationProjectFee, bool>> expFee)
- {
- var query = from a in ProjectFeeRepository.Entities.Where(expFee)
- join p in ProjectRepository.Entities on a.ExaminationProjectID equals p.ExaminationProjectID
- select new EMIS.ViewModel.ExaminationProjectFeeView
- {
- ExaminationProjectFeeID = a.ExaminationProjectFeeID,
- ExaminationType = p.EX_ExaminationType.Name,
- ExaminationProjectID = a.ExaminationProjectID,
- Name = a.Name,
- ProjectName = p.Name,
- ExaminationTypeID = p.ExaminationTypeID,
- RecordStatus = a.RecordStatus.Value
- };
- return query;
- }
- public IQueryable<EMIS.ViewModel.ExaminationProjectFeeView> GerProjectFeeByProjectAndYearStandard(Expression<Func<EX_ExaminationBatchProjectControl, bool>> expebpc)
- {
- var query = from ebpcr in ExaminationBatchProjectControlRepository.Entities.Where(expebpc)
- from epfr in ExaminationProjectFeeRepository.Entities.Where(x => ebpcr.ExaminationProjectFeeID == x.ExaminationProjectFeeID)
- select new EMIS.ViewModel.ExaminationProjectFeeView
- {
- ExaminationProjectFeeID = ebpcr.ExaminationProjectFeeID.Value,
- ExaminationProjectID = epfr.ExaminationProjectID,
- Name = epfr.Name,
- ProjectName = epfr.EX_ExaminationProject.Name,
- };
- return query;
- }
- public IQueryable<EX_ExaminationType> GetExaminationType(Expression<Func<EX_ExaminationType, bool>> expFee)
- {
- var query = from a in TypeRepository.Entities.Where(expFee)
- select a;
- return query;
- }
- public IQueryable<EMIS.ViewModel.ExaminationProjectSubjectView> GetProjectSubjectList(Expression<Func<EX_ExaminationProjectSubject, bool>> expFee)
- {
- var query = from a in ProjectSubjectRepository.Entities.Where(expFee)
- join c in DictionaryItemRepository.Entities
- on new { a.ExaminationSubjectID, DictionaryCode = "EX_ExaminationSubject" } equals new { ExaminationSubjectID = c.Value, c.DictionaryCode }
- select new EMIS.ViewModel.ExaminationProjectSubjectView
- {
- ExaminationProjectSubjectID = a.ExaminationProjectSubjectID,
- ExaminationSubject = c.Name,
- ExaminationSubjectID = a.ExaminationSubjectID,
- ExaminationProjectID = a.ExaminationProjectID,
- SubjectCode = c.Code
- };
- return query;
- }
- public IQueryable<ExamSubjectView> GetExamSubjectByProjectID(Expression<Func<EX_ExaminationProjectSubject, bool>> expeps)
- {
- var query = from psr in ProjectSubjectRepository.Entities.Where(expeps)
- from dic in DictionaryItemRepository.Entities.Where(x => x.DictionaryCode == "EX_ExaminationSubject" && x.Value == psr.ExaminationSubjectID)
- select new ExamSubjectView
- {
- ExaminationSubjectID = psr.ExaminationSubjectID,
- ExaminationSubjectName = dic.Name,
- ResitCount = psr.ResitCount,
- };
- return query;
- }
- public IQueryable<ExamSubjectView> GetExamSubject()
- {
- var query = from dic in DictionaryItemRepository.Entities.Where(x => x.DictionaryCode == "EX_ExaminationSubject")
- select new ExamSubjectView
- {
- ExaminationSubjectID = dic.Value,
- ExaminationSubjectName = dic.Name,
- //ResitCount = psr.ResitCount,
- };
- return query;
- }
- }
- }
|