12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel;
- using EMIS.ViewModel.RetakeManage;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.DataLogic.RetakeManage;
- using EMIS.Entities;
- namespace EMIS.CommonLogic.RetakeManage
- {
- public class RetakeParameterServices : BaseServices, IRetakeParameterServices
- {
- public RetakeParameterDAL RetakeParameterDAL { get; set; }
- public Lazy<IParameterServices> ParameterServices { get; set; }
- /// <summary>
- /// 重修参数设定信息View
- /// </summary>
- /// <returns></returns>
- public RetakeParameterView GetRetakeParameterView()
- {
- var retakeParamterView = new RetakeParameterView();
- //重修对应的学年学期
- retakeParamterView.SchoolyearID = ParameterServices.Value.GetParameterValue<Guid>(CF_ParameterType.RetakeSchoolyearID);
- //重修对应的考试性质
- retakeParamterView.ExamsCategoryID = ParameterServices.Value.GetParameterValue<int>(CF_ParameterType.RetakeExamsCatagoryID);
-
- //重修对应的收费项目
- retakeParamterView.RetakeChargeProjectID = ParameterServices.Value.GetParameterValue<Guid>(CF_ParameterType.RetakeChargeProjectID);
- //重修对应的缴费控制
- retakeParamterView.IsRetakeChargeControl = ParameterServices.Value.GetParameterValue<bool>(CF_ParameterType.RetakeChargeControl) == true;
- return retakeParamterView;
- }
- /// <summary>
- /// 重修对应的预查考试性质信息List
- /// </summary>
- /// <returns></returns>
- public List<RetakeExamsCategoryView> GetExamsCategoryViewList()
- {
- return RetakeParameterDAL.GetRetakeExamsCategoryViewQuery().ToList();
- }
- /// <summary>
- /// 重修参数设定设置
- /// </summary>
- /// <param name="retakeParameterView"></param>
- /// <param name="retakeExamsCategoryViewList"></param>
- public void SaveParameterView(RetakeParameterView retakeParameterView, IList<RetakeExamsCategoryView> retakeExamsCategoryViewList)
- {
- try
- {
- //预查考试性质List
- var insertList = retakeExamsCategoryViewList.Where(x => x.IsSelected)
- .Select(x => new ER_RetakeExamsCatagory()
- {
- RetakeExamsCatagoryID = Guid.NewGuid(),
- ExamsCategoryID = x.ExamsCategoryID
- }).ToList();
- if (insertList == null || insertList.Count() <= 0)
- {
- throw new Exception("预查考试性质不能为空,请选择。");
- }
- else
- {
- //重修对应的学年学期
- ParameterServices.Value.SaveTo(CF_ParameterType.RetakeSchoolyearID, retakeParameterView.SchoolyearID);
- //重修对应的考试性质
- ParameterServices.Value.SaveTo(CF_ParameterType.RetakeExamsCatagoryID, retakeParameterView.ExamsCategoryID);
- //重修对应的收费项目
- ParameterServices.Value.SaveTo(CF_ParameterType.RetakeChargeProjectID, retakeParameterView.RetakeChargeProjectID);
- //重修对应的缴费控制
- ParameterServices.Value.SaveTo(CF_ParameterType.RetakeChargeControl, retakeParameterView.IsRetakeChargeControl);
- insertList.ForEach(x => this.SetNewStatus(x));
- UnitOfWork.Delete<ER_RetakeExamsCatagory>(x => true);
- UnitOfWork.BulkInsert(insertList);
- }
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- }
- }
|