Exemplo n.º 1
0
        static CifRecord Parse(string record)
        {
            CifRecord cifRecord = null;

            switch (record.Substring(0, 2))
            {
            case "BS":
                cifRecord = BasicSchedule.FromCsv(record);
                break;

            case "BX":
                cifRecord = BasicScheduleExtraDetails.FromCsv(record);
                break;

            case "LO":
                cifRecord = OriginLocation.FromCsv(record);
                break;

            case "LI":
                cifRecord = IntermediateLocation.FromCsv(record);
                break;

            case "CR":
                cifRecord = ChangesEnRoute.FromCsv(record);
                break;

            case "LT":
                cifRecord = TerminatingLocation.FromCsv(record);
                break;

            default:
                break;
            }
            return(cifRecord);
        }
Exemplo n.º 2
0
        public static BasicScheduleExtraDetails FromCsv(string csvLine)
        {
            string[] values = csvLine.Split(',');

            BasicScheduleExtraDetails bx = new BasicScheduleExtraDetails
            {
                RecordIdentity = values[0],
                TractionClass  = values[1],
                //WARNING! UicCode in values[2] added at the end
                AtocCode = values[3],
                ApplicableTimetableCode = values[4],
                ReservedField1          = values[5],
                ReservedField2          = values[6],
                Spare = values[7]
            };

            Int32.TryParse(values[2], out bx.UicCode);

            return(bx);
        }