public void Delete(ChildEntity Child)
        {
            Node.RemoveChild(Child.Node);
            switch (Child.GetType().ToString())
            {
            case "ILR.LearningDeliveryFAM":
                this.LearningDeliveryFAMList.Remove((LearningDeliveryFAM)Child);
                break;

            case "ILR.ApprenticeshipTrailblazerFinancialDetails":
                this.ApprenticeshipTrailblazerFinancialDetailsList.Remove((ApprenticeshipTrailblazerFinancialDetails)Child);
                break;

            case "ILR.ProviderSpecDeliveryMonitoring":
                this.ProviderSpecDeliveryMonitoringList.Remove((ProviderSpecDeliveryMonitoring)Child);
                break;

            case "ILR.LearningDeliveryHE":
                this.LearningDeliveryHE = null;
                break;

            case "ILR.LearningDeliveryWorkPlacement":
                this.LearningDeliveryWorkPlacementList.Remove((LearningDeliveryWorkPlacement)Child);
                break;
            }
        }
        internal LearningDeliveryHE(LearningDeliveryHE MigrationLearningDeliveryHE, XmlNode LearningDeliveryHENode, XmlNamespaceManager NSMgr)
        {
            this.Node  = LearningDeliveryHENode;
            this.NSMgr = NSMgr;

            this.NUMHUS    = MigrationLearningDeliveryHE.NUMHUS;
            this.SSN       = MigrationLearningDeliveryHE.SSN;
            this.QUALENT3  = MigrationLearningDeliveryHE.QUALENT3;
            this.SOC2000   = MigrationLearningDeliveryHE.SOC2000;
            this.SEC       = MigrationLearningDeliveryHE.SEC;
            this.UCASAPPID = MigrationLearningDeliveryHE.UCASAPPID;
            this.TYPEYR    = MigrationLearningDeliveryHE.TYPEYR;
            this.MODESTUD  = MigrationLearningDeliveryHE.MODESTUD;
            this.FUNDLEV   = MigrationLearningDeliveryHE.FUNDLEV;
            this.FUNDCOMP  = MigrationLearningDeliveryHE.FUNDCOMP;
            this.STULOAD   = MigrationLearningDeliveryHE.STULOAD;
            this.YEARSTU   = MigrationLearningDeliveryHE.YEARSTU;
            if (MigrationLearningDeliveryHE.MSTUFEE == 16 || MigrationLearningDeliveryHE.MSTUFEE == 21)
            {
                this.MSTUFEE = 97;
            }
            else
            {
                this.MSTUFEE = MigrationLearningDeliveryHE.MSTUFEE;
            }
            this.PCOLAB   = MigrationLearningDeliveryHE.PCOLAB;
            this.PCFLDCS  = MigrationLearningDeliveryHE.PCFLDCS;
            this.PCSLDCS  = MigrationLearningDeliveryHE.PCSLDCS;
            this.PCTLDCS  = MigrationLearningDeliveryHE.PCTLDCS;
            this.SPECFEE  = MigrationLearningDeliveryHE.SPECFEE;
            this.NETFEE   = MigrationLearningDeliveryHE.NETFEE;
            this.DOMICILE = MigrationLearningDeliveryHE.DOMICILE;
        }
        public LearningDeliveryHE CreateLearningDeliveryHE()
        {
            XmlNode newNode = Node.OwnerDocument.CreateElement("LearningDeliveryHE", NSMgr.LookupNamespace("ia"));

            LearningDeliveryHE = new LearningDeliveryHE(newNode, NSMgr);
            AppendToLastOfNodeNamed(newNode, newNode.Name);
            return(LearningDeliveryHE);
        }
        internal LearningDeliveryHE(LearningDeliveryHE MigrationLearningDeliveryHE, XmlNode LearningDeliveryHENode, XmlNamespaceManager NSMgr)
        {
            this.Node  = LearningDeliveryHENode;
            this.NSMgr = NSMgr;

            this.NUMHUS = MigrationLearningDeliveryHE.NUMHUS;
            this.SSN    = MigrationLearningDeliveryHE.SSN;

            if (!string.Equals(MigrationLearningDeliveryHE.QUALENT3, "P69", StringComparison.OrdinalIgnoreCase) &&
                !string.Equals(MigrationLearningDeliveryHE.QUALENT3, "X03", StringComparison.OrdinalIgnoreCase))
            {
                this.QUALENT3 = MigrationLearningDeliveryHE.QUALENT3;
            }

            this.HEPostCode = MigrationLearningDeliveryHE.HEPostCode;
            this.ELQ        = MigrationLearningDeliveryHE.ELQ;
            this.SOC2000    = MigrationLearningDeliveryHE.SOC2000;
            this.SEC        = MigrationLearningDeliveryHE.SEC;
            this.UCASAPPID  = MigrationLearningDeliveryHE.UCASAPPID;
            this.TYPEYR     = MigrationLearningDeliveryHE.TYPEYR;
            this.MODESTUD   = MigrationLearningDeliveryHE.MODESTUD;
            this.FUNDLEV    = MigrationLearningDeliveryHE.FUNDLEV;
            this.FUNDCOMP   = MigrationLearningDeliveryHE.FUNDCOMP;
            this.STULOAD    = MigrationLearningDeliveryHE.STULOAD;
            this.YEARSTU    = MigrationLearningDeliveryHE.YEARSTU;
            if (MigrationLearningDeliveryHE.MSTUFEE == 16 || MigrationLearningDeliveryHE.MSTUFEE == 21)
            {
                this.MSTUFEE = 97;
            }
            else
            {
                this.MSTUFEE = MigrationLearningDeliveryHE.MSTUFEE;
            }
            this.PCOLAB   = MigrationLearningDeliveryHE.PCOLAB;
            this.PCFLDCS  = MigrationLearningDeliveryHE.PCFLDCS;
            this.PCSLDCS  = MigrationLearningDeliveryHE.PCSLDCS;
            this.PCTLDCS  = MigrationLearningDeliveryHE.PCTLDCS;
            this.SPECFEE  = MigrationLearningDeliveryHE.SPECFEE;
            this.NETFEE   = MigrationLearningDeliveryHE.NETFEE;
            this.GROSSFEE = MigrationLearningDeliveryHE.GROSSFEE;
            this.DOMICILE = MigrationLearningDeliveryHE.DOMICILE;
        }
        internal LearningDelivery(XmlNode Node, XmlNamespaceManager NSMgr)
        {
            this.Node  = Node;
            this.NSMgr = NSMgr;

            XmlNodeList nodes = Node.SelectNodes("./ia:LearningDeliveryFAM", NSMgr);

            foreach (XmlNode node in nodes)
            {
                LearningDeliveryFAMList.Add(new LearningDeliveryFAM(node, NSMgr));
            }

            nodes = Node.SelectNodes("./ia:ApprenticeshipTrailblazerFinancialDetails", NSMgr);
            foreach (XmlNode node in nodes)
            {
                ApprenticeshipTrailblazerFinancialDetailsList.Add(new ApprenticeshipTrailblazerFinancialDetails(node, NSMgr));
            }

            nodes = Node.SelectNodes("./ia:ProviderSpecDeliveryMonitoring", NSMgr);
            foreach (XmlNode node in nodes)
            {
                ProviderSpecDeliveryMonitoringList.Add(new ProviderSpecDeliveryMonitoring(node, NSMgr));
            }

            XmlNode learningDeliveryHENode = Node.SelectSingleNode("./ia:LearningDeliveryHE", NSMgr);

            if (learningDeliveryHENode != null)
            {
                LearningDeliveryHE = new LearningDeliveryHE(learningDeliveryHENode, NSMgr);
            }
            //else
            //LearningDeliveryHE = this.CreateLearningDeliveryHE();

            nodes = Node.SelectNodes("./ia:LearningDeliveryWorkPlacement", NSMgr);
            foreach (XmlNode node in nodes)
            {
                LearningDeliveryWorkPlacementList.Add(new LearningDeliveryWorkPlacement(node, NSMgr));
            }
        }
        internal LearningDelivery(LearningDelivery MigrationLearningDelivery, XmlNode Node, XmlNamespaceManager NSMgr)
        {
            IsImportRunning = true;
            this.Node       = Node;
            this.NSMgr      = NSMgr;

            this.LearnAimRef = MigrationLearningDelivery.LearnAimRef;
            if (MigrationLearningDelivery.AimType == 4 && MigrationLearningDelivery.HasFAM("LDM", "323"))
            {
                this.AimType  = 3;
                this.ProgType = 24;
            }
            else
            {
                this.AimType  = MigrationLearningDelivery.AimType;
                this.ProgType = MigrationLearningDelivery.ProgType;
            }
            this.AimSeqNumber       = MigrationLearningDelivery.AimSeqNumber;
            this.LearnStartDate     = MigrationLearningDelivery.LearnStartDate;
            this.OrigLearnStartDate = MigrationLearningDelivery.OrigLearnStartDate;
            this.LearnPlanEndDate   = MigrationLearningDelivery.LearnPlanEndDate;
            this.FundModel          = MigrationLearningDelivery.FundModel;
            this.FworkCode          = MigrationLearningDelivery.FworkCode;
            this.PwayCode           = MigrationLearningDelivery.PwayCode;
            this.PartnerUKPRN       = MigrationLearningDelivery.PartnerUKPRN;
            this.DelLocPostCode     = MigrationLearningDelivery.DelLocPostCode;
            if (this.AimType != 1)
            {
                this.PriorLearnFundAdj = MigrationLearningDelivery.PriorLearnFundAdj;
                this.OtherFundAdj      = MigrationLearningDelivery.OtherFundAdj;
            }
            this.ESFProjDosNumber = MigrationLearningDelivery.ESFProjDosNumber;
            this.ESFLocProjNumber = MigrationLearningDelivery.ESFLocProjNumber;
            this.EmpOutcome       = MigrationLearningDelivery.EmpOutcome;
            this.CompStatus       = MigrationLearningDelivery.CompStatus;
            this.LearnActEndDate  = MigrationLearningDelivery.LearnActEndDate;
            this.WithdrawReason   = MigrationLearningDelivery.WithdrawReason;
            this.Outcome          = MigrationLearningDelivery.Outcome;
            this.OutGrade         = MigrationLearningDelivery.OutGrade;

            foreach (LearningDeliveryFAM migrationItem in MigrationLearningDelivery.LearningDeliveryFAMList)
            {
                XmlNode             newNode     = Node.OwnerDocument.CreateElement("LearningDeliveryFAM", NSMgr.LookupNamespace("ia"));
                LearningDeliveryFAM newInstance = new LearningDeliveryFAM(migrationItem, newNode, NSMgr);
                LearningDeliveryFAMList.Add(newInstance);
                AppendToLastOfNodeNamed(newNode, newNode.Name);
            }
            foreach (ProviderSpecDeliveryMonitoring migrationItem in MigrationLearningDelivery.ProviderSpecDeliveryMonitoringList)
            {
                XmlNode newNode = Node.OwnerDocument.CreateElement("ProviderSpecDeliveryMonitoring", NSMgr.LookupNamespace("ia"));
                ProviderSpecDeliveryMonitoring newInstance = new ProviderSpecDeliveryMonitoring(migrationItem, newNode, NSMgr);
                ProviderSpecDeliveryMonitoringList.Add(newInstance);
                AppendToLastOfNodeNamed(newNode, newNode.Name);
            }
            if (MigrationLearningDelivery.LearningDeliveryHE != null)
            {
                XmlNode newNode = Node.OwnerDocument.CreateElement("LearningDeliveryHE", NSMgr.LookupNamespace("ia"));
                LearningDeliveryHE = new LearningDeliveryHE(MigrationLearningDelivery.LearningDeliveryHE, newNode, NSMgr);
                AppendToLastOfNodeNamed(newNode, newNode.Name);
            }
            IsImportRunning = false;
        }