FacultymajorStudentCountServices.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Common.Students.HighBaseTable;
  6. using EMIS.Entities;
  7. namespace EMIS.CommonLogic.Students.HighBaseTable
  8. {
  9. public class FacultymajorStudentCountServices : BaseServices, IFacultymajorStudentCountServices
  10. {
  11. public FacultymajorStudentCountDAL FacultymajorStudentCountDAL { get; set; }
  12. public void GenerateReport(int year)
  13. {
  14. var insertList = new List<HB_FacultymajorStudentCount>();
  15. var facultyStudentCountList = FacultymajorStudentCountDAL.GetFacultymajorStudentCountViewQueryable(year).ToList();
  16. this.UnitOfWork.Delete<HB_FacultymajorStudentCount>(x => x.Year == year);
  17. facultyStudentCountList.ForEach(x =>
  18. {
  19. var facultyStudentCount = new HB_FacultymajorStudentCount
  20. {
  21. FacultymajorStudentCountID = Guid.NewGuid(),
  22. Year = year,
  23. EducationTypeID = x.EducationTypeID,
  24. StandardID = x.StandardID,
  25. FacultymajorID = x.FacultymajorID,
  26. Sex = x.SexID,
  27. LastGraduateCount = x.LastGraduateCount,
  28. RecruitstudentsCount = x.RecruitstudentsCount,
  29. FreshGraduateCount = x.FreshGraduateCount,
  30. GradeOneCount = x.GradeOneCount,
  31. GradeTwoCount = x.GradeTwoCount,
  32. GradeThreeCount = x.GradeThreeCount,
  33. AfterGradeFourCount = x.AfterGradeFourCount,
  34. PlanGraduateCount = x.PlanGraduateCount
  35. };
  36. this.SetNewStatus(facultyStudentCount);
  37. insertList.Add(facultyStudentCount);
  38. });
  39. this.UnitOfWork.BulkInsert(insertList);
  40. }
  41. }
  42. }