Beispiel #1
0
        public DisplayQuote(DeskQuote quote)
        {
            InitializeComponent();
            this.incomingQuote = quote;
            labelUsername.Text = quote.UserName + "'s Desk:";
            double price = quote.calculateQuotePrice();

            label_QuotePrice.Text      = price.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();
        }
Beispiel #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();
        }