12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel;
- using EMIS.ViewModel.StudentManage.OnlineChecking;
- using EMIS.ViewModel.StudentManage.InfoCenter;
- namespace EMIS.DataLogic.StudentManage.OnlineChecking
- {
- public class CheckingControlDAL
- {
- public StudentEditControlRepository StudentEditControlRepository { get; set; }
- public StudentEditColumnDescriptionRepository StudentEditColumnDescriptionRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询对应的学生校对控制信息CheckingControlView
- /// </summary>
- /// <param name="expStudentEditControl"></param>
- /// <returns></returns>
- public IQueryable<CheckingControlView> GetStudentEditControlQueryable(Expression<Func<CF_StudentEditControl, bool>> exp)
- {
- var query = from stuec in StudentEditControlRepository.GetList(exp)
- join usc in UserRepository.Entities
- on stuec.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on stuec.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new CheckingControlView
- {
- StudentEditControlID = stuec.StudentEditControlID,
- OrderNo = stuec.OrderNo,
- ColumnName = stuec.ColumnName,
- DisplayColumnName = stuec.DisplayColumnName,
- Description = stuec.Description,
- CheckingTypeID = stuec.CheckingTypeID,
- RecordStatus = stuec.RecordStatus,
- CreateUserID = stuec.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = stuec.CreateTime,
- ModifyUserID = stuec.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = stuec.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询对应的学生校对控制信息
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<EditFeildView> GetStudentEditFeildQueryable(Expression<Func<CF_StudentEditControl, bool>> exp)
- {
- var query = from stuec in StudentEditControlRepository.GetList(exp)
- select new EditFeildView
- {
- OrderNo = stuec.OrderNo ?? 0,
- ColumnFeild = stuec.ColumnName,
- ColumnName = stuec.DisplayColumnName,
- Description = stuec.Description,
- IsEdit = (stuec.CheckingTypeID != (int)CF_CheckingType.Close),
- CheckingTypeID = stuec.CheckingTypeID
- };
- return query;
- }
- }
- }
|