📄 showbygroup.aspx.cs
字号:
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;
public partial class ShowByGroup : System.Web.UI.Page
{
DataSet dataset = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack && Page.ClientQueryString!="")
{
string id_name = Page.ClientQueryString.Split('=')[0];
string id = Request.QueryString.Get(Page.ClientQueryString.Split('=')[0]);
LoadLapTop(id, id_name,id_name.Substring(3));
}
}
string nsp="";
void LoadLapTop(string id,string id_name,string table)
{
KetNoiClass kn = new KetNoiClass();
try
{
kn.MoKetNoi();
if (table == "nhomsp") { nsp = "nsp."; }
string qr = "select id_sp,ten_sp,gia,url_hinh,"+nsp+"ten_"
+ table + ","
+"congnghe_cpu,"
+"tocdo_cpu,"
+"cache_cpu,"
+"loaicache_cpu,"
+"thongtin_main,"
+"bus_main,"
+"dungluong_ram,"
+"congnghe_ram,"
+"bus_ram,"
+"dungluong_hdd,"
+"tocdoquay_hdd,"
+"thongtin_display,"
+"thongtin_graphic,"
+"thongtin_oquang,"
+"odia_oquang,"
+"thongtin_webcam,"
+"ten_webcam,"
+"thongtin_hdh,"
+"ten_hdh,"
+"nsp.ten_nhomsp"
+" from nhomsp as nsp,sanpham," + table
+" where sanpham." + id_name + "=" + table + "." + id_name
+" and sanpham.id_nhomsp=nsp.id_nhomsp"
+" and " + table + "." + id_name + "=" + id + "";
dataset = kn.TruyVan(qr, "sanpham");
kn.DongKetNoi();
DataList1.DataSource = dataset.Tables["sanpham"];
DataList1.DataMember = "id_sp";
DataList1.DataMember = "ten_sp";
DataList1.DataMember = "gia";
DataList1.DataMember = "url_hinh";
DataList1.DataMember = "congnghe_cpu";
DataList1.DataMember = "tocdo_cpu";
DataList1.DataMember = "cache_cpu";
DataList1.DataMember = "loaicache_cpu";
DataList1.DataMember = "thongtin_main";
DataList1.DataMember = "bus_main";
DataList1.DataMember = "dungluong_ram";
DataList1.DataMember = "congnghe_ram";
DataList1.DataMember = "bus_ram";
DataList1.DataMember = "dungluong_hdd";
DataList1.DataMember = "tocdoquay_hdd";
DataList1.DataMember = "thongtin_display";
DataList1.DataMember = "thongtin_graphic";
DataList1.DataMember = "thongtin_oquang";
DataList1.DataMember = "odia_oquang";
DataList1.DataMember = "thongtin_webcam";
DataList1.DataMember = "ten_webcam";
DataList1.DataMember = "thongtin_hdh";
DataList1.DataMember = "ten_hdh";
DataList1.DataMember = "ten_nhomsp";
DataList1.DataBind();
if (id_name == "id_"+table+"" && dataset.Tables["sanpham"].Rows.Count>0)
{
td_name.InnerHtml = dataset.Tables["sanpham"].Rows[0]["ten_"+table+""].ToString(); ;
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -