public ActionResult Index(WeatherInfoViewModel model) { if (ModelState.IsValid == false) { return View( new WeatherInfoViewModel { WeatherCode = model.WeatherCode, WeatherInfo = null }); } var weatherBug = new WeatherBug.WeatherBug(); var info = weatherBug.checkWeather(WeatherBug.WeatherTypeEnum.ZipCode, model.WeatherCode.ToString()); var viewModel = new WeatherInfoViewModel { WeatherCode = model.WeatherCode, WeatherInfo = info }; return View(viewModel); }
public ActionResult Index(WeatherInfoViewModel model) { if (ModelState.IsValid == false) { return(View(new WeatherInfoViewModel { WeatherCode = model.WeatherCode, WeatherInfo = null })); } var weatherBug = new WeatherBug.WeatherBug(); var info = weatherBug.checkWeather(WeatherBug.WeatherTypeEnum.ZipCode, model.WeatherCode.ToString()); var viewModel = new WeatherInfoViewModel { WeatherCode = model.WeatherCode, WeatherInfo = info }; return(View(viewModel)); }