private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (saveFileDialog.ShowDialog() == DialogResult.OK) { FileManagement.Save(saveFileDialog.FileName, Inventory); } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { foreach (Order order in Inventory) { InventoryViewer.Controls.Remove(order); } Inventory = FileManagement.ReadIn(openFileDialog.FileName); foreach (Order order in Inventory) { order.Click += new EventHandler(order_Click); order.Item.InfoLabel.Click += new EventHandler(order_Click); order.InfoLabel.Click += new EventHandler(order_Click); order.OrderLocation.InfoLabel.Click += new EventHandler(order_Click); } UpdateInventory(); } }