private void ButtonDisplayQuote_Click(object sender, EventArgs e) { if (ValidateChildren(ValidationConstraints.None)) { try { DisplayQuote displayQuote = new DisplayQuote(); Desk myDesk = new Desk(int.Parse(TextBoxDeskWidth.Text), int.Parse(TextBoxDeskDepth.Text), int.Parse(TextBoxNumberOfDrawers.Text), (DesktopMaterial)ComboBoxDesktopMaterial.SelectedItem); DeskQuote myQuote = new DeskQuote(myDesk, ComboBoxRushOrder.Text, TextBoxCustomerName.Text, DateTimePickerOrderDate.Value); // Add Quote to Filer MainMenu.DataFiler.AddQuote(ref myQuote); displayQuote.MyDeskQuote = myQuote; displayQuote.Show(); Close(); } catch (Exception) { MessageBox.Show(@"Error creating DisplayQuote. Check values and try again."); } } }
public void AddQuote(ref DeskQuote quote) { DeskQuotes.Add(quote); }