1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.GraduationManage.GraduationSetting;
- using EMIS.Entities;
- using System.Linq.Expressions;
- namespace EMIS.DataLogic.GraduationManage.GraduationSetting
- {
- public class GraduationConditionPackageDAL
- {
- public GraduationConditionPackageRepository GraduationConditionPackageRepository { get; set; }
- public GraduationConditionRepository GraduationConditionRepository { get; set; }
- public GraduationApplyRepository GraduationApplyRepository { get; set; }
-
- /// <summary>
- /// 查询对应的毕业公式信息View(只查询毕业公式信息,不查询毕业公式对应的毕业条件)
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<GraduationConditionPackageView> GetGraduationConditionPackageQueryable(Expression<Func<ER_GraduationConditionPackage, bool>> exp)
- {
- var query = from gp in GraduationConditionPackageRepository.GetList(exp)
- select new GraduationConditionPackageView
- {
- GraduationConditionPackageID = gp.GraduationConditionPackageID,
- Title = gp.Title,
- StudentTypeID = gp.StudentType,
- IsDefault = gp.IsDefault.Value,
- IsEnable = gp.RecordStatus.Value > 0 ? true : false,
- RecordStatus = gp.RecordStatus,
- CreateUserID = gp.CreateUserID,
- CreateTime = gp.CreateTime,
- ModifyUserID = gp.ModifyUserID,
- ModifyTime = gp.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询毕业公式中对应的毕业条件信息View(GraduationConditionView)
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<GraduationConditionView> GraduationConditionQueryable(Expression<Func<ER_GraduationConditionPackage, bool>> exp)
- {
- var query = from gp in GraduationConditionPackageRepository.GetList(exp)
- from gc in gp.ER_GraduationCondition
- select new GraduationConditionView
- {
- GraduationConditionID = gc.GraduationConditionID,
- OrderNo = gc.OrderNo,
- Title = gc.Title,
- MethodFullName = gc.MethodFullName,
- IsEnable = gc.RecordStatus.Value > 0 ? true : false,
- RecordStatus = gc.RecordStatus,
- CreateUserID = gc.CreateUserID,
- CreateTime = gc.CreateTime,
- ModifyUserID = gc.ModifyUserID,
- ModifyTime = gc.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询毕业公式中未存在的毕业条件信息View(GraduationConditionView)
- /// </summary>
- /// <param name="expGraduationCondition"></param>
- /// <param name="graduationConditionPackageID"></param>
- /// <returns></returns>
- public IQueryable<GraduationConditionView> GetGraduationConditionNoQueryable(Expression<Func<ER_GraduationCondition, bool>> expGraduationCondition, Guid? graduationConditionPackageID)
- {
- var query = from gc in GraduationConditionRepository.GetList(expGraduationCondition)
- from gp in gc.ER_GraduationConditionPackage.Where(x => x.GraduationConditionPackageID == graduationConditionPackageID).DefaultIfEmpty()
- where !gp.ER_GraduationCondition.Contains(gc)
- select new GraduationConditionView
- {
- GraduationConditionID = gc.GraduationConditionID,
- OrderNo = gc.OrderNo,
- Title = gc.Title,
- MethodFullName = gc.MethodFullName,
- IsEnable = gc.RecordStatus.Value > 0 ? true : false,
- RecordStatus = gc.RecordStatus,
- CreateUserID = gc.CreateUserID,
- CreateTime = gc.CreateTime,
- ModifyUserID = gc.ModifyUserID,
- ModifyTime = gc.ModifyTime
- };
- return query;
- }
- }
- }
|