123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel.ExaminationApply;
- using EMIS.DataLogic.Repositories;
- using System.Linq.Expressions;
- using EMIS.Entities;
- namespace EMIS.DataLogic.ExaminationApply
- {
- public class ExaminationTypeDAL
- {
- public ExaminationTypeRepository ExaminationTypeRepository { get; set; }
- public ExaminationBatchProjectRepository ExaminationBatchProjectRepository { get; set; }
- public IQueryable<ExaminationTypeView> GetExaminationTypeView(Expression<Func<EX_ExaminationType, bool>> examinationTypeExpression)
- {
- var q = (from et in ExaminationTypeRepository.GetList(examinationTypeExpression)
- orderby et.Name
- select new ExaminationTypeView
- {
- ExaminationTypeID = et.ExaminationTypeID,
- Name = et.Name,
- IsTimesLimit = et.IsTimesLimit ?? false,
- RecordStatus = et.RecordStatus,
- CreateUserID = et.CreateUserID,
- CreateTime = et.CreateTime,
- ModifyUserID = et.ModifyUserID,
- ModifyTime = et.ModifyTime
- });
- return q;
- }
- public IQueryable<ExaminationTypeView> GetExaminationTypeViewBySchoolyearID(Expression<Func<EX_ExaminationBatchProject, bool>> ebpexp)
- {
- var query = from ebpr in ExaminationBatchProjectRepository.Entities.Where(ebpexp)
- from et in ExaminationTypeRepository.Entities.Where(x => x.ExaminationTypeID == ebpr.EX_ExaminationProject.ExaminationTypeID)
- select new ExaminationTypeView
- {
- ExaminationTypeID = et.ExaminationTypeID,
- Name = et.Name,
- IsTimesLimit = et.IsTimesLimit ?? false,
- RecordStatus = et.RecordStatus,
- CreateUserID = et.CreateUserID,
- CreateTime = et.CreateTime,
- ModifyUserID = et.ModifyUserID,
- ModifyTime = et.ModifyTime
- };
- return query;
- }
- }
- }
|