/// <summary> /// Remove station from the database /// </summary> /// <param name="station"></param> public void RemoveStation(BO.Station station) { var stationDo = station.CopyPropertiesToNew(typeof(DO.Station)) as DO.Station; try { dl.RemoveStation(stationDo); } catch (DO.BadStationException ex) { throw new BO.BadStationException(station.Code, ex.Message); } }
/// <summary> /// Add new station to the database /// </summary> /// <param name="station"></param> public void AddStation(BO.Station station) { var stationDo = station.CopyPropertiesToNew(typeof(DO.Station)) as DO.Station; try { if (!validLatLon(stationDo.Latitude, stationDo.Longitude)) { throw new BO.BadStationException(stationDo.Code, "The location entered is outside the earth"); } dl.AddStation(stationDo); } catch (DO.BadStationException ex) { throw new BO.BadStationException(station.Code, ex.Message); } }