I am re-wording this from an original post I made: I have two XML files, and they are related to a given year each. For example, 18/19 and 17/18. They conform to the same structure and below is small sample from one of these files. What I want is, in C#, to compare all records in these files where the Given Name, the Family Name, the NI Number and the Date of birth are the same, BUT the Learner Ref Number is different. I need to be able to compare, then push only these records into a data table so I can then push them into a spreadsheet (the spreadsheet bit I can do). I currently have the below as a starting block, but am still very much stuck.
Firstly, I have my Import button press for which:
private void Btn_Import_Click(object sender, RoutedEventArgs e)
{
ILRChecks.ILRReport.CrossYear();
}
Then this goes to look at the Class of which eventually pushes the file to my location:
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ILRValidation;
using InfExcelExtension;
namespace ILRChecks
{
internal static partial class ILRReport
{
internal static void CrossYear()
{
DataSet ds_CrossYearChecks =
ILRValidation.Validation.CrossYearChecks(Global.fileNames);
string output = Path.Combine(Global.foldername, "ULIN_Issues" +
".xlsx");
ds_CrossYearChecks.ToWorkBook(output);
}
}
}
And this is the bit I'm stuck on, which is the production of finding the differences:
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ILRValidation
{
public static partial class Validation
{
public static DataSet CrossYearChecks(DataSet ds_CrossYearChecks)
{
return CrossYearChecks(ds_CrossYearChecks);
}
public static DataSet CrossYearChecks(string[] xmlPath)
{
DataSet ds_xmlCrossYear = new DataSet();
return CrossYearChecks(ds_xmlCrossYear);
}
}
}
XML:
<Learner>
<LearnRefNumber></LearnRefNumber>
<ULN></ULN>
<FamilyName></FamilyName>
<GivenNames></GivenNames>
<DateOfBirth></DateOfBirth>
<Ethnicity></Ethnicity>
<Sex></Sex>
<LLDDHealthProb></LLDDHealthProb>
<NINumber></NINumber>
<PriorAttain></PriorAttain>
<MathGrade></MathGrade>
<EngGrade></EngGrade>
<PostcodePrior></PostcodePrior>
<Postcode></Postcode>
<AddLine1></AddLine1>
<AddLine3></AddLine3>
<Email></Email>
<LearnerEmploymentStatus>
<EmpStat>10</EmpStat>
<DateEmpStatApp>2015-09-01</DateEmpStatApp>
<EmpId>153421665</EmpId>
<EmploymentStatusMonitoring>
<ESMType>LOE</ESMType>
<ESMCode>4</ESMCode>
</EmploymentStatusMonitoring>
<EmploymentStatusMonitoring>
<ESMType>EII</ESMType>
<ESMCode>4</ESMCode>
</EmploymentStatusMonitoring>
</LearnerEmploymentStatus>
<LearningDelivery>
<LearnAimRef></LearnAimRef>
<AimType></AimType>
<AimSeqNumber></AimSeqNumber>
<LearnStartDate></LearnStartDate>
<LearnPlanEndDate></LearnPlanEndDate>
<FundModel></FundModel>
<ProgType></ProgType>
<StdCode></StdCode>
<DelLocPostCode></DelLocPostCode>
<CompStatus></CompStatus>
<SWSupAimId></SWSupAimId>
<LearningDeliveryFAM>
<LearnDelFAMType></LearnDelFAMType>
<LearnDelFAMCode></LearnDelFAMCode>
<LearnDelFAMDateFrom></LearnDelFAMDateFrom>
</LearningDeliveryFAM>
<LearningDeliveryFAM>
<LearnDelFAMType></LearnDelFAMType>
<LearnDelFAMCode></LearnDelFAMCode>
</LearningDeliveryFAM>
<LearningDeliveryFAM>
<LearnDelFAMType></LearnDelFAMType>
<LearnDelFAMCode></LearnDelFAMCode>
</LearningDeliveryFAM>
<LearningDeliveryFAM>
<LearnDelFAMType></LearnDelFAMType>