コード例 #1
0
ファイル: EmployeeList.cs プロジェクト: ecasalas/TareNET
 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]);
     }
     ;
 }
コード例 #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);
            }
        }