private void toolBar_btnEdit_Click(object sender) { if (BranchWalkinsDataGrid.SelectedItem != null) { app_branch_walkins app_branch_walkins = (app_branch_walkins)BranchWalkinsDataGrid.SelectedItem; app_branch_walkins.IsSelected = true; app_branch_walkins.State = EntityState.Modified; } else { toolBar.msgWarning("Please Select an Item"); } }
private void btnDelete_Click(object sender) { try { if (MessageBox.Show("Are you sure want to Delete?", "Cognitivo", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { app_branch_walkins app_branch_walkins = (app_branch_walkins)BranchWalkinsDataGrid.SelectedItem; app_branch_walkins.is_head = false; app_branch_walkins.State = EntityState.Deleted; app_branch_walkins.IsSelected = true; } } catch (Exception ex) { toolBar.msgError(ex); } }