private void dgStorage_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (dgStorage.SelectedItem == null) { return; } StorageRecord record = (StorageRecord)dgStorage.SelectedItem; ShowStorageEditWindow(record.id); }
private void btnEditProduct_Click(object sender, RoutedEventArgs e) { if (dgStorage.SelectedItem == null) { return; } StorageRecord record = (StorageRecord)dgStorage.SelectedItem; ShowStorageEditWindow(record.id); }
private void btnDeleteProduct_Click(object sender, RoutedEventArgs e) { if (dgStorage.SelectedItem == null) { return; } StorageRecord record = (StorageRecord)dgStorage.SelectedItem; try { StorageSetup.DeleteProduct(record.id); DialogHelper.ShowError("Produkt byl odstraněn"); StorageSetup.InitializeStorageTable(dgStorage); } catch { DialogHelper.ShowError("Produkt nemohl být odstraněn"); } }