123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.StudentManage.OnlineChecking;
- using EMIS.ViewModel.SystemView;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.DataLogic.StudentManage.OnlineChecking
- {
- public class OpenObjectDAL
- {
- public StudentEditObjectsRepository StudentEditObjectsRepository { get; set; }
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- public DictionaryRepository DictionaryRepository { get; set; }
- public UserRepository UserRepository { get; set; }
- /// <summary>
- /// 查询学生校对控制开放对象信息OpenObjectView
- /// </summary>
- /// <param name="exp"></param>
- /// <returns></returns>
- public IQueryable<OpenObjectView> GetStudentEditObjectQueryable(Expression<Func<CF_StudentEditObjects, bool>> exp)
- {
- var query = from stuobj in StudentEditObjectsRepository.GetList(exp)
- join usc in UserRepository.Entities
- on stuobj.CreateUserID equals usc.UserID into tempusc
- from uscu in tempusc.DefaultIfEmpty()
- join usm in UserRepository.Entities
- on stuobj.ModifyUserID equals usm.UserID into tempusm
- from usmu in tempusm.DefaultIfEmpty()
- select new OpenObjectView
- {
- StudentEditObjectsID = stuobj.StudentEditObjectsID,
- EducationID = stuobj.EducationID,
- SchoolyearNumID = stuobj.SchoolyearNumID,
- Starttime = stuobj.Starttime,
- Endtime = stuobj.Endtime,
- Remark = stuobj.Remark,
- RecordStatus = stuobj.RecordStatus,
- CreateUserID = stuobj.CreateUserID,
- CreateUserName = uscu.Name,
- CreateTime = stuobj.CreateTime,
- ModifyUserID = stuobj.ModifyUserID,
- ModifyUserName = usmu.Name,
- ModifyTime = stuobj.ModifyTime
- };
- return query;
- }
- /// <summary>
- /// 查询开放对象中未新增的开放学年信息DictionaryItemView
- /// </summary>
- /// <param name="expStudentEditObject"></param>
- /// <returns></returns>
- public IQueryable<DictionaryItemView> GetSchoolyearNumNoAddQueryable(Expression<Func<CF_StudentEditObjects, bool>> expStudentEditObject)
- {
- var query = from dicitsyn in DictionaryItemRepository.GetList(x => x.DictionaryCode == DictionaryItem.CF_SchoolyearNum.ToString())
- join stuobj in StudentEditObjectsRepository.GetList(expStudentEditObject)
- on dicitsyn.Value equals stuobj.SchoolyearNumID into tempobj
- from dicitobj in tempobj.DefaultIfEmpty()
- join dicsyn in DictionaryRepository.Entities
- on dicitsyn.DictionaryCode equals dicsyn.DictionaryCode
- where dicitobj.StudentEditObjectsID == null
- select new DictionaryItemView
- {
- DictionaryItemID = dicitsyn.DictionaryItemID,
- DictionaryCode = dicitsyn.DictionaryCode,
- DictionaryName = dicsyn.Name,
- OrderNo = dicitsyn.OrderNo,
- Code = dicitsyn.Code,
- Name = dicitsyn.Name,
- Value = dicitsyn.Value,
- IsEditable = dicitsyn.IsEditable == true ? true : false,
- IsVisible = dicitsyn.RecordStatus > (int)SYS_STATUS.UNUSABLE ? true : false,
- RecordStatus = dicitsyn.RecordStatus
- };
- return query;
- }
- }
- }
|