private void Bind_SiteTreeClass() { DALTaskClass dal = new DALTaskClass(); DataTable dt = dal.GetList("").Tables[0]; this.cmbSiteClassID.DataSource = dt; this.cmbSiteClassID.DisplayMember = "TreeClassName"; this.cmbSiteClassID.ValueMember = "ClassID"; }
/// <summary> /// 分类加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmLeftTreeClass_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.EditValue)) { this.Text = "任务分类编辑"; this.txtEditID.Text = this.EditValue; DALTaskClass dal = new DALTaskClass(); DataTable dt = dal.GetList(" ClassID=" + this.EditValue).Tables[0]; this.txtTreeClassName.Text = dt.Rows[0]["TreeClassName"].ToString(); this.txtTreeClassReadMe.Text = dt.Rows[0]["TreeClassReadMe"].ToString(); } }
private void frmImportWebCollectionModule_Load(object sender, EventArgs e) { DALTaskClass dal = new DALTaskClass(); DataTable dt = dal.GetList(string.Empty).Tables[0]; this.cmbSiteClass.Items.Clear(); foreach (DataRow dr in dt.Rows) { this.cmbSiteClass.Items.Add(dr["TreeClassName"].ToString() + "||" + dr["ClassId"].ToString()); } this.cmbSiteClass.SelectedIndex = 0; }
/// <summary> /// 加载任务树节点 /// </summary> private void Bind_TreeDataList() { DALTaskClass dal = new DALTaskClass(); DataTable dt = dal.GetList(string.Empty).Tables[0]; TreeNode rootNode = this.treeView_TaskList.Nodes[1]; rootNode.Nodes.Clear(); foreach (DataRow dr in dt.Rows) { TreeNode tn = new TreeNode(); tn.Name = dr["ClassID"].ToString(); tn.Text = dr["TreeClassName"].ToString(); tn.Tag = dr["ClassID"].ToString(); rootNode.Nodes.Add(tn); } rootNode.ExpandAll(); }