using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using et.SqlDAL;
using System.Data.SqlClient;
namespace et.BLL
{
public class Goods
{
public DataTable GetHotProductList()
{//获取热点商品列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 10 content,goodsid from goods order by downcount desc";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt=sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetNewTopProductList()
{//获取最新商品列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 10 content,buysell,goodsid from goods order by protime desc";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetFangwuList()
{//获取房屋信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,price,goodsid from goods where goodtypeid=1";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetNetWorkList()
{//获取电脑网络信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=2";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetJiaoTongList()
{//获取交通工具信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=3";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetJiaDianList()
{//获取家电信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=4";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetShouCangList()
{//获取收藏信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=5";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
}
public DataTable GetLiPList()
{//获取礼品信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=6";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable ProductById(int gid)//这个方法在调用时无法调用没有智能提示????其他方法都可以的为什么啊?????
{//根据编号获取产品详细列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select *from goods where goodsid=" + gid;
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
}
}
}//调用的类
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using et.BLL;
public partial class Details : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strgoodsid=Request.QueryString["goodsid"].ToString();
Goods goods = new Goods();
goods.GetLiPList();//没问题
goods.ProductById(2);//报错
/*报错错误 1 “et.BLL.Goods”并不包含“ProductById”的定义 E:\study\computer\asp.net project\etPro\Details.aspx.cs 18 15 E:\...\etPro\
*/ }
}
using System.Collections.Generic;
using System.Text;
using System.Data;
using et.SqlDAL;
using System.Data.SqlClient;
namespace et.BLL
{
public class Goods
{
public DataTable GetHotProductList()
{//获取热点商品列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 10 content,goodsid from goods order by downcount desc";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt=sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetNewTopProductList()
{//获取最新商品列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 10 content,buysell,goodsid from goods order by protime desc";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetFangwuList()
{//获取房屋信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,price,goodsid from goods where goodtypeid=1";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetNetWorkList()
{//获取电脑网络信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=2";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetJiaoTongList()
{//获取交通工具信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=3";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetJiaDianList()
{//获取家电信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=4";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable GetShouCangList()
{//获取收藏信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=5";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
}
public DataTable GetLiPList()
{//获取礼品信息列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=6";
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} public DataTable ProductById(int gid)//这个方法在调用时无法调用没有智能提示????其他方法都可以的为什么啊?????
{//根据编号获取产品详细列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select *from goods where goodsid=" + gid;
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
}
}
}//调用的类
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using et.BLL;
public partial class Details : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strgoodsid=Request.QueryString["goodsid"].ToString();
Goods goods = new Goods();
goods.GetLiPList();//没问题
goods.ProductById(2);//报错
/*报错错误 1 “et.BLL.Goods”并不包含“ProductById”的定义 E:\study\computer\asp.net project\etPro\Details.aspx.cs 18 15 E:\...\etPro\
*/ }
}
{//根据编号获取产品详细列表
DataTable dt = new DataTable();
SqlDAL.SqlHelper sqlhelp = new SqlHelper();
string strSql = "select *from goods where goodsid=" + gid.ToString();
SqlConnection conn = new SqlConnection(sqlhelp.strConn);
dt = sqlhelp.DisPLayList_Dt(strSql, conn);
return dt;
} 重新编译生成 dll