12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel.ScoreManage;
- using EMIS.DataLogic.ScoreManage;
- using EMIS.Entities;
- using EMIS.Utility;
- using EMIS.ViewModel;
- namespace EMIS.CommonLogic.ScoreManage
- {
- public class ExamsCategorySettingServices : BaseServices, IExamsCategorySettingServices
- {
- public ExamsCategorySettingDAL ExamsCategorySettingDAL { get; set; }
- public List<ExamsCategorySettingView> GetExamsCategorySettingViewList()
- {
- return ExamsCategorySettingDAL.GetExamsCategorySettingView().ToList();
- }
- public void SaveExamsCategorySetting(IList<int> examsCategoryIDList)
- {
- List<ER_ExamsCategorySetting> insertSettingList = new List<ER_ExamsCategorySetting>();
- UnitOfWork.Delete<ER_ExamsCategorySetting>(x => true);
- var examsCategorySettingViewList = (from category in DictionaryHelper.GetDictionaryValue(DictionaryItem.CF_ExamsCategory)
- select new { ExamsCategoryID = category.Value, IsReadHistory = examsCategoryIDList.Contains(category.Value.Value) });
- foreach (var examsCategorySettingView in examsCategorySettingViewList)
- {
- ER_ExamsCategorySetting newSetting = new ER_ExamsCategorySetting();
- newSetting.ExamsCategorySettingID = Guid.NewGuid();
- newSetting.ExamsCategoryID = examsCategorySettingView.ExamsCategoryID;
- newSetting.IsReadHistory = examsCategorySettingView.IsReadHistory;
- this.SetNewStatus(newSetting);
- insertSettingList.Add(newSetting);
- }
- UnitOfWork.BulkInsert(insertSettingList);
- }
- }
- }
|