标签:
protected void bindhbdata(string chatid)
{
string sql = "select * from staff where wechatid=‘"+ chatid +"‘";
SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.mycon, CommandType.Text, sql);
if(dr.Read())
{
this.unit.Text = dr["unit"].ToString();
this.hcagent.Text = dr["staffname"].ToString();
this.hcagent_tl.Text = dr["tl"].ToString();
string sqltl = "select * from staff where unit=‘"+ dr["unit"].ToString () +"‘ and rank in (‘tl‘)";
DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.mycon, CommandType.Text, sqltl);
//DataRow NewRow = ds.Tables[0].NewRow();
//ds.Tables[0].Rows.Add(NewRow);
this.t_tl.DataSource = ds.Tables[0].DefaultView;
this.t_tl.DataTextField = "staffname";
t_tl.DataBind();
t_tl.Items.Insert(0, new ListItem("请选择", "0"));
}
dr.Close();
}
protected void t_tl_SelectedIndexChanged(object sender, EventArgs e)
{
string tlname= t_tl.SelectedValue;
string t_agent = "select * from staff where tl=‘"+ tlname +"‘";
DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.mycon, CommandType.Text, t_agent);
t_hragent.DataSource = ds.Tables[0].DefaultView;
t_hragent.DataTextField = "staffname";
t_hragent.DataBind();
}
标签:
原文地址:http://www.cnblogs.com/pp521/p/4473562.html