private static void CheckTable(GtfsTable gtfsTable, String extension, HttpServerUtility server)
 {
     gtfsTable.FilePath = String.Format("/parsed/{0}{1}", gtfsTable.Name, extension);
     var fileInfo = new FileInfo(server.MapPath(gtfsTable.FilePath));
     gtfsTable.Extension = fileInfo.Extension;
     gtfsTable.Exists = fileInfo.Exists;
     gtfsTable.LastUpdateUtc = fileInfo.LastWriteTimeUtc;
 }
Beispiel #2
0
    private static void CheckTable(GtfsTable gtfsTable, String extension, HttpServerUtility server)
    {
        gtfsTable.FilePath = String.Format("/parsed/{0}{1}", gtfsTable.Name, extension);
        var fileInfo = new FileInfo(server.MapPath(gtfsTable.FilePath));

        gtfsTable.Extension     = fileInfo.Extension;
        gtfsTable.Exists        = fileInfo.Exists;
        gtfsTable.LastUpdateUtc = fileInfo.LastWriteTimeUtc;
    }
Beispiel #3
0
        private void createCalendar(string path)
        {
            using (GtfsTable table = new GtfsTable(path + "\\calendar_dates.txt"))
                using (StreamWriter outFile = new StreamWriter(new FileStream(path + "\\calendar.txt", FileMode.Create, FileAccess.Write)))
                {
                    HashSet <string> ids = new HashSet <string>();

                    outFile.WriteLine("service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date");
                    foreach (var record in table.Records)
                    {
                        if (!ids.Contains(record["service_id"]))
                        {
                            ids.Add(record["service_id"]);
                            outFile.WriteLine(record["service_id"] + ",0,0,0,0,0,0,0,20120101,20120101");
                        }
                    }
                }
        }