Пример #1
0
        public List<ProductCategory> GetAllProductCategory()
        {
            var categoryList = new List<ProductCategory>();
            var category = new ProductCategory();
            category.id = 1;
            category.name = "测试数据1";
            category.parent_id = 0;
            category.is_delete = "0";
            categoryList.Add(category);

            category = new ProductCategory();
            category.id = 2;
            category.name = "测试数据2";
            category.parent_id = 1;
            category.is_delete = "0";
            categoryList.Add(category);

            category = new ProductCategory();
            category.id = 3;
            category.name = "测试数据3";
            category.parent_id = 0;
            category.is_delete = "0";
            categoryList.Add(category);

            category = new ProductCategory();
            category.id = 4;
            category.name = "测试数据4";
            category.parent_id = 3;
            category.is_delete = "0";
            categoryList.Add(category);
            return categoryList;
        }
Пример #2
0
 private void ChooseCategoryClick(object sender, EventArgs e)
 {
     var id = treeList1.FocusedNode.GetValue(CategoryId);
     productCategory = categoryList.Find(c => c.id == Convert.ToInt32(id));
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Пример #3
0
 public IList<ProductCategory> AddProduct()
 {
     IList<ProductCategory> AD = new BindingList<ProductCategory>();
     ProductCategory m = new ProductCategory ();
     m.name  = "测试";
     AD.Add(m);
     return AD;
 }
Пример #4
0
 private void AddProductCategory(int parentId)
 {
     var addCategory = new AddProductCategory();
     var category = new ProductCategory();
     category.parent_id = parentId;
     addCategory.productCategory = category;
     addCategory.ShowDialog();
     if (addCategory.DialogResult == DialogResult.OK)
     {
         categoryList.Add(addCategory.productCategory);
         TreeDataBind(categoryList);
     }
 }
Пример #5
0
 private bool AddCategory(ProductCategory category)
 {
     return false;
 }
Пример #6
0
 public bool AddORUpdateCategory(ProductCategory category)
 {
     return category.id == 0 ? AddCategory(category) : UpdateCategory(category);
 }
Пример #7
0
 private bool UpdateCategory(ProductCategory category)
 {
     return false;
 }