//绑定下拉框的类别数据
 private void LoadCategoryInfoByDelFlag(int p)
 {
     CategoryInfoBll cBll = new CategoryInfoBll();
     List<CategoryInfo> list = cBll.GetAllCategoryInfoByDelFlag(p);
     list.Insert(0, new CategoryInfo() { CName = "请选择", CId = -1 });
     cmbCategory.DataSource = list;
     cmbCategory.DisplayMember = "CName";
     cmbCategory.ValueMember = "CId";
 }
 //显示类别信息的方法
 private void LoadAllCategoryInfoByDelFlag(int p)
 {
     CategoryInfoBll cBll = new CategoryInfoBll();
     dgvCategory.AutoGenerateColumns = false;//禁止自动生成列
     dgvCategory.DataSource = cBll.GetAllCategoryInfoByDelFlag(p);
     dgvCategory.ClearSelection();
 }
 //节点树绑定数据
 private void LoadTvCategoryByDelFlag(int p)
 {
     CategoryInfoBll cbll = new CategoryInfoBll();
     List<CategoryInfo> list = cbll.GetAllCategoryInfoByDelFlag(p);
     for (int i = 0; i < list.Count; i++)
     {
         TreeNode tn = tvCategory.Nodes.Add(list[i].CName);
         //根据商品类别id查找该类别下的所有产品
         LoadProductInfoByCId(tn.Nodes, list[i].CId);
     }
 }