private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text.Trim())) { MessageBox.Show("要添加的节点名称不能为空!"); return; } //添加根节点 Utility.SqliteHelper sh = new Utility.SqliteHelper(); sh.ExecuteNonQuery($"insert into sys_menu (text,tag,xh,fid) values('{textBox1.Text.Trim()}','{textBox2.Text.Trim()}',{Convert.ToInt32(textBox3.Text.Trim())},0)"); //TreeNode tn = new TreeNode(); //tn.Text = textBox1.Text.Trim(); //tn.Tag = textBox2.Text.Trim(); //treeView1.Nodes.Add(tn); Utility.MenuTreeViewLoader mn = new Utility.MenuTreeViewLoader(); treeView1.Nodes.Clear(); mn.GetTreeView(treeView1); textBox1.Text = ""; textBox2.Text = ""; }
private void MenuSetting_Load(object sender, EventArgs e) { Utility.MenuTreeViewLoader mn = new Utility.MenuTreeViewLoader(); mn.GetTreeView(treeView1); }