Exemple #1
0
        /// <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);
        }
Exemple #2
0
        /// <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);
        }
Exemple #3
0
        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);
        }