public int SaveHourlyDataOfStationInDatabaseBasedOnCoords(string latitude, string longitude) { WeatherStationWithParamsModel nearbyWeatherStation = _weatherStationDomain.FindNearByStationFromLatLong(new FindNearbyStationModel(float.Parse(latitude, CultureInfo.InvariantCulture.NumberFormat), float.Parse(longitude, CultureInfo.InvariantCulture.NumberFormat), 8, null)); HourlyDataOfAPointQueryParams data = new HourlyDataOfAPointQueryParams( float.Parse(latitude, CultureInfo.InvariantCulture.NumberFormat), float.Parse(longitude, CultureInfo.InvariantCulture.NumberFormat), null, DateTime.Now.AddDays(-9).ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd"), null); var hourlyData = _weatherHistoryDomain.GetHourlyDataOfPoint(data, nearbyWeatherStation.Name.En); SmartIrrigationModels.Models.DTOS.Node node = _nodeDomain.GetNodeByLatLong(latitude, longitude); return(_weatherHistoryDomain.AddHourlyDataOfPointToDatabase(hourlyData, nearbyWeatherStation.Name.En, node.IdNode)); }
public SmartIrrigationModels.Models.DTOS.Node GetNodeByLatLong(string latitude, string longitude) => _nodeDomain.GetNodeByLatLong(latitude, longitude);