public DisplayQuote(DeskQuote dq)
 {
     deskQuote = dq;
     InitializeComponent();
     FormOutputQuote();
 }
        private void SubmitQuoteButton_Click(object sender, EventArgs e)
        {
            WidthTextBox.BackColor   = Color.White;
            DepthTextBox.BackColor   = Color.White;
            DrawersTextBox.BackColor = Color.White;


            int    width;
            int    depth;
            int    drawers;
            string customerName = (string)CustomerNameTextBox.Text;

            customerName.Replace(',', ' ');
            customerName.Replace('"', ' ');

            try
            {
                width = int.Parse(WidthTextBox.Text);
            }
            catch (FormatException ex)
            {
                WidthTextBox.BackColor = Color.Red;
                MessageBox.Show(ex.Message);
                return;
            }

            try
            {
                depth = int.Parse(DepthTextBox.Text);
            }
            catch (FormatException ex)
            {
                DepthTextBox.BackColor = Color.Red;
                MessageBox.Show(ex.Message);
                return;
            }

            try
            {
                drawers = int.Parse(DrawersTextBox.Text);
            }
            catch (FormatException ex)
            {
                DrawersTextBox.BackColor = Color.Red;
                MessageBox.Show(ex.Message);
                return;
            }

            try
            {
                Desk.Materials materials;
                Enum.TryParse <Desk.Materials>(ComboBoxMaterials.SelectedValue.ToString(), out materials);

                int daysRushed;
                if (ThreeShippingRadio.Checked)
                {
                    daysRushed = 3;
                }
                else if (FiveShippingRadio.Checked)
                {
                    daysRushed = 5;
                }
                else if (SevenShippingRadio.Checked)
                {
                    daysRushed = 7;
                }
                else
                {
                    daysRushed = 14;
                }

                DateTime dt = DateTime.Now;

                DeskQuote deskQuote = new DeskQuote(customerName, new Desk(width, depth, drawers, materials), daysRushed, dt.ToString("g"));

                string json = JsonConvert.SerializeObject(deskQuote) + Environment.NewLine;
                File.AppendAllText(path: @"C:\MegaDesk\quotes.json", contents: json);

                DisplayQuote displayQuote = new DisplayQuote(deskQuote);
                displayQuote.Show();
                this.Hide();
                displayQuote.FormClosing += CloseForm;
            } catch (FormatException ex)
            {
                MessageBox.Show(ex.Message);
            }
            catch (InvalidWidthException ex)
            {
                WidthTextBox.BackColor = Color.Red;
                MessageBox.Show(ex.Message);
            }
            catch (InvalidDepthException ex)
            {
                DepthTextBox.BackColor = Color.Red;
                MessageBox.Show(ex.Message);
            }
            catch (InvalidDrawersException ex)
            {
                DrawersTextBox.BackColor = Color.Red;
                MessageBox.Show(ex.Message);
            }
        }