public IActionResult ShowTimeTemp(WeatherVm weather)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index", weather));
            }
            else
            {
                try
                {
                    var        service = new SmhiService();
                    Rootobject result  = service.GetMeteorologicalForecast(weather.Longitude, weather.Latitude).Result;

                    //List<TimeTemp> timetemps = service.FilterTemperature(result, DateTime.Now);


                    weather.Temps = service.FilterTemperature(result, DateTime.Now);
                }
                catch (Exception)
                {
                    ViewData["Error"] = "FEL FEL FEL!!!!";
                }
                return(View("Index", weather));
            }
        }
        public IActionResult ShowWeather(WeatherVm w)
        {
            var service = new SmhiService();
            var result  = service.GetMeterologicalForecast(w.Longitude, w.Latitude).Result;

            List <TimeTemp> timetemps = service.FilterTemperature(result, DateTime.Now);

            w.TimeTemps = timetemps;

            return(View("Index", w));
        }
 public IActionResult Index(WeatherVm w)
 {
     return(View(w));
 }
예제 #4
0
 public SearchCommand(WeatherVm vm)
 {
     VM = vm;
 }