Exemplo n.º 1
0
 public WeatherInfo GetWeatherInfo(int id)
 {
     try
     {
         WeatherInfo weather = db.WeatherInfo.Find(id);
         return(weather);
     }
     catch
     {
         throw;
     }
 }
Exemplo n.º 2
0
        public int UpdateWeather(WeatherInfo weather)
        {
            try
            {
                db.Entry(weather).State = EntityState.Modified;
                db.SaveChanges();

                return(1);
            }
            catch
            {
                throw;
            }
        }
Exemplo n.º 3
0
 public int AddWeatherInfo(WeatherInfo weather)
 {
     try
     {
         db.WeatherInfo.Add(weather);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         System.Diagnostics.Trace.WriteLine(weather);
         throw;
     }
 }
Exemplo n.º 4
0
 public int DeleteWeatherInfo(int id)
 {
     try
     {
         WeatherInfo emp = db.WeatherInfo.Find(id);
         db.WeatherInfo.Remove(emp);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }