Ejemplo n.º 1
0
        /// <summary>
        /// 添加卖家评价
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool AddRateHisWithSeller(TradeRate obj, string rateType)
        {
            try
            {
                string query = @"insert into SellerRateHis(oid,tid,nick,result,created,content,rateType)
                                 values(@oid,@tid,@nick,@result,@created,@content,@rateType)";

                SqlParameter[] param = new SqlParameter[]
                {
                    new SqlParameter("@oid", obj.Oid),
                    new SqlParameter("@tid", obj.Tid),
                    new SqlParameter("@nick", obj.Nick == null ? "" : obj.Nick),
                    new SqlParameter("@result", obj.Result == null ? "" : obj.Result),
                    new SqlParameter("@created", obj.Created == null ? "" : obj.Created),
                    new SqlParameter("@content", obj.Content == null ? "" : obj.Content),
                    new SqlParameter("@rateType", rateType)
                };
                DataBaseTool.ExecuteSql(query, param);
                return(true);
            }
            catch (Exception ex)
            {
                //主键重复,发生异常。ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TBApply_Data);
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static bool AddNoteTradeToDB(NotifyTrade trade)
        {
            try
            {
                string query = @"INSERT INTO NotifyTrade(tid,buyer_nick,nick,status,oid,payment,seller_nick,createDate)
                                        VALUES(@tid,@buyer_nick,@nick,@status,@oid,@payment,@seller_nick,getdate())";

                SqlParameter[] param = new SqlParameter[]
                {
                    new SqlParameter("@tid", trade.Tid),
                    new SqlParameter("@buyer_nick", trade.BuyerNick),
                    new SqlParameter("@nick", trade.SellerNick),
                    new SqlParameter("@status", trade.Status),
                    new SqlParameter("@oid", trade.Oid),
                    new SqlParameter("@payment", trade.Payment),
                    new SqlParameter("@seller_nick", trade.SellerNick)
                };

                DataBaseTool.ExecuteSql(query, param);
                return(true);
            }
            catch (Exception ex)
            {
                ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data);
                return(false);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 订单拦截日志
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool AddCloseOrderLog(CloseOrderLog obj)
        {
            try
            {
                string query = @"insert into CloseOrderLog(buyerNick,sellerNick,ordreNo,closeReason,closeTime,closeResult,faildReason)
values(@buyerNick,@sellerNick,@ordreNo,@closeReason,@closeTime,@closeResult,@faildReason)";

                SqlParameter[] param = new SqlParameter[]
                {
                    new SqlParameter("@buyerNick", obj.BuyerNick),
                    new SqlParameter("@sellerNick", obj.SellerNick),
                    new SqlParameter("@ordreNo", obj.OrdreNo),
                    new SqlParameter("@closeReason", obj.CloseReason),
                    new SqlParameter("@closeTime", DateTime.Now),
                    new SqlParameter("@closeResult", obj.CloseResult),
                    new SqlParameter("@faildReason", obj.FaildReason)
                };
                DataBaseTool.ExecuteSql(query, param);
                return(true);
            }
            catch (Exception ex)
            {
                //主键重复,发生异常。ExceptionReporter.WriteLog(ex, CHENGTUAN.Entity.ExceptionPostion.TBApply_Data);
                return(false);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 删除秒评后的无效数据
        /// </summary>
        /// <returns></returns>
        public static bool DeleteValidTradeForMiaoRate(string tid)
        {
            try
            {
                string query = @"delete from NotifyTrade where tid = @tid";

                SqlParameter[] param = new SqlParameter[]
                {
                    new SqlParameter("@tid", tid)
                };
                DataBaseTool.ExecuteSql(query, param);
                return(true);
            }
            catch (Exception ex)
            {
                ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data);
                return(false);
            }
        }
Ejemplo n.º 5
0
        public static bool UpdateNoteTradeToDB(NotifyTrade trade)
        {
            try
            {
                string query = @"update NotifyTrade set status = @status where tid = @tid";

                SqlParameter[] param = new SqlParameter[]
                {
                    new SqlParameter("@tid", trade.Tid),
                    new SqlParameter("@status", trade.Status)
                };

                DataBaseTool.ExecuteSql(query, param);
                return(true);
            }
            catch (Exception ex)
            {
                ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Data);
                return(false);
            }
        }