コード例 #1
0
 public void Add(STATION_BUSES stationBus)
 {
     dBase.STATION_BUSES.Add(stationBus);
     dBase.SaveChanges();
 }
コード例 #2
0
 public void AddStation_Buses_Route(ROUTE route, STATION_BUSES stationBus)
 {
     dBase.STATION_BUSES.Add(stationBus);
     dBase.SaveChanges();
 }
コード例 #3
0
ファイル: UploadKML.cs プロジェクト: emilioweba/BusProject
        private bool parsePoint(Placemark placemark, DBStation_Bus dbStationBus, DBStation dbStation, BUS bus, ROUTE route, bool hasStation)
        {
            foreach (var lineString in placemark.Flatten().OfType<SharpKml.Dom.Point>())
            {
                IList<STATION> stationsNear = dbStation.SelectStationsNear(50,
                    Methods.ConvertLatLonToDbGeography(lineString.Coordinate.Longitude, lineString.Coordinate.Latitude));

                foreach (var station in stationsNear)
                {
                    STATION_BUSES stationBus = new STATION_BUSES();

                    stationBus.STATION = station;
                    stationBus.BUS = bus;

                    dbStationBus.AddStation_Buses_Route(route, stationBus);
                    hasStation = true;
                }
            }
            return hasStation;
        }