private void btnSelect_Click(object sender, EventArgs e) { List <Staff> staff = new List <Staff>(); foreach (TreeNode node in treeView1.Nodes) { staff.Add(node.Tag as Staff); } FrmStaffSelection frm = new FrmStaffSelection(); frm.SelectedStaff = staff; if (frm.ShowDialog() == DialogResult.OK) { List <Staff> items = frm.SelectedStaff; if (items != null && items.Count > 0) { this.treeView1.Nodes.Clear(); foreach (Staff item in items) { TreeNode node = new TreeNode(item.Name); node.Tag = item; treeView1.Nodes.Add(node); } } } }
private void label1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { FrmStaffSelection frm = new FrmStaffSelection(); if (frm.ShowDialog() == DialogResult.OK) { List<Staff> items = frm.SelectedStaff; if (items != null && items.Count > 0) { txtStaff.Tag = items[0]; txtStaff.Text = items[0].Name; } } }
private void label1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { FrmStaffSelection frm = new FrmStaffSelection(); if (frm.ShowDialog() == DialogResult.OK) { List <Staff> items = frm.SelectedStaff; if (items != null && items.Count > 0) { txtStaff.Tag = items[0]; txtStaff.Text = items[0].Name; } } }
private void btnSelect_Click(object sender, EventArgs e) { List<Staff> staff = new List<Staff>(); foreach (TreeNode node in treeView1.Nodes) { staff.Add(node.Tag as Staff); } FrmStaffSelection frm = new FrmStaffSelection(); frm.SelectedStaff = staff; if (frm.ShowDialog() == DialogResult.OK) { List<Staff> items = frm.SelectedStaff; if (items != null && items.Count > 0) { this.treeView1.Nodes.Clear(); foreach (Staff item in items) { TreeNode node = new TreeNode(item.Name); node.Tag = item; treeView1.Nodes.Add(node); } } } }