1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.ViewModel.SelectCourse;
- using EMIS.ViewModel;
- using EMIS.ViewModel.CalendarManage;
- using EMIS.CommonLogic.CalendarManage;
- namespace EMIS.CommonLogic.SelectCourse
- {
- public class ConditionServices : BaseServices, IConditionServices
- {
- public Lazy<IParameterServices> ParameterServices { get; set; }
- public Lazy<ISchoolYearServices> SchoolYearServices { get; set; }
- public SelectCourseConditionView GetSelectCourseConditionView()
- {
- var result = new SelectCourseConditionView();
- result.Schoolyear = ParameterServices.Value.GetParameterValue<Guid>(CF_ParameterType.SelectCourseSchoolyear);
- result.CrossGrade = ParameterServices.Value.GetParameterValue<bool>(CF_ParameterType.SelectCourseCrossGrade) ?? false;
- result.IsNoLimit = ParameterServices.Value.GetParameterValue<bool>(CF_ParameterType.SelectCourseNoLimit) ?? false;
- return result;
- }
- public void Save(SelectCourseConditionView conditionView)
- {
- ParameterServices.Value.SaveTo(CF_ParameterType.SelectCourseSchoolyear, conditionView.Schoolyear.Value);
- ParameterServices.Value.SaveTo(CF_ParameterType.SelectCourseCrossGrade, conditionView.CrossGrade);
- ParameterServices.Value.SaveTo(CF_ParameterType.SelectCourseNoLimit, conditionView.IsNoLimit);
- }
- public SchoolYearView GetSelectCourseSchoolyear()
- {
- var selectCourseSchoolyearID = ParameterServices.Value.GetParameterValue<Guid>(CF_ParameterType.SelectCourseSchoolyear);
- if (!selectCourseSchoolyearID.HasValue)
- {
- return SchoolYearServices.Value.GetCurrentSchoolYear();
- }
- else
- {
- return SchoolYearServices.Value.GetSchoolYearView(selectCourseSchoolyearID);
- }
- }
- }
- }
|