Beispiel #1
0
        /// <summary>
        /// 添加一条记录
        /// </summary>
        public int Add(QiangGou entity, IDbTransaction tran)
        {
            string sql = @"insert into [QiangGou]
                               ([objectid], [addTime], [lastModifyer], [qgPrice], [adId], [orderId], [endTime])
                               values
                               (@objectid, @addTime, @lastModifyer, @qgPrice, @adId, @orderId, @endTime)";

            object param = new
            {
                objectid     = entity.Objectid,
                addTime      = entity.AddTime,
                lastModifyer = entity.LastModifyer,
                qgPrice      = entity.QgPrice,
                adId         = entity.AdId,
                orderId      = entity.OrderId,
                endTime      = entity.EndTime
            };
            int count = tran.Connection.Execute(sql, param, tran);

            return(count);
        }
Beispiel #2
0
        public int Update(QiangGou entity)
        {
            //GetUpdateSql2
            string sql   = @"update [QiangGou] set objectid=@objectid, addTime=@addTime, lastModifyer=@lastModifyer, qgPrice=@qgPrice, adId=@adId, orderId=@orderId, endTime=@endTime  where id=@id ";
            object param = new
            {
                id           = entity.Id,
                objectid     = entity.Objectid,
                addTime      = entity.AddTime,
                lastModifyer = entity.LastModifyer,
                qgPrice      = entity.QgPrice,
                adId         = entity.AdId,
                orderId      = entity.OrderId,
                endTime      = entity.EndTime
            };

            using (IDbConnection conn = OpenConnection())
            {
                int count = conn.Execute(sql, param);
                return(count);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 添加一条记录
        /// </summary>
        public int Add(QiangGou entity)
        {
            string sql = @"insert into [QiangGou]
                               ([objectid], [addTime], [lastModifyer], [qgPrice], [adId], [orderId], [endTime])
                               values
                               (@objectid, @addTime, @lastModifyer, @qgPrice, @adId, @orderId, @endTime)";

            object param = new
            {
                objectid     = entity.Objectid,
                addTime      = entity.AddTime,
                lastModifyer = entity.LastModifyer,
                qgPrice      = entity.QgPrice,
                adId         = entity.AdId,
                orderId      = entity.OrderId,
                endTime      = entity.EndTime
            };

            using (IDbConnection conn = OpenConnection())
            {
                int count = conn.Execute(sql, param);
                return(count);
            }
        }