private void confirmChanges() { //confirm box for changes. Sets program wide savedChanges bool to true so InventoryScreen knows to look for changes and update as necessary if (MessageBox.Show("Confirm changes?", "Edit item", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes) { Program.savedChanges = true; InventoryItem inventoryItem = new InventoryItem(); inventoryItem.Name = nameTextBox.Text.ToUpper(); inventoryItem.Model = modelTextBox.Text.ToUpper(); inventoryItem.Type = typeTextBox.Text.ToUpper(); inventoryItem.Quantity = (int)quantityUpDown.Value; inventoryItem.Msrp = msrpUpDown.Value; inventoryItem.SalePrice = priceUpDown.Value; Program.thisInventoryItem = inventoryItem; InventoryScreen inventoryScreen = new InventoryScreen(); inventoryScreen.Show(); this.Hide(); } }
private void backButton_Click(object sender, EventArgs e) { InventoryScreen inventoryScreen = new InventoryScreen(); this.Hide(); inventoryScreen.Show(); }
private void viewButton_Click(object sender, EventArgs e) { Program.thisInventoryItem = (InventoryItem)searchDataGrid.SelectedCells[6].Value; InventoryScreen inventoryScreen = new InventoryScreen(); inventoryScreen.Show(this); this.Hide(); }
private void returnToPrevious() { if (Program.fromHomeScreen) { //resets bool Program.fromHomeScreen = false; HomeScreen homeScreen = new HomeScreen(); homeScreen.Show(); this.Hide(); } else { InventoryScreen inventoryScreen = new InventoryScreen(); this.Hide(); inventoryScreen.Show(); } }
private void button1_Click(object sender, EventArgs e) { this.Hide(); inventoryScreen.Show(this); }
private void viewInventoryButton_Click_1(object sender, EventArgs e) { inventoryScreen.Show(this); this.Hide(); }