protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.txtServerUrl.Text = new SolutionBLL().GetUrl(SlnID); ddlContract.Items.Clear(); ContractBLL BLL = new ContractBLL(); DataSet ds = BLL.GetList("SlnID=" + SlnID); if (ds.Tables[0].Rows.Count > 0) { ddlContract.DataSource = ds; ddlContract.DataTextField = "uname"; ddlContract.DataValueField = "ID"; ddlContract.DataBind(); ddlContract.SelectedValue = ContractID.ToString(); } } }
private void BindContract(int slnID) { DropGetList.Items.Clear(); ContractBLL BLL = new ContractBLL(); DataSet ds = BLL.GetList("SlnID=" + slnID); if (ds.Tables[0].Rows.Count > 0) { DropGetList.DataSource = ds; DropGetList.DataTextField = "uname"; DropGetList.DataValueField = "ID"; DropGetList.DataBind(); } string conId = ContractID; if (!string.IsNullOrEmpty(conId) && conId != "0") { try { DropGetList.SelectedValue = conId; } catch { } } }
protected void TreeList_SelectedNodeChanged(object sender, EventArgs e) { if (TreeList.SelectedNode.Target != "0") { ddlAgreement.SelectedValue = TreeList.SelectedNode.Parent.Value; ContractBLL BLL = new ContractBLL(); DataSet ds = ddlAgreement.SelectedValue == "0" ? BLL.GetList("AgreementID>=0") : BLL.GetList("AgreementID=" + ddlAgreement.SelectedValue); if (ds.Tables[0].Rows.Count > 0) { DropGetList.DataSource = ds; DropGetList.DataTextField = "uname"; DropGetList.DataValueField = "ID"; DropGetList.DataBind(); } else { DropGetList.Items.Clear(); DropGetList.Items.Add(new ListItem("无接口", "0")); } TreeList.SelectedNode.Checked = true; TreeList.SelectedNode.Selected = true; DropGetList.SelectedValue = TreeList.SelectedValue; SetCookies(ddlSolution.Text, DropGetList.Text); QueryResult(); } }
protected void ddlAgreement_SelectedIndexChanged(object sender, EventArgs e) { ContractBLL BLL = new ContractBLL(); DataSet ds = ddlAgreement.SelectedValue == "0" ? BLL.GetList("AgreementID>=0") : BLL.GetList("AgreementID=" + ddlAgreement.SelectedValue); if (ds.Tables[0].Rows.Count > 0) { DropGetList.DataSource = ds; DropGetList.DataTextField = "uname"; DropGetList.DataValueField = "ID"; DropGetList.DataBind(); } else { DropGetList.Items.Clear(); DropGetList.Items.Add(new ListItem("无接口","0")); } }
private void Bind(int slnID) { ddlSolution.Items.Clear(); DataSet dssln = new SolutionBLL().GetList(""); ddlSolution.DataSource = dssln; ddlSolution.DataTextField = "SlnName"; ddlSolution.DataValueField = "SlnID"; ddlSolution.DataBind(); var slnTable = dssln.Tables[0]; slnTable.PrimaryKey = new DataColumn[] { slnTable.Columns["SlnID"] }; var row = slnTable.Rows.Find(slnID); if (row != null) { lblSlnName.Text = row["SlnName"].ToString(); } ddContract.Items.Clear(); ContractBLL BLL = new ContractBLL(); DataSet ds = BLL.GetList("SlnID=" + slnID); if (ds.Tables[0].Rows.Count > 0) { ddContract.DataSource = ds; ddContract.DataTextField = "uname"; ddContract.DataValueField = "ID"; ddContract.DataBind(); ddContract.SelectedValue = ContractID.ToString(); } }
private void BindContract() { ddlContract.Items.Clear(); ContractBLL BLL = new ContractBLL(); DataSet ds = BLL.GetList("SlnID=" + SlnID); if (ds.Tables[0].Rows.Count > 0) { ddlContract.DataSource = ds; ddlContract.DataTextField = "uname"; ddlContract.DataValueField = "ID"; ddlContract.DataBind(); ddlContract.SelectedValue = ContractID.ToString(); ddlContract_SelectedIndexChanged(null, null); } }