123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Common.Students.HighBaseTable;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.Entities;
- namespace EMIS.CommonLogic.Students.HighBaseTable
- {
- public class StudentQuitReasonServices : BaseServices, IStudentQuitReasonServices
- {
- public StudentQuitReasonDAL StudentQuitReasonDAL { get; set; }
- public Lazy<IWorkflowServices> WorkflowServices { get; set; }
- public void GenerateReport(int year)
- {
- var endStatusID = WorkflowServices.Value.GetCorrectEndStatus(typeof(CF_DifferentDynamic).Name);
- //获取异动学生数
- var studentQuitReasonList = StudentQuitReasonDAL.GetStudentQuitStudentCount(year, endStatusID).ToList();
- this.UnitOfWork.Remove<HB_StudentQuitReason>(x => x.Year == year);
- studentQuitReasonList.ForEach(x =>
- {
- var studentQuitReason = new HB_StudentQuitReason
- {
- StudentQuitReasonID = Guid.NewGuid(),
- Year = year,
- EducationTypeID = x.EducationTypeID,
- StudentChangeReasonTypeID = x.StudentChangeReasonTypeID,
- Count = x.StudentCount
- };
- this.SetNewStatus(studentQuitReason);
- this.UnitOfWork.Add(studentQuitReason);
- });
- this.UnitOfWork.Commit();
- }
- }
- }
|