private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { string value = comboBox.SelectedItem.ToString(); ProductLocation x = ProductLocation.Get(value); Console.WriteLine(x.Product_Quantity); if (x.Product_Code == "Empty") { listBox.Items.Clear(); listBox.Items.Add("Product location : " + x.Product_Location); listBox.Items.Add("Product Code : " + x.Product_Code); listBox.Items.Add("Product Quantity : " + (x.Product_Quantity)); textBox.IsEnabled = false; button2.IsEnabled = false; } else { Inventory item = Inventory.Get(value); listBox.Items.Clear(); listBox.Items.Add("Product : " + item.Product); listBox.Items.Add("Product Code : " + item.Product_Code); listBox.Items.Add("On Hand : " + item.On_Hand); listBox.Items.Add("On Order : " + item.On_Order); listBox.Items.Add("Reorder Level : " + item.Reorder_Level); listBox.Items.Add("Reorder Quantity : " + item.Reorder_Quantity); textBox.IsEnabled = true; button2.IsEnabled = true; } }