private void btnRemove_Click(object sender, EventArgs e) { if (lstEmp.SelectedItems.Count > 0) { ServiceEmployeesClient client = new ServiceEmployeesClient(); client.DeleteEmployee(Convert.ToInt16(lstEmp.SelectedItems[0].Text)); lstEmp.Items.RemoveAt(lstEmp.SelectedIndices[0]); } ; }
private void btnEliminar_Click(object sender, EventArgs e) { //BLEmployees businessLayer = new BLEmployees(new DALEmployeesEF()); ServiceEmployeesClient client = new ServiceEmployeesClient(); ListView.SelectedListViewItemCollection selected = listEmp.SelectedItems; foreach (ListViewItem item in selected) { int id = Int32.Parse(item.SubItems[0].Text); client.DeleteEmployee(id); } }