コード例 #1
0
ファイル: DisplayQuote.cs プロジェクト: pDallastra/CIT365
        private void DisplayQuote_Load(object sender, EventArgs e)
        {
            customerQuote = Program.Quotes.GetLatest();

            /* string[] prices = File.ReadAllLines(@"RushOrderPrices.txt");
             * testRushOrder.Text = "";
             * foreach (string rushprice in prices)
             * {
             *
             *   // Use a tab to indent each line of the file.
             *   testRushOrder.Text += "\t" + rushprice + " ";
             * }*/
            try
            {
                int Area  = customerQuote.GetWidth() * customerQuote.GetDepth();
                int rDays = customerQuote.GetRushDays();
                OrderDateLabel.Text         = customerQuote.GetDate();
                ResultsCustomerName.Text    = customerQuote.GetName();
                ResultsRushDays.Text        = customerQuote.GetRushDays().ToString();
                ResultsWidth.Text           = customerQuote.GetWidth().ToString();
                ResultsDepth.Text           = customerQuote.GetDepth().ToString();
                ResultsTotalPrice.Text      = customerQuote.GetPrice().ToString();
                ResultsNumDrawers.Text      = customerQuote.GetNumDrawers().ToString();
                ResultsSurfaceMaterial.Text = customerQuote.GetMaterial().ToString();
                ResultRushOrder.Text        = customerQuote.GetRushOrder(rDays, Area).ToString();
            }
            catch
            {
                ResultsCustomerName.Text    = "";
                ResultsRushDays.Text        = "";
                ResultsWidth.Text           = "";
                ResultsDepth.Text           = "";
                ResultsNumDrawers.Text      = "";
                ResultsSurfaceMaterial.Text = "";
                ResultsTotalPrice.Text      = "Problem calculating total price.";
            }
        }