private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            EmployeesProxyStub emp = EmployeesDataGrid.SelectedItem as EmployeesProxyStub;

            employees.Collection.Remove(emp);

            emp.MarkAsDeleted();
            service.Employees_SaveEntityAsync(emp);
        }
Пример #2
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection selectedRows = dataGrid.SelectedRows;

            foreach (DataGridViewRow row in selectedRows)
            {
                EmployeesProxyStub emp = row.DataBoundItem as EmployeesProxyStub;
                emp.MarkAsDeleted();
            }

            coll = svc.Employees_SaveCollection(coll);
            this.dataGrid.DataSource = coll.Collection;
        }