Esempio 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);
        }
        public static TerminatingLocation FromCsv(string csvLine)
        {
            string[]            values = csvLine.Split(',');
            TerminatingLocation lt     = new TerminatingLocation
            {
                RecordIdentity   = values[0],
                Location         = values[1],
                ScheduledArrival = values[2],
                //WARNING! PublicArrival in values[3] added at the end
                Platform      = values[4],
                Path          = values[5],
                Activity      = values[6],
                ReservedField = values[7],
                Spare         = values[8]
            };

            Int32.TryParse(values[3], out lt.PublicArrival);

            return(lt);
        }