Beispiel #1
0
        private void mnu_CategoryProperty_Click(object sender, EventArgs e)
        {
            ProductCategory          pc  = categoryTree.SelectedNode.Tag as ProductCategory;
            FrmProductCategoryDetail frm = new FrmProductCategoryDetail();

            frm.IsAdding     = false;
            frm.UpdatingItem = pc;
            frm.ItemUpdated += delegate(object obj, ItemUpdatedEventArgs args)
            {
                categoryTree.Init();
                categoryTree.SelectCategoryNode(pc.ID);
                FreshData();
            };
            frm.ShowDialog();
        }
Beispiel #2
0
        private void mnu_AddCategory_Click(object sender, EventArgs e)
        {
            ProductCategory          pc  = categoryTree.SelectedNode.Tag as ProductCategory;
            FrmProductCategoryDetail frm = new FrmProductCategoryDetail();

            frm.IsAdding       = true;
            frm.ParentCategory = pc;
            frm.ItemAdded     += delegate(object obj, ItemAddedEventArgs args)
            {
                ProductCategory item = args.AddedItem as ProductCategory;
                this.categoryTree.AddCategoryNode(item, categoryTree.SelectedNode);
                categoryTree.SelectedNode.Expand();
            };
            frm.ShowDialog();
        }