private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.openFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
            DialogResult result = this.openFileDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                StreamReader inputStream = new StreamReader(File.Open(openFileDialog.FileName, FileMode.Open));
                try
                {
                    loadProductsFromFile(inputStream);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("file errors" + ex.Message);
                }
                finally
                {
                    if (inputStream != null)
                    {
                        inputStream.Close();
                    }
                }
            }
            else
            {
                if (productIdTextBox.Text == "0")
                {
                    MessageBox.Show("Please restart your order!", "Load Order Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    StartForm startForm = new StartForm();
                    startForm.Show();
                    this.Hide();
                }
            }
        }
Exemple #2
0
        private void splashScreenTimer_Tick(object sender, EventArgs e)
        {
            splashScreenTimer.Enabled = false;
            StartForm startForm = new StartForm();

            startForm.Show();
            this.Hide();
        }