/// <summary> /// 更新 /// </summary> /// <param name="item"></param> /// <returns></returns> public virtual int Update(WaveAnnal item) { var result = -1; using (var db = new MbContext()) { db.WaveAnnal.AddOrUpdate(item); result = db.SaveChanges(); } return(result); }
/// <summary> /// 增加 /// </summary> /// <param name="model"></param> /// <returns></returns> public virtual int Save(WaveAnnal model) { var result = -1; using (var db = new MbContext()) { db.WaveAnnal.Add(model); result = db.SaveChanges(); } return(result); }
public virtual int Save(string waveCardId) { var result = -1; using (var db = new MbContext()) { var model = new WaveAnnal() { WaveCardId = waveCardId, CreateTime = DateTime.Now }; db.WaveAnnal.Add(model); result = db.SaveChanges(); } return(result); }