Ejemplo n.º 1
0
        public void LoadStockGoods()
        {
            this.tvStockGoods.Nodes.Clear();

            TreeNode all = new TreeNode(Foundation.AllGoodsName)
            {
                Tag = 0, ImageIndex = 0, SelectedImageIndex = 1
            };
            DataSet ds = Foundation.GetAllStockGoodsName();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                TreeNode sn = new TreeNode(dr["goodsname"].ToString())
                {
                    Tag = string.Empty, ImageIndex = 2, SelectedImageIndex = 3
                };
                all.Nodes.Add(sn);
            }

            this.tvStockGoods.Nodes.Add(all);
            this.tvStockGoods.SelectedNode = tvStockGoods.Nodes[0];
            this.tvStockGoods.ExpandAll();
        }