Exemple #1
0
        private static DataLockEventCommitmentsTableColumnStructure ParseDataLockEventCommitmentsTableStructure(Table dataLockEventErrors)
        {
            var structure = new DataLockEventCommitmentsTableColumnStructure();

            for (var c = 0; c < dataLockEventErrors.Header.Count; c++)
            {
                var header = dataLockEventErrors.Header.ElementAt(c);
                switch (header)
                {
                case "Price Episode identifier":
                    structure.PriceEpisodeIdentifierIndex = c;
                    break;

                case "Apprentice Version":
                    structure.ApprenticeshipVersionIndex = c;
                    break;

                case "Start Date":
                    structure.StartDateIndex = c;
                    break;

                case "framework code":
                    structure.FrameworkCodeIndex = c;
                    break;

                case "programme type":
                    structure.ProgrammeTypeIndex = c;
                    break;

                case "pathway code":
                    structure.PathwayCodeIndex = c;
                    break;

                case "standard code":
                    structure.StandardCodeIndex = c;
                    break;

                case "Negotiated Price":
                    structure.NegotiatedPriceIndex = c;
                    break;

                case "Effective Date":
                    structure.EffectiveDateIndex = c;
                    break;
                }
            }

            if (structure.PriceEpisodeIdentifierIndex == -1)
            {
                throw new ArgumentException("Data lock event commitments table is missing Price Episode identifier column");
            }

            return(structure);
        }
Exemple #2
0
 private static DataLockEventCommitmentReferenceData ParseDataLockEventsRow(TableRow row, DataLockEventCommitmentsTableColumnStructure structure, LookupContext lookupContext)
 {
     return(new DataLockEventCommitmentReferenceData
     {
         PriceEpisodeIdentifier = row.ReadRowColumnValue <string>(structure.PriceEpisodeIdentifierIndex, "Price Episode identifier"),
         ApprenticeshipVersion = row.ReadRowColumnValue <string>(structure.ApprenticeshipVersionIndex, "Apprentice Version"),
         StartDate = row.ReadRowColumnValue <DateTime>(structure.StartDateIndex, "Start Date"),
         FrameworkCode = row.ReadRowColumnValue <int>(structure.FrameworkCodeIndex, "framework code"),
         ProgrammeType = row.ReadRowColumnValue <int>(structure.ProgrammeTypeIndex, "programme type"),
         PathwayCode = row.ReadRowColumnValue <int>(structure.PathwayCodeIndex, "pathway code"),
         StandardCode = row.ReadRowColumnValue <long>(structure.StandardCodeIndex, "standard code"),
         NegotiatedPrice = row.ReadRowColumnValue <int>(structure.NegotiatedPriceIndex, "Negotiated Price"),
         EffectiveDate = row.ReadRowColumnValue <DateTime>(structure.EffectiveDateIndex, "Effective Date"),
     });
 }