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; }
///
/// 查询对应的学位公式信息View(只查询学位公式信息,不查询学位公式对应的学位条件)
///
///
///
public IQueryable GetDegreeConditionPackageViewQueryable(Expression> 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;
}
///
/// 查询学位公式中对应的学位条件信息View(DegreeConditionView)
///
///
///
public IQueryable GetDegreeConditionQueryable(Expression> 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;
}
///
/// 查询学位公式中未存在的学位条件信息View(DegreeConditionView)
///
///
///
///
public IQueryable GetDegreeConditionNoQueryable(Expression> 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;
}
}
}