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 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(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(); } } }