/// <summary> /// Creator: Cash Carlson /// Created: 2020/04/29 /// Approver: Rasha Mohammed /// /// Method used for Activate Button on Click /// </summary> /// <remarks> /// Updater: Robert Holmes /// Updated: 5/5/2020 /// Update: No longer crashes if nothing is selected. /// </remarks> /// <param name="sender"></param> /// <param name="e"></param> private void btnActivateProduct_Click(object sender, RoutedEventArgs e) { InventoryItems _inventoryItem = (InventoryItems)dgInventoryItems.SelectedItem; if (_inventoryItem != null) { if (!_inventoryItem.Active) { _productManager.ActivateProduct(_inventoryItem.ProductID); RefreshData(); } else { MessageBox.Show("This product is already active!"); } } }