void BindListBox() { string ecid = ViewState["ecid"].ToString(); DataTable dt = KPI_RealTagDal.GetTAGs(); lbx_TAG.DataSource = dt; lbx_TAG.DataTextField = "Name"; lbx_TAG.DataValueField = "Code"; lbx_TAG.DataBind(); dt = ECTagDal.GetKPIs(ecid); lbx_KPI.DataSource = dt; lbx_KPI.DataTextField = "Name"; lbx_KPI.DataValueField = "Code"; lbx_KPI.DataBind(); ExpDone Parser = new ExpDone(); Dictionary <String, String> dic = Parser.CustomFunctionsListing(); ddlCustomFunction.Items.Add(new ListItem("请选择", "NULL")); foreach (KeyValuePair <String, String> kvp in dic) { ddlCustomFunction.Items.Add(new ListItem(kvp.Value, kvp.Key)); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //指标信息 string WebCode = ""; if (Request.QueryString["webcode"] != null) { WebCode = Request.QueryString["webcode"].ToString(); } else { WebCode = ""; } lblInfor.Text = WebCode; //初始化指标集合 DataTable dt = ECTagDal.GetKPIs(""); this.ECCode.DataSource = dt; this.ECCode.DataBind(); //绑定名称 BindTextBox(ECCode.SelectedValue); SISKPI.KPIDataSetTableAdapters.GetCalcTypeTableAdapter a = new SISKPI.KPIDataSetTableAdapters.GetCalcTypeTableAdapter(); this.KeyCalcType.DataSource = a.GetData(); this.KeyCalcType.DataBind(); //类型集合 BindKeys(WebCode); } }
protected void btnSearchKPI_Click(object sender, EventArgs e) { string ecid = ViewState["ecid"].ToString(); string name = txt_KPI.Value; DataTable dt = ECTagDal.GetKPIs(ecid); lbx_KPI.DataSource = dt; lbx_KPI.DataTextField = "Name"; lbx_KPI.DataValueField = "Code"; lbx_KPI.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //指标信息 //if (Request.QueryString["webcode"] != null) //{ // WebCode = Request.QueryString["webcode"].ToString(); //} //else //{ // WebCode = ""; //} //初始化指标集合 DataTable dt = ECTagDal.GetKPIs(""); ECCode.DataSource = dt; ECCode.DataBind(); dt = CurveTagDal.GetCurvesByCode(); KeyTarget1.Items.Add(new ListItem("", "NOTAG")); KeyTarget2.Items.Add(new ListItem("", "NOTAG")); foreach (DataRow dr in dt.Rows) { KeyTarget1.Items.Add(new ListItem(dr["Name"].ToString(), dr["Code"].ToString())); KeyTarget2.Items.Add(new ListItem(dr["Name"].ToString(), dr["Code"].ToString())); } //ddlECTag1.DataSource = dt; //ddlECTag1.DataTextField = "Name"; //ddlECTag1.DataValueField = "Code"; //ddlECTag1.DataBind(); //ddlECTag2.DataSource = dt; //ddlECTag2.DataTextField = "Name"; //ddlECTag2.DataValueField = "Code"; //ddlECTag2.DataBind(); //绑定名称 BindTextBox(ECCode.SelectedValue); //类型集合 BindKeys(); } }