Exemple #1
0
        private void btAddRootCat_Click(object sender, EventArgs e)
        {
            int value = 0;

            QT.Entities.frmShowNumber frm = new Entities.frmShowNumber("ID Chuyên mục");
            if (frm.ShowDialog() == DialogResult.OK)
            {
                value = frm.NumberValue;
            }
            frm.Dispose();

            List <int>    s          = new List <int>();
            List <string> n          = new List <string>();
            int           count      = this.treeList1.FocusedNode.Nodes.Count;
            TreeListNode  nodeParent = this.treeList1.FocusedNode;
            TreeListNodes tn         = this.treeList1.FocusedNode.Nodes;

            for (int i = 0; ;)
            {
                this.treeList1.MoveNext();
                TreeListNode node = this.treeList1.FocusedNode;
                if (node.Level == nodeParent.Level)
                {
                    break;
                }
                if (node.Level == nodeParent.Level + 1)
                {
                    if (node.Nodes.Count == 0)
                    {
                        s.Add(Entities.Common.Obj2Int(this.iDClassificationLabel1.Text));
                        n.Add(this.nameLabel1.Text);
                        i++;
                    }
                }
                if (node.Level == nodeParent.Level + 2)
                {
                    if (node.Nodes.Count == 0)
                    {
                        s.Add(Entities.Common.Obj2Int(this.iDClassificationLabel1.Text));
                        n.Add(this.nameLabel1.Text);
                        i++;
                    }
                }
                if (node.Level == nodeParent.Level + 3)
                {
                    if (node.Nodes.Count == 0)
                    {
                        s.Add(Entities.Common.Obj2Int(this.iDClassificationLabel1.Text));
                        n.Add(this.nameLabel1.Text);
                        i++;
                    }
                }
            }
            MapNode(s, n, value, e);
        }
Exemple #2
0
        private void btAddNoteCate_Click(object sender, EventArgs e)
        {
            int value = 0;

            QT.Entities.frmShowNumber frm = new Entities.frmShowNumber("ID Chuyên mục");
            if (frm.ShowDialog() == DialogResult.OK)
            {
                value = frm.NumberValue;
            }
            frm.Dispose();
            List <int>    s = new List <int>();
            List <String> n = new List <string>();

            s.Add(Entities.Common.Obj2Int(this.iDClassificationLabel1.Text));
            n.Add(this.nameLabel1.Text);
            MapNode(s, n, value, e);
        }