Beispiel #1
0
        /// <summary>
        /// 刪除資料
        /// </summary>
        /// <param name="id">欲刪除編號</param>
        public void Delete(int id)
        {
            WeatherReportTable value = this.WeatherDBEntities
                                       .WeatherReportTables.Where(i => i.WeatherReportId == id)
                                       .FirstOrDefault();

            this.WeatherDBEntities.WeatherReportTables.Remove(value);

            this.Save();
        }
Beispiel #2
0
 /// <summary>
 /// 新增資料
 /// </summary>
 /// <param name="obj">天氣預報模型</param>
 public void Add(WeatherReportTable obj)
 {
     this.WeatherDBEntities.WeatherReportTables.Add(obj);
     this.Save();
 }