Exemplo n.º 1
0
        private static DataLockEventErrorsTableColumnStructure ParseDataLockEventsTableStructure(Table dataLockEventErrors)
        {
            var structure = new DataLockEventErrorsTableColumnStructure();

            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 "Error code":
                    structure.ErrorCodeIndex = c;
                    break;

                case "Error Description":
                    structure.ErrorDescriptionIndex = c;
                    break;
                }
            }

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

            return(structure);
        }
Exemplo n.º 2
0
 private static DataLockEventErrorReferenceData ParseDataLockEventsRow(TableRow row, DataLockEventErrorsTableColumnStructure structure, LookupContext lookupContext)
 {
     return(new DataLockEventErrorReferenceData
     {
         PriceEpisodeIdentifier = row.ReadRowColumnValue <string>(structure.PriceEpisodeIdentifierIndex, "Price Episode identifier"),
         ErrorCode = row.ReadRowColumnValue <string>(structure.ErrorCodeIndex, "Error code"),
         ErrorDescription = row.ReadRowColumnValue <string>(structure.ErrorDescriptionIndex, "Error Description")
     });
 }