Esempio n. 1
0
        public int LoadFromCsv(string path)
        {
            var result = _session.Execute("select * from detector_for_stations limit 1;");

            if (result.Any())
            {
                return(0);
            }
            //detectorid,highwayid,milepost,locationtext,detectorclass,lanenumber,stationid
            var loader = new CsvLoader(_session, path, @"insert into detector_for_stations (stationid, lanenumber,	locationtext, detectorid) values ({0},{1},'{2}',{3})");

            return(loader.Load());
        }
        public int LoadFromCsv(string path)
        {
            var result = _session.Execute("select * from highways limit 1;");

            if (result.Any())
            {
                return(0);
            }

            var loader = new CsvLoader(_session, path, "insert into highways (highwayid, shortdirection, direction, highwayname) values ({0},'{1}','{2}','{3}')");

            return(loader.Load());
        }
Esempio n. 3
0
        public int LoadFromCsv(string path)
        {
            var result = _session.Execute("select * from loopdata_by_detectorid limit 1;");

            if (result.Any())
            {
                return(0);
            }
            //detectorid,starttime,volume,speed,occupancy,status,dqflags

            var loader = new CsvLoader(_session, path, @"insert into loopdata_by_detectorid (detectorid, starttime, volume,	speed, occupancy, status, dqflags) values ({0},'{1}',{2},{3},{4},{5},{6})");

            return(loader.Load());
        }
        public int LoadFromCsv(string path)
        {
            var result = _session.Execute("select * from stations_northbound limit 1;");

            if (result.Any())
            {
                return(0);
            }
            //create table stations_northbound (stationid int primary key, milepost float, locationtext text, upstream int, downstream int, numberlanes int, latlon text, length float);
            var loader = new CsvLoader(_session, path, @"insert into stations_northbound (stationid, milepost, locationtext, upstream, downstream, numberlanes, latlon, length) 
                                                        values ({0},{1},'{2}',{3},{4},{5},'{6}',{7})");

            return(loader.Load());
        }