private void butAddUsers_Click(object sender, EventArgs e) { FormUsersToGroup fs = new FormUsersToGroup(); fs.ShowDialog(this); foreach (exUser user in fs.Users) { bool t = false; foreach (ListViewItem tempItem in listViewGroupUsers.Items) { if ((tempItem.Tag as string) == user.UserID) { t = true; continue; } } if (!t) { ListViewItem item = new ListViewItem(user.UserID); item.SubItems.Add(user.UserName); item.ImageIndex = 0; item.Tag = user.UserID; listViewGroupUsers.Items.Add(item); setSelUsersCount(); } } }
private void butAddUsers_Click(object sender, EventArgs e) { FormUsersToGroup fs = new FormUsersToGroup(); fs.ShowDialog(this); foreach ( exUser user in fs.Users) { bool t = false; foreach (ListViewItem tempItem in listViewGroupUsers.Items) if ((tempItem.Tag as string) == user.UserID) { t = true; continue; } if (!t) { ListViewItem item = new ListViewItem(user.UserID); item.SubItems.Add(user.UserName); item.ImageIndex = 0; item.Tag = user.UserID; listViewGroupUsers.Items.Add(item); setSelUsersCount(); } } }