123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.Entities;
- using EMIS.ViewModel.EvaluationManage.EvaluationTable;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.EvaluationManage.EvaluationTable
- {
- public class EvaluationTableDAL
- {
- public EvaluationTableRepository EvaluationTableRepository { get; set; }
- public EvaluationParticipateTypeRepository EvaluationParticipateTypeRepository { get; set; }
- public EvaluationIntTypeRepository EvaluationIntTypeRepository { get; set; }
- public EvaluationTargetRepository EvaluationTargetRepository { get; set; }
- public EvaluationProjectRepository EvaluationProjectRepository { get; set; }
- public UserRepository UserRepository { get; set; }
-
-
-
-
-
- public IQueryable<EvaluationTableView> GetEvaluationTableViewQueryable(Expression<Func<EM_EvaluationTable, bool>> expEvaluationTable)
- {
- var query = from evtb in EvaluationTableRepository.GetList(expEvaluationTable)
- join evpt in EvaluationParticipateTypeRepository.Entities
- on evtb.EvaluationParticipateTypeID equals evpt.EvaluationParticipateTypeID
- join evit in EvaluationIntTypeRepository.Entities
- on evtb.EvaluationIntTypeID equals evit.EvaluationIntTypeID
- join tg in
- (
- from tg in EvaluationTargetRepository.Entities
- group tg by tg.EvaluationTableID into gtg
- select new
- {
- EvaluationTableID = gtg.Key,
- TargetCount = gtg.Count()
- }
- )
- on evtb.EvaluationTableID equals tg.EvaluationTableID into temptg
- from evtg in temptg.DefaultIfEmpty()
- join pj in
- (
- from pj in EvaluationProjectRepository.Entities
- group pj by pj.EM_EvaluationTarget.EM_EvaluationTable.EvaluationTableID into gpj
- select new
- {
- EvaluationTableID = gpj.Key,
- ProjectCount = gpj.Count()
- }
- )
- on evtb.EvaluationTableID equals pj.EvaluationTableID into temppj
- from evpj in temppj.DefaultIfEmpty()
- join usc in UserRepository.Entities
- on evtb.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on evtb.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new EvaluationTableView
- {
- EvaluationTableID = evtb.EvaluationTableID,
- Code = evtb.Code,
- Name = evtb.Name,
- EvaluationParticipateTypeID = evtb.EvaluationParticipateTypeID,
- ParticipateTypeID = evpt.ParticipateTypeID,
- IsStudent = evpt.IsStudent.Value,
- EvaluationTypeID = evtb.EvaluationIntTypeID,
- EvaluationTypeCode = evit.Code,
- EvaluationTypeName = evit.Name,
- TeachingModeIDList = evit.EM_EvaluationTeachingMode.OrderBy(x => x.TeachingModeID).Select(x => x.TeachingModeID).ToList(),
- Weight = evtb.Weight,
- TargetCount = evtg.TargetCount == null ? 0 : evtg.TargetCount,
- ProjectCount = evpj.ProjectCount == null ? 0 : evpj.ProjectCount,
- IsEnabled = evtb.IsEnabled.Value,
- Remark = evtb.Remark,
- RecordStatus = evtb.RecordStatus,
- CreateUserID = evtb.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = evtb.CreateTime,
- ModifyUserID = evtb.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = evtb.ModifyTime
- };
- return query;
- }
-
-
-
-
-
- public IQueryable<EvaluationTargetView> GetEvaluationTargetViewQueryable(Expression<Func<EM_EvaluationTable, bool>> expEvaluationTable)
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return null; ;
- }
-
-
-
-
-
- public IQueryable<EvaluationProjectView> GetEvaluationProjectViewQueryable(Expression<Func<EM_EvaluationTable, bool>> expEvaluationTable)
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return null;
- }
- }
- }
|