Beispiel #1
0
        /// <summary>
        /// 修改交易信息数据
        /// </summary>
        /// <param name="trade_info"></param>
        /// <returns></returns>
        public int EditTradeInfo(Entity.TradeInfo trade_info)
        {
            string sqlStr = @"UPDATE [TradeInfo]
                SET [commodityID] = @commodityID
                    ,[sellerID] = @sellerID
                    ,[buyerID] = @buyerID
                    ,[isDeal] = @isDeal
                    ,[dealPrice] = @dealPrice
                    ,[cut] = @cut
                    ,[tradeDate] = @tradeDate
                    ,[tradeNote] = @tradeNote
                WHERE recordID = @recordID";

            SqlParameter[] paras =
            {
                new SqlParameter("@recordID",    trade_info.RecordId),
                new SqlParameter("@commodityID", trade_info.CommmdityId),
                new SqlParameter("@sellerID",    trade_info.SellerId),
                new SqlParameter("@buyerID",     trade_info.BuyerId),
                new SqlParameter("@isDeal",      trade_info.IsDeal),
                new SqlParameter("@dealPrice",   trade_info.DealMoney),
                new SqlParameter("@cut",         trade_info.CutMoney),
                new SqlParameter("@tradeDate",   trade_info.TradeDate),
                new SqlParameter("@tradeNote",   trade_info.TradeNote),
            };
            var handler = new DAL.DatabaseHandler();

            return(handler.ExeSql(sqlStr, paras));
        }
Beispiel #2
0
        /// <summary>
        /// 添加商品交易信息
        /// </summary>
        /// <param name="trade_info"></param>
        /// <returns></returns>
        public int AddTradeInfo(Entity.TradeInfo trade_info)
        {
            string sqlStr = @"INSERT INTO [TradeInfo]
            ([recordID]
            ,[commodityID]
            ,[sellerID]
            ,[buyerID]
            ,[isDeal]
            ,[dealPrice]
            ,[cut]
            ,[tradeDate]
            ,[tradeNote])
    VALUES
            (
            @recordID
            ,@commodityID
            ,@sellerID
            ,@buyerID
            ,@isDeal
            ,@dealPrice
            ,@cut
            ,@tradeDate
            ,@tradeNote)";

            SqlParameter[] paras =
            {
                new SqlParameter("@recordID",    trade_info.RecordId),
                new SqlParameter("@commodityID", trade_info.CommmdityId),
                new SqlParameter("@sellerID",    trade_info.SellerId),
                new SqlParameter("@buyerID",     trade_info.BuyerId),
                new SqlParameter("@isDeal",      trade_info.IsDeal),
                new SqlParameter("@dealPrice",   trade_info.DealMoney),
                new SqlParameter("@cut",         trade_info.CutMoney),
                new SqlParameter("@tradeDate",   trade_info.TradeDate),
                new SqlParameter("@tradeNote",   trade_info.TradeNote),
            };
            var handler = new DAL.DatabaseHandler();

            return(handler.ExeSql(sqlStr, paras));
        }