/// <summary>
        /// 方法说明:获取下层PBOM
        /// 作    者:jason.tang
        /// 完成时间:2013-08-30
        /// </summary>
        /// <param name="parentNode">父节点</param>
        /// <param name="childId">子节点ID</param>
        private void ShowPbomChildNode(TreeNode parentNode, string childId)
        {
            //根据物料类型查找物料分类
            List <Model.MaterialVersionModule> versionModuleList
                = MaterialModuleBLL.GetChildPbomMaterialByPbomId(childId);

            if (versionModuleList.Count > 0)
            {
                versionModuleList.ForEach((v) =>
                {
                    TreeNode nod       = new TreeNode();
                    MaterialModule mod = new MaterialModule();
                    mod.code           = v.Code;
                    mod.name           = v.Name;
                    mod.materialverid  = v.MaterialVerId;
                    mod.baseid         = v.BaseId;
                    mod.productname    = v.ProductId;
                    mod.pbomid         = v.ChildId;

                    nod.Text = string.Format("{0}({1})", v.Name, v.Code);
                    //nod.Tag = v;
                    nod.Tag      = mod;
                    nod.Name     = v.ChildId;
                    nod.ImageKey = "materialC";

                    ShowPbomChildNode(nod, v.ChildId);

                    List <Model.ProcessCard> materialCardRelations =
                        MaterialCardRelationBLL.GetProcessCardByMaterialId(v.BaseId, 2);

                    if (materialCardRelations.Count > 0)
                    {
                        materialCardRelations.ForEach((m) =>
                        {
                            TreeNode nd = new TreeNode();
                            nd.Text     = m.Name;
                            nd.Tag      = m.ID;
                            nd.Name     = m.ID.ToString();
                            nd.ImageKey = "card";

                            nod.Nodes.Add(nd);
                            nod.ImageKey = "materialCard";
                        });
                    }

                    parentNode.Nodes.Add(nod);
                    if (nod.ImageKey == "materialCard")
                    {
                        parentNode.ImageKey = nod.ImageKey;
                    }
                });
            }
        }
        /// <summary>
        /// 方法说明:根据根节点加载子节点
        /// 作    者:jason.tang
        /// 完成时间:2013-03-05
        /// </summary>
        /// <param name="parentNode"></param>
        private void LoadPbomChildNode(string categoryid, string code)
        {
            //查找根节点(物料)下的子节点
            materialModuleList = MaterialModuleBLL.GetMaterialModuleListByCategoryId(CategoryTypeIds[0], CategoryTypeIds[1]);

            if (materialModuleList.Count <= 0)
            {
                return;
            }


            List <string> listBaseIds = new List <string>();

            foreach (MaterialModule material in materialModuleList)
            {
                listBaseIds.Add(string.Format("'{0}'", material.baseid));
            }
            string            baseIds        = string.Join(",", listBaseIds.ToArray());
            List <PBomModule> pbomModuleList = MaterialModuleBLL.GetPBomModuleListByBaseId(baseIds);

            if (pbomModuleList.Count <= 0)
            {
                return;
            }

            pbomModuleList.ForEach((o) =>
            {
                TreeNode node = new TreeNode();
                node.Text     = o.FolderName;
                node.Tag      = o.VerId;
                node.Name     = o.VerId;
                node.ImageKey = "materialG";

                node.ExpandAll();

                //根据物料类型查找物料分类
                List <Model.MaterialVersionModule> versionModuleList
                    = MaterialModuleBLL.GetChildPbomMaterialByPbomId(o.VerId);

                if (versionModuleList.Count > 0)
                {
                    versionModuleList.ForEach((v) =>
                    {
                        TreeNode nod       = new TreeNode();
                        MaterialModule mod = new MaterialModule();
                        mod.code           = v.Code;
                        mod.name           = v.Name;
                        mod.materialverid  = v.MaterialVerId;
                        mod.baseid         = v.BaseId;
                        mod.productname    = v.ProductId;
                        mod.pbomid         = v.ChildId;

                        nod.Text = string.Format("{0}({1})", v.Name, v.Code);
                        //nod.Tag = v;
                        nod.Tag      = mod;
                        nod.Name     = v.ChildId;
                        nod.ImageKey = "materialC";

                        ShowPbomChildNode(nod, v.ChildId);

                        List <Model.ProcessCard> materialCardRelations =
                            MaterialCardRelationBLL.GetProcessCardByMaterialId(v.BaseId, 2);

                        if (materialCardRelations.Count > 0)
                        {
                            materialCardRelations.ForEach((m) =>
                            {
                                TreeNode nd = new TreeNode();
                                nd.Text     = m.Name;
                                nd.Tag      = m.ID;
                                nd.Name     = m.ID.ToString();
                                nd.ImageKey = "card";

                                nod.Nodes.Add(nd);
                                nod.ImageKey = "materialCard";
                            });
                        }

                        node.Nodes.Add(nod);
                        if (nod.ImageKey == "materialCard")
                        {
                            node.ImageKey = nod.ImageKey;
                        }
                    });
                }

                ////if (versionModuleList.Count > 0)
                ////{
                ////    versionModuleList.ForEach((v) =>
                ////    {
                ////        TreeNode nod = new TreeNode();
                ////        MaterialModule mod = new MaterialModule();
                ////        mod.code = v.Code;
                ////        mod.name = v.Name;
                ////        mod.materialverid = v.MaterialVerId;
                ////        mod.baseid = v.BaseId;
                ////        mod.productname = v.ProductId;

                ////        nod.Text = string.Format("{0}({1})", v.Code, v.Name);
                ////        //nod.Tag = v;
                ////        nod.Tag = mod;
                ////        nod.Name = v.BaseId;
                ////        nod.ImageKey = "materialC";

                ////        List<Model.ProcessCard> materialCardRelations =
                ////            MaterialCardRelationBLL.GetProcessCardByMaterialId(v.BaseId, 2);

                ////        if (materialCardRelations.Count > 0)
                ////        {
                ////            materialCardRelations.ForEach((m) =>
                ////            {
                ////                TreeNode nd = new TreeNode();
                ////                nd.Text = m.Name;
                ////                nd.Tag = m.ID;
                ////                nd.Name = m.ID.ToString();
                ////                nd.ImageKey = "card";

                ////                nod.Nodes.Add(nd);
                ////            });
                ////        }

                ////        node.Nodes.Add(nod);
                ////    });
                ////}

                tvMaterialPBom.Nodes.Add(node);
            });
        }