private void LoadFromFileButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog
            {
                Multiselect      = false,
                InitialDirectory = Directory.GetParent(Directory.GetParent(Directory.GetCurrentDirectory()).ToString()).ToString() + "\\TestCases\\",
                Filter           = "Text File|*.txt"
            };

            dialog.ShowDialog();
            SimulationSystem system;

            try
            {
                system = TestCaseManager.FromFile(dialog.FileName);
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid File");
                return;
            }
            ClearUI();
            NumOfNewsPapers.Value = system.NumOfNewspapers;
            NumofRecords.Value    = system.NumOfRecords;
            PurchasePrice.Value   = system.PurchasePrice;
            ScrapPrice.Value      = system.ScrapPrice;
            SellingPrice.Value    = system.SellingPrice;
            GoodProbability.Value = system.DayTypeDistributions[0].Probability;
            FairProbability.Value = system.DayTypeDistributions[1].Probability;
            PoorProbabilty.Value  = system.DayTypeDistributions[2].Probability;
            foreach (DemandDistribution d in system.DemandDistributions)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.Cells.Add(new DataGridViewTextBoxCell()
                {
                    Value = d.Demand.ToString()
                });
                foreach (DayTypeDistribution dd in d.DayTypeDistributions)
                {
                    row.Cells.Add(new DataGridViewTextBoxCell()
                    {
                        Value = dd.Probability.ToString()
                    });
                }
                DemandDistributionGrid.Rows.Add(row);
            }
        }
        private void ExportToFileButton_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to write this to a file?\n" + TestCaseManager.ToString(LoadSystemFromUI()), "Export confirmation", MessageBoxButtons.YesNo);

            if (result == DialogResult.No)
            {
                return;
            }
            SaveFileDialog dialog = new SaveFileDialog
            {
                InitialDirectory = Directory.GetParent(Directory.GetParent(Directory.GetCurrentDirectory()).ToString()).ToString() + "\\TestCases\\",
                Filter           = "Text File|*.txt"
            };

            dialog.ShowDialog();
            try
            {
                TestCaseManager.ToFile(LoadSystemFromUI(), dialog.FileName);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error exporting to file\nReason: " + ex.Message);
                return;
            }
            MessageBox.Show("Successfully exported to file");
        }