Ejemplo n.º 1
0
        public string[] FilterQuote(DeskQuote quote)
        {
            string[] filtered = new string[7];
            filtered[0] = quote.desk.CustomerFirstName + " " + quote.desk.CustomerLastName;
            filtered[1] = quote.date.ToShortDateString();
            filtered[2] = quote.desk.DeskWidth.ToString();
            filtered[3] = quote.desk.DeskDepth.ToString();
            filtered[4] = quote.desk.NumDrawers.ToString();
            filtered[5] = quote.desk.SurfaceMaterial.ToString();
            filtered[6] = quote.priceQuote.ToString("C0");

            return(filtered);
        }
Ejemplo n.º 2
0
        private void submitButton_Click(object sender, EventArgs e)
        {
            string firstName = firstNameBox.Text;
            string lastName  = lastNameBox.Text;
            int    width     = int.Parse(deskWidthBox.Text);
            int    depth     = int.Parse(deskDepthBox.Text);
            int    drawers   = int.Parse(numDrawersBox.Text);
            string surface   = surfaceBox.Text;
            int    days      = int.Parse(rushBox.Text);

            Desk      newDesk  = new Desk(firstName, lastName, width, depth, drawers, surface, days);
            DeskQuote newQuote = new DeskQuote(newDesk);
        }
Ejemplo n.º 3
0
        public List <DeskQuote> RetrieveAllQuotes()
        {
            StreamReader     reader = new StreamReader("quotes.json");
            List <DeskQuote> quotes = new List <DeskQuote>();

            while (reader.EndOfStream == false)
            {
                string    line  = reader.ReadLine();
                DeskQuote quote = JsonConvert.DeserializeObject <DeskQuote>(line);
                quotes.Add(quote);
            }
            reader.Close();
            return(quotes);
        }
 public DisplayQuote(DeskQuote deskQuote)
 {
     InitializeComponent();
     desk                   = deskQuote.desk;
     this.deskQuote         = deskQuote;
     quoteTitle.Text        = "Quote for " + desk.CustomerFirstName + " " + desk.CustomerLastName;
     quoteDate.Text         = deskQuote.date.ToShortDateString();
     deskSize.Text          = desk.DeskWidth.ToString() + " X " + desk.DeskDepth.ToString();
     deskPrice.Text         = deskQuote.surfaceAreaPrice.ToString("C0");
     drawers.Text           = desk.NumDrawers.ToString();
     drawersPrice.Text      = deskQuote.drawerPrice.ToString("C0");
     surfaceMaterial.Text   = desk.SurfaceMaterial;
     surfacePriceLabel.Text = deskQuote.surfacePrice.ToString("C0");
     rushOrder.Text         = desk.NumDays.ToString();
     rushPriceLabel.Text    = deskQuote.rushPrice.ToString("C0");
     total.Text             = deskQuote.priceQuote.ToString("C0");
     quotes                 = allQuotes.RetrieveAllQuotes();
     quotes.Add(deskQuote);
 }