123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.Entities;
- using EMIS.ViewModel.DegreeManage.DegreeSetting;
- namespace EMIS.DataLogic.DegreeManage.DegreeSetting
- {
- public class DegreeConditionPackageDAL
- {
- public DegreeConditionPackageRepository DegreeConditionPackageRepository { get; set; }
- public DegreeConditionRepository DegreeConditionRepository { get; set; }
- public DegreeApplyRepository DegreeApplyRepository { get; set; }
-
- /// <summary>
- /// 查询对应的学位公式信息View(只查询学位公式信息,不查询学位公式对应的学位条件)
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<DegreeConditionPackageView> GetDegreeConditionPackageViewQueryable(Expression<Func<ER_DegreeConditionPackage, bool>> exp)
- {
- var query = from dp in DegreeConditionPackageRepository.GetList(exp)
- select new DegreeConditionPackageView
- {
- DegreeConditionPackageID = dp.DegreeConditionPackageID,
- Title = dp.Title,
- StudentTypeID = dp.StudentType,
- IsDefault = dp.IsDefault.Value,
- IsEnable = dp.RecordStatus.Value > 0 ? true : false,
- RecordStatus = dp.RecordStatus,
- CreateUserID = dp.CreateUserID,
- CreateTime = dp.CreateTime,
- ModifyUserID = dp.ModifyUserID,
- ModifyTime = dp.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询学位公式中对应的学位条件信息View(DegreeConditionView)
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<DegreeConditionView> GetDegreeConditionQueryable(Expression<Func<ER_DegreeConditionPackage, bool>> exp)
- {
- var query = from dp in DegreeConditionPackageRepository.GetList(exp)
- from dc in dp.ER_DegreeCondition
- select new DegreeConditionView
- {
- DegreeConditionID = dc.DegreeConditionID,
- OrderNo = dc.OrderNo,
- Title = dc.Title,
- MethodFullName = dc.MethodFullName,
- IsEnable = dc.RecordStatus.Value > 0 ? true : false,
- RecordStatus = dc.RecordStatus,
- CreateUserID = dc.CreateUserID,
- CreateTime = dc.CreateTime,
- ModifyUserID = dc.ModifyUserID,
- ModifyTime = dc.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询学位公式中未存在的学位条件信息View(DegreeConditionView)
- /// </summary>
- /// <param name="expDegreeCondition"></param>
- /// <param name="degreeConditionPackageID"></param>
- /// <returns></returns>
- public IQueryable<DegreeConditionView> GetDegreeConditionNoQueryable(Expression<Func<ER_DegreeCondition, bool>> expDegreeCondition,
- Guid? degreeConditionPackageID)
- {
- var query = from dc in DegreeConditionRepository.GetList(expDegreeCondition)
- from dp in dc.ER_DegreeConditionPackage
- .Where(x => x.DegreeConditionPackageID == degreeConditionPackageID).DefaultIfEmpty()
- where !dp.ER_DegreeCondition.Contains(dc)
- select new DegreeConditionView
- {
- DegreeConditionID = dc.DegreeConditionID,
- OrderNo = dc.OrderNo,
- Title = dc.Title,
- MethodFullName = dc.MethodFullName,
- IsEnable = dc.RecordStatus.Value > 0 ? true : false,
- RecordStatus = dc.RecordStatus,
- CreateUserID = dc.CreateUserID,
- CreateTime = dc.CreateTime,
- ModifyUserID = dc.ModifyUserID,
- ModifyTime = dc.ModifyTime
- };
- return query;
- }
- }
- }
|