Ejemplo n.º 1
0
 public DisplayQuote(DeskQuote quote)
 {
     InitializeComponent();
     this.incomingQuote = quote;
     labelUsername.Text = quote.UserName + "'s Desk:";
     //double price = quote.quotePrice;
     label_QuotePrice.Text      = quote.quotePrice.ToString("C");
     label_depth.Text           = quote.desk.depth.ToString();
     label_width.Text           = quote.desk.width.ToString();
     label_drawers.Text         = quote.desk.drawers.ToString();
     label_surfaceMaterial.Text = quote.desk.getSurfaceString(quote.desk.surfaceMaterial);
     label_date.Text            = quote.date.ToString();
     label_rush.Text            = quote.rush.ToString();
 }
Ejemplo n.º 2
0
        public void getQuote_Click(object sender, EventArgs e)
        {
            Desk.Material selectedSurface = (Desk.Material)surface_comboBox.SelectedItem;

            //var selectedSurface = surface_comboBox.ValueMember;
            Desk newDesk = new Desk((int)numericUpDown_Width.Value, (int)numericUpDown_Depth.Value, (int)numericUpDown_Drawers.Value, selectedSurface);

            int       rush  = getSelectedRush();
            DeskQuote quote = new DeskQuote(rush, userName.Text, newDesk);
            double    price = quote.calculateQuotePrice();

            TextWriter file = new StreamWriter(@"../QuoteHistory.txt", true);

            file.WriteLine(quote.rush + "," + quote.UserName + "," + quote.date + "," + newDesk.width + "," + newDesk.depth + "," + newDesk.drawers + "," + newDesk.surfaceMaterial + "," + price);
            file.Close();

            DisplayQuote displayQuoteForm = new DisplayQuote(quote);

            displayQuoteForm.Tag = this;
            displayQuoteForm.Show(this);
            Hide();
        }