public WeatherInfo GetWeatherInfo(int id) { try { WeatherInfo weather = db.WeatherInfo.Find(id); return(weather); } catch { throw; } }
public int UpdateWeather(WeatherInfo weather) { try { db.Entry(weather).State = EntityState.Modified; db.SaveChanges(); return(1); } catch { throw; } }
public int AddWeatherInfo(WeatherInfo weather) { try { db.WeatherInfo.Add(weather); db.SaveChanges(); return(1); } catch { System.Diagnostics.Trace.WriteLine(weather); throw; } }
public int DeleteWeatherInfo(int id) { try { WeatherInfo emp = db.WeatherInfo.Find(id); db.WeatherInfo.Remove(emp); db.SaveChanges(); return(1); } catch { throw; } }