protected void ddl_hsxss_SelectedIndexChanged(object sender, EventArgs e) { WSSDT.WSSDT dthoai = new WSSDT.WSSDT(); DataSet ds = new DataSet(); string idHSX = ddl_hsxss.SelectedValue.ToString(); string sql = "SELECT idDT, TenDT FROM DIENTHOAI WHERE ANHIEN=1 AND idHSX=" + idHSX; //string sql = "SELECT idDT, TenDT FROM DIENTHOAI"; ds = dthoai.SelectQuery(sql); DataTable dt = new DataTable(); dt = ds.Tables[0]; ListItem item; ddl_dtss.Items.Clear(); item = new ListItem(); item.Value = "0"; item.Text = "-----Chọn Model-----"; ddl_dtss.Items.Add(item); for (int i = 0; i < dt.Rows.Count; i++) { item = new ListItem(); item.Value = dt.Rows[i]["idDT"].ToString(); item.Text = dt.Rows[i]["TenDT"].ToString(); ddl_dtss.Items.Add(item); } }
public void showCacHangDT() { WSSDT.WSSDT hangdt = new WSSDT.WSSDT(); DataSet ds = new DataSet(); ds = hangdt.SelectQuery("SELECT idHSX, TenHSX FROM HANGSANXUAT WHERE AnHien = 1"); //DataTable dt = new DataTable(); //dt = ds.Tables[0]; CachangDienThoai.DataSource = ds; CachangDienThoai.DataBind(); }
public void ShowHSXSoSanh() { WSSDT.WSSDT hsxss = new WSSDT.WSSDT(); DataSet ds = new DataSet(); ds = hsxss.SelectQuery("SELECT idHSX, TenHSX FROM HANGSANXUAT WHERE ANHIEN=1"); DataTable dt = new DataTable(); dt = ds.Tables[0]; ListItem item; for (int i = 0; i < dt.Rows.Count; i++) { item = new ListItem(); item.Value = dt.Rows[i]["idHSX"].ToString(); item.Text = dt.Rows[i]["TenHSX"].ToString(); ddl_hsxss.Items.Add(item); } }
public void showHSX() { WSSDT.WSSDT hsx = new WSSDT.WSSDT(); DataSet ds = new DataSet(); ds = hsx.SelectQuery("SELECT idHSX, TenHSX FROM HANGSANXUAT WHERE ANHIEN=1"); DataTable dt = new DataTable(); dt = ds.Tables[0]; ListItem item; for (int i = 0; i < dt.Rows.Count; i++) { item = new ListItem(); item.Value = dt.Rows[i]["idHSX"].ToString(); item.Text = dt.Rows[i]["TenHSX"].ToString(); ddl_hsx.Items.Add(item); } }