1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.ExaminationManage;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using EMIS.ViewModel;
- namespace EMIS.DataLogic.ExaminationManage
- {
- public class ExaminationModeSettingDAL
- {
- public DictionaryItemRepository DictionaryItemRepository { get; set; }
- public ExaminationModeSettingRepository ExaminationModeSettingRepository { get; set; }
- public IQueryable<ExaminationModeSettingView> GetExaminationModeSettingView()
- {
- var query = (from diem in DictionaryItemRepository.GetList(x => x.DictionaryCode == typeof(CF_ExaminationMode).Name)
- join ems in ExaminationModeSettingRepository.Entities
- on diem.Value equals ems.ExaminationModeID into dems
- from eems in dems.DefaultIfEmpty()
- orderby diem.OrderNo
- select new ExaminationModeSettingView
- {
- ExaminationModeSettingID = eems.ExaminationModeSettingID == null ? Guid.NewGuid() : eems.ExaminationModeSettingID,
- ExaminationModeID = diem.Value,
- IsGeneratePlan = eems.IsGeneratePlan ?? false
- });
- return query;
- }
- }
- }
|