Ejemplo n.º 1
0
 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]);
     }
     ;
 }
Ejemplo n.º 2
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);
            }
        }