Пример #1
0
    public void PopulateNode(Object sender, TreeNodeEventArgs e)
    {
        // Call the appropriate method to populate a node at a particular level.
        switch (e.Node.Depth)
        {
        case 0:
            // Populate the first-level nodes.
            List <profile> profiles = BusinessRule.GetProfiles(0);

            PopulateLevel(e.Node, profiles);
            break;

        case 1:
            // Populate the second-level nodes.
            //          PopulateProducts(e.Node);
            int    result = 0;
            string value  = e.Node.Value;
            string name   = e.Node.Text;
            int.TryParse(value, out result);
            profiles = BusinessRule.GetProfileParentid(result, name);
            PopulateLevel(e.Node, profiles);
            break;

        default:
            // Do nothing.
            break;
        }
    }