123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Repositories;
- using EMIS.ViewModel.ScoreManage;
- namespace EMIS.DataLogic.ScoreManage
- {
- public class ScoreFormulaDAL
- {
- public ScoreFormulaRepository scoreFormulaRepository { get; set; }
- public DictionaryItemRepository dictionaryItemRepository { get; set; }
- public ScoreFormulaDetailRepository scoreFormulaDetailRepository { get; set; }
- public IQueryable<ScoreFormulaDropdownDetailView> GetScoreFormulaDetailViewQueryableByID(Guid scoreFormulaID)
- {
- var detail = from sfdr in scoreFormulaDetailRepository.GetList(x => x.ScoreFormulaID == scoreFormulaID)
- select new ScoreFormulaDropdownDetailView
- {
- ScoreFormulaDetailID = sfdr.ScoreFormulaDetailID,
- ScoreFormulaID = sfdr.ScoreFormulaID,
- IsRequirePass = sfdr.IsRequirePass,
- PassScore = sfdr.PassScore,
- ScoreType = sfdr.ScoreType,
- Percentage = sfdr.Percentage,
- PassScoreStr = sfdr.PassScore == null ? "" : sfdr.PassScore.ToString()
- };
- List<ScoreFormulaDropdownDetailView> detailList = detail.ToList();
- var query = from sfr in scoreFormulaRepository.GetList(x => x.ScoreFormulaID == scoreFormulaID)
- join sfdr in scoreFormulaDetailRepository.Entities
- on sfr.ScoreFormulaID equals sfdr.ScoreFormulaID
- select new ScoreFormulaDropdownView
- {
- Name = sfr.Name,
- ScoreFormulaID = sfr.ScoreFormulaID,
- ScoreFormulaDetail = detailList
- };
- return detail;
- }
- }
- }
|