private void btnOK_Click(object sender, EventArgs e) { if (this.lvRoles.SelectedIndices.Count > 0) { ORGStaffRoleHelper oRGStaffRoleHelper = new ORGStaffRoleHelper(); for (int i = 0; i < this.lvRoles.SelectedIndices.Count; i++) { ORGRole tag = this.lvRoles.SelectedItems[i].Tag as ORGRole; this._roles.Add(tag); oRGStaffRoleHelper.Add(tag.RoleID, this._staffID.ToString()); } } }
private void btnOK_Click(object sender, EventArgs e) { ORGStaffRoleHelper oRGStaffRoleHelper = new ORGStaffRoleHelper(); for (int i = 0; i < this.lvStaffRole.SelectedIndices.Count; i++) { ListViewItem item = this.lvStaffRole.SelectedItems[i]; Staff tag = item.Tag as Staff; tag.RealName = item.Text; tag.StaffID = item.SubItems[1].Text; this._staffs.Add(tag); oRGStaffRoleHelper.Add(this._RoleID, tag.StaffID); } }