/// <summary> /// 初始化资产类型 /// </summary> private void InitType() { DataTable dt = EqTypeMgr.GetAllType(); if (dt != null) { cbxType.DataSource = dt; cbxType.DisplayMember = dt.Columns[1].ToString(); } }
private void btnTyp_Click(object sender, EventArgs e) { lstInfo.DataSource = null; lblMessge.Text = btnTyp.Text; DataTable dt = EqTypeMgr.GetAllType(); lstInfo.DataSource = dt; lstInfo.DisplayMember = dt.Columns[1].ToString();; lstInfo.ValueMember = dt.Columns[0].ToString(); }
/// <summary> /// 构造资产类比节点 /// </summary> /// <param name="parent">父节点</param> private void BuildType(TreeNode parent) { TreeNode Type = new TreeNode(); this.AddNode(Type, "资产类别", 7, parent); DataTable dt = EqTypeMgr.GetAllType(); if (dt != null) { for (int i = 0; i < dt.Rows.Count; i++) { TreeNode type = new TreeNode(); this.AddNode(type, dt.Rows[i][1].ToString(), 2, Type); } } }