コード例 #1
0
        public int AddProductProc(ProcProductStyleEntity entity)
        {
            string    sql = @"EXEC Proc_ProductEdit  @AdTitle,@Title,@BrandId,@Price,@MarketPrice,@PicUrl,@DefaultProductId,@ClassId,@HasHtml,@Cost,@TradePrice,@SellerId,@Num, 
@ContentCms,@StyleId,@StylePics,@StylePropertys,@BrandCars
			 "            ;
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, "@AdTitle", DbType.String, entity.AdTitle);
            db.AddInParameter(cmd, "@Title", DbType.String, entity.Title);
            db.AddInParameter(cmd, "@BrandId", DbType.Int32, entity.BrandId);
            db.AddInParameter(cmd, "@Price", DbType.Decimal, entity.Price);
            db.AddInParameter(cmd, "@MarketPrice", DbType.Decimal, entity.MarketPrice);
            db.AddInParameter(cmd, "@PicUrl", DbType.String, entity.PicUrl);
            db.AddInParameter(cmd, "@DefaultProductId", DbType.Int32, entity.DefaultProductId);
            db.AddInParameter(cmd, "@ClassId", DbType.Int32, entity.ClassId);
            db.AddInParameter(cmd, "@HasHtml", DbType.Int32, entity.HasHtml);
            db.AddInParameter(cmd, "@Cost", DbType.Decimal, entity.Cost);
            db.AddInParameter(cmd, "@TradePrice", DbType.Decimal, entity.TradePrice);
            db.AddInParameter(cmd, "@SellerId", DbType.Int32, entity.SellerId);
            db.AddInParameter(cmd, "@Num", DbType.Int32, entity.Num);
            db.AddInParameter(cmd, "@ContentCms", DbType.String, entity.ContentCms);
            db.AddInParameter(cmd, "@StyleId", DbType.Int32, entity.StyleId);
            db.AddInParameter(cmd, "@BrandCars", DbType.String, entity.BrandCars);
            db.AddInParameter(cmd, "@StylePics", DbType.String, entity.StylePics);
            db.AddInParameter(cmd, "@StylePropertys", DbType.String, entity.StylePropertys);
            object identity = db.ExecuteScalar(cmd);

            if (identity == null || identity == DBNull.Value)
            {
                return(0);
            }
            return(Convert.ToInt32(identity));
        }
コード例 #2
0
 public int AddProductProc(ProcProductStyleEntity _entity)
 {
     return(ProductStyleDA.Instance.AddProductProc(_entity));
 }