Exemplo n.º 1
0
 public CouponEntity Create(CouponEntity entity)
 {
     try
     {
         _couponRepository.Insert(entity);
         return entity;
     }
     catch (Exception e)
     {
         _log.Error(e,"数据库操作出错");
         return null;
     }
 }
Exemplo n.º 2
0
 public bool Delete(CouponEntity entity)
 {
     try
     {
         _couponRepository.Delete(entity);
         return true;
     }
     catch (Exception e)
     {
         _log.Error(e,"数据库操作出错");
         return false;
     }
 }
Exemplo n.º 3
0
        public bool Post(CouponModel model)
        {
            var entity = new CouponEntity
            {

                Guid = model.Guid,

                Type = model.Type,

                DisCount = model.DisCount,

            //				Product = model.Product,

                ExpireTime = model.ExpireTime,

                Status = model.Status,

                Adduser = model.Adduser,

                Addtime = model.Addtime,

                Upduser = model.Upduser,

                Updtime = model.Updtime,

                Owner = model.Owner,

            };
            if(_CouponService.Create(entity).Id > 0)
            {
                return true;
            }
            return false;
        }