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 RecruitTerritorialReportServices : BaseServices, IRecruitTerritorialReportServices { public RecruitTerritorialReportDAL RecruitTerritorialReportDAL { get; set; } public void GenerateReport(int year) { var insertList = new List(); var recruitTerritorialReportList = RecruitTerritorialReportDAL.GetRecruitTerritorialReportView(year).ToList(); this.UnitOfWork.Delete(x => x.Year == year); recruitTerritorialReportList.ForEach(x => { var recruitTerritorialReport = new HB_RecruitTerritorialReport { RecruitTerritorialReportID = Guid.NewGuid(), Year = year, Territorial = x.Territorial, EducationTypeID = x.EducationTypeID, RecruitCategoryID = x.RecruitCategoryID, IsFreshGraduate = x.IsFreshGraduate, IsCountry = x.IsCountry, RecruitCount = x.RecruitCount }; this.SetNewStatus(recruitTerritorialReport); insertList.Add(recruitTerritorialReport); }); this.UnitOfWork.BulkInsert(insertList); } } }