示例#1
0
        void Button2Click(object sender, EventArgs e)
        {
            //新增货品类别
            FormGoodType tF = new FormGoodType();

            tF.Text = "货品类别-新增";

            //将当前选择的项作为父对象填充到对话框中
            TreeNode rd = treeView1.SelectedNode;

            if (rd != null)
            {
                tF.GoodsTypePID   = Int32.Parse(rd.Tag.ToString());
                tF.GoodsTypePName = rd.Text;
            }
            tF.ShowDialog();
            //刷新treeview1显示
            treeView1.Nodes.Clear();
            BLL.GoodsTypeBLL.RefreshView(treeView1);
        }
示例#2
0
        void 修改类别ToolStripMenuItemClick(object sender, EventArgs e)
        {
            //修改货品类别
            FormGoodType tF = new FormGoodType();

            tF.Text = "货品类别-修改";

            //将当前选择的项作为父对象填充到对话框中
            TreeNode rd = treeView1.SelectedNode;

            tF.GoodsTypePID   = Int32.Parse(rd.Parent.Tag.ToString());
            tF.GoodsTypePName = rd.Parent.Text;

            tF.GoodsTypeID   = Int32.Parse(rd.Tag.ToString());
            tF.GoodsTypeName = rd.Text;
            tF.ShowDialog();
            //刷新treeview1显示
            treeView1.Nodes.Clear();
            BLL.GoodsTypeBLL.FillGoodType();
            BLL.GoodsTypeBLL.RefreshView(treeView1);
        }