public ActionResult PlaceInput([Bind(Include = "Place")] ViewModel model) { /* * Put in a try catch here, and then send * */ if (ModelState.IsValid) { var place = model.place; var time = DateTime.Now; var placeService = new PlaceServiceTest(); string region = placeService.GetRegion(place); NewWeather weatherIno = placeService.GetWeatherinfo(place, region); var latitude = 51.508742; Weather weather = new Weather { longitude = 12, latitude = 123, place = "stockholm" }; TempData["weatherObject"] = weatherIno; TempData["latitude"] = weatherIno.latitude; TempData["longitude"] = weatherIno.longitude; return(RedirectToAction("GetMap")); } return(View()); }
public ActionResult FindCity([Bind(Include = "Place")] ViewModel model) { if (ModelState.IsValid) { var place = model.place; var time = DateTime.Now; var placeService = new PlaceServiceTest(); var placeInfo = placeService.GetCoordinates(place); //the rigt one //convert the coordinates to the right types, then adjust the xml-request and create the complete object in the placeService class. Weather weather = new Weather { }; return(RedirectToAction("Index")); } return(View()); }