示例#1
0
        public void Return_Part_Catergories_AND_Parttypes()
        {
            IPartsService repo     = new PartsService(new BadgerDataModel());
            var           category = repo.GetPartCategories();

            Assert.IsTrue(category != null);
        }
        private void LoadTree()
        {
            var categories = _partService.GetPartCategories();

            TreeNode tnode = new TreeNode("Part Types");

            tvPartTypes.Nodes.Add(tnode);

            foreach (var citem in categories)
            {
                TreeNode pNode = new TreeNode(citem.PartCategoryName);
                pNode.Tag = citem;
                tnode.Nodes.Add(pNode);
                foreach (var item in citem.PartTypes)
                {
                    TreeNode tNode = new TreeNode(item.PartTypeName);
                    tNode.Tag = item;
                    pNode.Nodes.Add(tNode);
                }
            }
            tnode.Expand();
        }