Exemplo n.º 1
0
        /// <summary>
        /// 中标拍卖竞拍人员
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int BidParticipant(AuctionCarParticipantModel model)
        {
            const string sql = @"update auction_participant set isbid=@isbid,modifierid=@modifierid,modifiedtime=@modifiedtime where innerid=@innerid;";

            using (var conn = Helper.GetConnection())
            {
                int result;
                try
                {
                    result = conn.Execute(sql, model);
                }
                catch (Exception ex)
                {
                    LoggerFactories.CreateLogger().Write("中标拍卖竞拍人员异常:", TraceEventType.Information, ex);
                    result = 0;
                }

                return result;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新竞价信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int UpdateParticipant(AuctionCarParticipantModel model)
 {
     var sql = new StringBuilder("update `auction_participant` set ");
     sql.Append(Helper.CreateField(model).Trim().TrimEnd(','));
     sql.Append(" where innerid = @innerid");
     int result;
     try
     {
         result = Helper.Execute(sql.ToString(), model);
     }
     catch (Exception ex)
     {
         result = 0;
         LoggerFactories.CreateLogger().Write("更新竞价信息异常:", TraceEventType.Information, ex);
     }
     return result;
 }
Exemplo n.º 3
0
        /// <summary>
        /// 添加拍卖竞拍人员
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddParticipant(AuctionCarParticipantModel model)
        {
            const string sql = @"INSERT INTO `auction_participant`
                                (innerid, auctionid, mobile, amount,username,userid, status, remark, createrid, createdtime, modifierid, modifiedtime,orderno)
                                VALUES
                                (uuid(), @auctionid, @mobile, @amount,@username,@userid, @status, @remark, @createrid, @createdtime, @modifierid, @modifiedtime,@orderno);";

            using (var conn = Helper.GetConnection())
            {
                int result;
                try
                {
                    result = conn.Execute(sql, model);
                }
                catch (Exception ex)
                {
                    LoggerFactories.CreateLogger().Write("添加拍卖竞拍人员异常:", TraceEventType.Information, ex);
                    result = 0;
                }

                return result;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 若已成交更改其他竞价信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int UpdateOtherParticipant(AuctionCarParticipantModel model)
        {
            //更新竞价列表
            var sql = new StringBuilder("update `auction_participant` set  status=7 ");
            sql.Append(" where auctionid=@auctionid and innerid != @innerid");

            var carmodel = GetAuctionViewById(model.Auctionid);
            var carid = string.Empty;
            if (carmodel != null)
            {
                carid = carmodel.carid;
            }
            //更新车辆信息
            var sqlcar = new StringBuilder("update car_info set `status`=2,`dealprice`=@dealprice,dealdesc='拍卖成交' where innerid=@carid;");
            int result;
            using (var conn = Helper.GetConnection())
            {
                var tran = conn.BeginTransaction();
                try
                {
                    conn.Execute(sql.ToString(), model, tran);
                    conn.Execute(sqlcar.ToString(), new { carid, dealprice = model.Amount }, tran);
                    tran.Commit();
                    return 1;
                }
                catch (Exception ex)
                {
                    tran.Rollback();
                    result = 0;
                    LoggerFactories.CreateLogger().Write("更新其他竞价信息异常:", TraceEventType.Information, ex);
                }
            }
            return result;
        }