Beispiel #1
0
 public void updateStation(int id, string name, string address, string country, string state)
 {
     StationCtr sCtr = new StationCtr();
     sCtr.updateStation(id, name, address, country, state);
 }
Beispiel #2
0
 public void addStation(string name, string address, string country, string state)
 {
     StationCtr sCtr = new StationCtr();
     sCtr.addStation(name, address, country, state);
 }
Beispiel #3
0
 public void addNaborStation(int id1, int id2, decimal distance, decimal drivehour)
 {
     StationCtr sCtr = new StationCtr();
     sCtr.addConnection(id1, id2, distance, drivehour);
 }
Beispiel #4
0
 public void updateNaborStation(int id1, int id2, decimal distance, decimal driveHour)
 {
     StationCtr sCtr = new StationCtr();
     sCtr.updateConnection(id1, id2, distance, driveHour);
 }
Beispiel #5
0
        public Station getStation(int id)
        {
            StationCtr sCtr = new StationCtr();
            MStation s = null;
            try
            {
                s = sCtr.getStation(id, false);
            }
            catch (NullReferenceException)
            {
            }

            Station ns = new Station();
            if (s != null)
            {
                ns.Id = s.Id;
                ns.Name = s.name;
                ns.State = s.state.ToString();
                ns.Country = s.country;
                ns.Address = s.address;
            }

            return ns;
        }
Beispiel #6
0
 public bool isConnectionExist(int id1, int id2)
 {
     StationCtr sCtr = new StationCtr();
     bool isExist = sCtr.isConnectionExist(id1, id2);
     return isExist;
 }
Beispiel #7
0
 public List<string> getStates()
 {
     StationCtr sCtr = new StationCtr();
     return sCtr.getStates();
 }
Beispiel #8
0
 public List<NaborStation> getNaborStations(int id)
 {
     StationCtr sCtr = new StationCtr();
     List<NaborStation> nbs = new List<NaborStation>();
     List<MConnection> cs = sCtr.getNaborStations(id);
     foreach (MConnection c in cs)
     {
         NaborStation n = new NaborStation();
         if (c.Station1 != null)
         {
             n.Id = c.Station1.Id;
             n.Name = c.Station1.name;
             n.Address = c.Station1.address;
         }
         else
         {
             n.Id = c.Station2.Id;
             n.Name = c.Station2.name;
             n.Address = c.Station2.address;
         }
         n.Distance = Convert.ToDouble(c.distance);
         n.DriveHour = Convert.ToDouble(c.driveHour);
         nbs.Add(n);
     }
     return nbs;
 }
Beispiel #9
0
        public List<Station> getAllStations()
        {
            using (StationCtr sCtr = new StationCtr())
            {
                List<Station> ss = new List<Station>();
                List<MStation> stations = sCtr.getAllStation();
                foreach (MStation item in stations)
                {
                    Station s = new Station() { Id = item.Id, Name = item.name, Address = item.address, Country = item.country, State = item.state.ToString() };
                    ss.Add(s);

                }
                return ss;
            }
        }
Beispiel #10
0
 public void deleteStation(int id)
 {
     StationCtr sCtr = new StationCtr();
     sCtr.deleteStation(id);
 }
Beispiel #11
0
 public void deleteNaborStation(int id1, int id2)
 {
     StationCtr sCtr = new StationCtr();
     sCtr.deleteConnection(id1, id2);
 }