private void openViewQuotesBtn_Click(object sender, EventArgs e)
        {
            DisplayQuotes displayQuotesForm = new DisplayQuotes();

            displayQuotesForm.Tag = this;
            displayQuotesForm.Show(this);
            Hide();
        }
        //Submit Quote and goes to display form showing price.
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            //   Desk newDesk = new Desk(width, depth, drawers, materialcost);
            //  DeskQuote newDeskQuote = new DeskQuote(newDesk, customerName, deskarea, rushday);
            //  quote = Convert.ToString(newDeskQuote.QuotePrice());
            DisplayQuotes displayQuote = new DisplayQuotes(quote);

            displayQuote.Show();
            // Close();
        }
Exemple #3
0
        private void btnAddQuote_Click(object sender, EventArgs e)
        {
            // create desk class
            Desk desk = new Desk();

            desk.Width           = (int)this.widthUpDown.Value;
            desk.Depth           = (int)this.depthUpDown.Value;
            desk.NumberOfDrawers = (int)this.drawersUpDown.Value;
            desk.SurfaceMaterial = (DesktopMaterial)this.cmbSurfaceMaterial.SelectedItem;

            // create desk quote class
            DeskQuote deskQuote = new DeskQuote();

            deskQuote.CustomerName = this.txtboxName.Text;
            deskQuote.Desk         = desk;
            deskQuote.QuoteDate    = DateTime.Now;
            deskQuote.Delievery    = (Delivery)this.cmbDelivery.SelectedItem;
            deskQuote.QuotePrice   = deskQuote.GetQuotePrice();

            try
            {
                // add quote to file
                addQuoteToFile(deskQuote);
                //addQuoteToFile(deskQuote);
            }
            catch (Exception err)
            {
                MessageBox.Show("There is an error when you create a quote. {0}",
                                err.InnerException.ToString());
            }

            var displayQuote = new DisplayQuotes();

            displayQuote.Tag = this;
            displayQuote.Show();
            //displayQuote.DisplayQuote(deskQuote);
            this.Hide();
        }