using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.DataLogic.Common.Students.HighBaseTable; using EMIS.Entities; namespace EMIS.CommonLogic.Students.HighBaseTable { public class FacultymajorStudentCountServices : BaseServices, IFacultymajorStudentCountServices { public FacultymajorStudentCountDAL FacultymajorStudentCountDAL { get; set; } public void GenerateReport(int year) { var insertList = new List(); var facultyStudentCountList = FacultymajorStudentCountDAL.GetFacultymajorStudentCountViewQueryable(year).ToList(); this.UnitOfWork.Delete(x => x.Year == year); facultyStudentCountList.ForEach(x => { var facultyStudentCount = new HB_FacultymajorStudentCount { FacultymajorStudentCountID = Guid.NewGuid(), Year = year, EducationTypeID = x.EducationTypeID, StandardID = x.StandardID, FacultymajorID = x.FacultymajorID, Sex = x.SexID, LastGraduateCount = x.LastGraduateCount, RecruitstudentsCount = x.RecruitstudentsCount, FreshGraduateCount = x.FreshGraduateCount, GradeOneCount = x.GradeOneCount, GradeTwoCount = x.GradeTwoCount, GradeThreeCount = x.GradeThreeCount, AfterGradeFourCount = x.AfterGradeFourCount, PlanGraduateCount = x.PlanGraduateCount }; this.SetNewStatus(facultyStudentCount); insertList.Add(facultyStudentCount); }); this.UnitOfWork.BulkInsert(insertList); } } }