Esempio n. 1
0
        public object GetWeatherForecastByIdNode(int idNode)
        {
            SmartIrrigationModels.Models.DTOS.Node node = _nodeDomain.GetAllActiveNodes()
                                                          .Where(x => x.IdNode == idNode).FirstOrDefault();
            Location nodeLocation = _locationDomain.RetrieveLocationByNodeId(node.IdNode);

            return(_weatherForecastDomain.GetWeatherForecast(nodeLocation.Latitude, nodeLocation.Longitude));
        }
Esempio n. 2
0
        public void UpdateWeatherConditionsForAllActiveNodes()
        {
            //first get all active nodes

            List <SmartIrrigationModels.Models.DTOS.Node> activeNodes = _nodeDomain.GetAllActiveNodes().ToList();

            foreach (var node in activeNodes)
            {
                Location loc = _locationDomain.RetrieveLocationByNodeId(node.IdNode);
                SaveHourlyDataOfStationInDatabaseBasedOnCoords(loc.Latitude, loc.Longitude);
            }
        }
 public SmartIrrigationModels.Models.DTOS.Location RetrieveLocationByNodeId(int nodeId) =>
 _locationDomain.RetrieveLocationByNodeId(nodeId);