private void CreateQuoteButton_Click(object sender, EventArgs e) { try { int depth = int.Parse(depthBox.Text); int width = int.Parse(widthBox.Text); int drawers = int.Parse(drawersBox.Text); int rushDays = int.Parse(rushOrderBox.Text); string material = surfaceMaterialBox.Text; string firstName = firstNameBox.Text; string lastName = lastNameBox.Text; Desk newDesk = new Desk(depth, width, drawers, material); DeskQuote newQuote = new DeskQuote(firstName, lastName, newDesk, rushDays); DisplayQuote display = new DisplayQuote(newQuote); display.Show(); } catch { MessageBox.Show("An error occurred. Check inputs and try again."); } }
public DisplayQuote(DeskQuote quote) { InitializeComponent(); this.quote = quote; buildQuote(); }