Example #1
0
 //新增节点
 private void conToolStripMenuItemChild_Click(object sender, EventArgs e)
 {
     if (treeViewClient.SelectedNode != null)
     {
         InsNodes insN = new InsNodes();
         insN.city_code = treeViewClient.SelectedNode.Tag.ToString();
         insN.ShowDialog(this);
         if (Isflag)
         {
             loadTree();
             isflag = false;
             this.Focus();
         }
     }
     else
     {
         MessageBox.Show("请选择需要增加的上级城市");
     }
 }
Example #2
0
 private void 新增下级节点ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (treeViewMaterial.SelectedNode != null)
     {
         MaterialTypeManager mtm    = new MaterialTypeManager();
         DataTable           dt     = mtm.GetList("").Tables[0];
         DataView            dvTree = new DataView(dt);
         InsNodes            insN   = new InsNodes();
         insN.city_code = treeViewMaterial.SelectedNode.Tag.ToString();
         insN.ShowDialog(this);
         if (Isflag)
         {
             treeViewMaterial.Nodes.Clear();
             AddTree("", null, dvTree);
             isflag = false;
             this.Focus();
         }
     }
     else
     {
         MessageBox.Show("请选择需要增加的上级城市");
     }
 }
Example #3
0
 //编辑节点
 private void conToolStripMenuItemEdit_Click(object sender, EventArgs e)
 {
     if (treeViewClient.SelectedNode != null)
     {
         InsNodes insNodes = new InsNodes();
         City     city     = new City();
         city.City_Name     = treeViewClient.SelectedNode.Text;
         city.City_Code     = treeViewClient.SelectedNode.Tag.ToString();
         city.City_ParentId = treeViewClient.SelectedNode.Parent.Tag.ToString();
         city.City_Clear    = 1;
         city.City_Enable   = 1;
         insNodes.city      = city;
         insNodes.ShowDialog(this);
         if (isflag)
         {
             loadTree();
         }
     }
     else
     {
         MessageBox.Show("请先选择要编辑的节点");
     }
 }