dal
public List
{
List
string strSel = "select goodsID,goods_name,goods_price,style,sizes,color,0 numbers from t_goods where 1=1";
if(good.goodsID!="")
{
strSel += "and goodsid='"+good.goodsID+"'";
}
if (good.type != "")
{
strSel += " and type = '" + good.type + "'";
}
if (good.color != "")
{
strSel += " and color = '" + good.color + "'";
}
if (good.sizes.ToString() != "")
{
strSel += " and sizes = '" + good.color + "'";
}
if (good.style != "")
{
strSel += " and style = '" + good.type+ "'";
}
DataSet ds = OracleHelper.ExecuteDataset(strSel, null);
foreach (DataRow row in ds.Tables[0].Rows)
{GoodInfo goodInfo = new GoodInfo(); goodInfo.goodsID = row[0].ToString() goodInfo.goods_name = row[1].ToString();goodInfo.goods_pricefloat.Parse(row[2].ToString());goodInfo.style = row[3].ToString();goodInfo.sizes = int.Parse(row[4].ToString()); goodInfo.color = row[5].ToString(); goodInfo.type = row[6].ToString(); goodInfos.Add(goodInfo); }
return goodInfos;
}
bll 层是 public List
{
return new GoodsService().GetStockGoodsInfo(good);
}