private void mnu_DepartmentProperty_Click(object sender, EventArgs e) { Department pc = departmentTree1.SelectedNode.Tag as Department; FrmDepartmentDetail frm = new FrmDepartmentDetail(); frm.IsAdding = false; frm.UpdatingItem = pc; frm.ItemUpdated += delegate(object obj, ItemUpdatedEventArgs args) { departmentTree1.Init(); departmentTree1.SelectDeptNode(pc.ID); FreshData(); }; frm.ShowDialog(); }
private void mnu_AddDepartment_Click(object sender, EventArgs e) { Department pc = departmentTree1.SelectedNode.Tag as Department; FrmDepartmentDetail frm = new FrmDepartmentDetail(); frm.IsAdding = true; frm.ParentDepartment = pc; frm.ItemAdded += delegate(object obj, ItemAddedEventArgs args) { Department item = args.AddedItem as Department; departmentTree1.AddDepartmentNode(item, departmentTree1.SelectedNode); departmentTree1.SelectedNode.Expand(); }; frm.ShowDialog(); }