// GET: Weathers/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WeatherAppServices.Weather weather = client.DeleteWeather(id); if (weather == null) { return(HttpNotFound()); } return(View(weather)); }
public ActionResult Create([Bind(Include = "Id,HumidityPercent,Wind,Temperature,Date,City,Country")] Models.Weather weather) { if (ModelState.IsValid) { WeatherAppServices.Weather weatherService = new WeatherAppServices.Weather(); weatherService.Id = weather.Id; weatherService.HumidityPercent = weather.HumidityPercent; weatherService.Wind = weather.Wind; weatherService.Temperature = weather.Temperature; weatherService.Date = weather.Date; weatherService.City = weather.City; weatherService.Country = weather.Country; client.SubmitWeather(weatherService); return(RedirectToAction("Index")); } return(View(weather)); }
// GET: Weathers/Edit/5 public ActionResult Edit(int?id) { WeatherAppServices.Weather weather = client.DeleteWeather(id); Models.Weather weatherWeb = new Models.Weather(); weatherWeb.Date = DateTime.Now; weatherWeb.Id = weather.Id; weatherWeb.HumidityPercent = weather.HumidityPercent; weatherWeb.Wind = weather.Wind; weatherWeb.Temperature = weather.Temperature; weatherWeb.City = weather.City; weatherWeb.Country = weather.Country; if (weatherWeb == null) { return(HttpNotFound()); } return(View(weatherWeb)); }
public ActionResult DeleteConfirmed(int id) { WeatherAppServices.Weather weather = client.confirmDeleteWeather(id); return(RedirectToAction("Index")); }