private void RefreshBoxes()
        {
            //Set the part boxes to the values of the current bike.
            bikeNoLabel.Content             = "Bike " + currentBike.Bike_No + " Component Select:";
            frameSizeBox.SelectedIndex      = currentBike.Frame_Size;
            frameColourBox.SelectedIndex    = currentBike.Frame_Colour;
            groupSetGearsBox.SelectedIndex  = currentBike.GroupSet_Gears;
            groupSetBrakesBox.SelectedIndex = currentBike.GroupSet_Brakes;
            wheelsBox.SelectedIndex         = currentBike.Wheels;
            handlebarsBox.SelectedIndex     = currentBike.FinishingSet_Handlebars;
            saddleBox.SelectedIndex         = currentBike.FinishingSet_Saddle;
            if (currentBike.ExtendedWarranty)
            {
                warrantyCheck.IsChecked = true;
            }
            else
            {
                warrantyCheck.IsChecked = false;
            }

            //Clear the existing items from the cost and time boxes to be replaced with the new values.
            costBreakdown.Items.Clear();
            timeBreakdown.Items.Clear();

            //Reset the total cost counter.
            totalCost = 0;
            costBreakdown.Items.Add("Price Breakdown:");
            int totalTime = 0;

            timeBreakdown.Items.Add("Time Breakdown:");

            //Fill the cost and time breakdown boxs and calculate the current total cost and time by looping through all bikes the customer has ordered.
            for (int bikes = 1; bikes < bikeNo; bikes++)
            {
                Bike bikeDetails = currentCustomer.findBike(bikes);
                costBreakdown.Items.Add("Bike " + bikes + "-");

                String partName;
                String partCost;
                double singleBikeCost = 0;
                int    singleBikeTime = 0;
                int    singlePartTime = 0;

                if (bikeDetails.Frame_Size != 0)
                {
                    partName        = QueryDB("SELECT SizeName FROM Frame_Size WHERE SizeNo=" + bikeDetails.Frame_Size);
                    partCost        = QueryDB("SELECT Price FROM Frame_Size WHERE SizeNo=" + bikeDetails.Frame_Size);
                    singleBikeCost += double.Parse(partCost);
                    singlePartTime  = Int32.Parse(QueryDB("SELECT Time FROM Frame_Size WHERE SizeNo=" + bikeDetails.Frame_Size));
                    if (singlePartTime > singleBikeTime)
                    {
                        singleBikeTime = singlePartTime;
                    }
                    costBreakdown.Items.Add(partName + " frame - £" + partCost);
                }

                if (bikeDetails.Frame_Colour != 0)
                {
                    partName        = QueryDB("SELECT ColourName FROM Frame_Colour WHERE ColourNo=" + bikeDetails.Frame_Colour);
                    partCost        = QueryDB("SELECT Price FROM Frame_Colour WHERE ColourNo=" + bikeDetails.Frame_Colour);
                    singleBikeCost += double.Parse(partCost);
                    singlePartTime  = Int32.Parse(QueryDB("SELECT Time FROM Frame_Colour WHERE ColourNo=" + bikeDetails.Frame_Colour));
                    if (singlePartTime > singleBikeTime)
                    {
                        singleBikeTime = singlePartTime;
                    }
                    costBreakdown.Items.Add(partName + " frame colour - £" + partCost);
                }

                if (bikeDetails.GroupSet_Gears != 0)
                {
                    partName        = QueryDB("SELECT GearsName FROM GroupSet_Gears WHERE GearsNo=" + bikeDetails.GroupSet_Gears);
                    partCost        = QueryDB("SELECT Price FROM GroupSet_Gears WHERE GearsNo=" + bikeDetails.GroupSet_Gears);
                    singleBikeCost += double.Parse(partCost);
                    singlePartTime  = Int32.Parse(QueryDB("SELECT Time FROM GroupSet_Gears WHERE GearsNo=" + bikeDetails.GroupSet_Gears));
                    if (singlePartTime > singleBikeTime)
                    {
                        singleBikeTime = singlePartTime;
                    }
                    costBreakdown.Items.Add(partName + " gears - £" + partCost);
                }

                if (bikeDetails.GroupSet_Brakes != 0)
                {
                    partName        = QueryDB("SELECT BrakesName FROM GroupSet_Brakes WHERE BrakesNo=" + bikeDetails.GroupSet_Brakes);
                    partCost        = QueryDB("SELECT Price FROM GroupSet_Brakes WHERE BrakesNo=" + bikeDetails.GroupSet_Brakes);
                    singleBikeCost += double.Parse(partCost);
                    singlePartTime  = Int32.Parse(QueryDB("SELECT Time FROM GroupSet_Brakes WHERE BrakesNo=" + bikeDetails.GroupSet_Brakes));
                    if (singlePartTime > singleBikeTime)
                    {
                        singleBikeTime = singlePartTime;
                    }
                    costBreakdown.Items.Add(partName + " brakes - £" + partCost);
                }

                if (bikeDetails.Wheels != 0)
                {
                    partName        = QueryDB("SELECT WheelsName FROM Bike_Wheels WHERE WheelsNo=" + bikeDetails.Wheels);
                    partCost        = QueryDB("SELECT Price FROM Bike_Wheels WHERE WheelsNo=" + bikeDetails.Wheels);
                    singleBikeCost += double.Parse(partCost);
                    singlePartTime  = Int32.Parse(QueryDB("SELECT Time FROM Bike_Wheels WHERE WheelsNo=" + bikeDetails.Wheels));
                    if (singlePartTime > singleBikeTime)
                    {
                        singleBikeTime = singlePartTime;
                    }
                    costBreakdown.Items.Add(partName + " wheels - £" + partCost);
                }

                if (bikeDetails.FinishingSet_Handlebars != 0)
                {
                    partName        = QueryDB("SELECT HandlebarsName FROM FinishingSet_Handlebars WHERE HandlebarsNo=" + bikeDetails.FinishingSet_Handlebars);
                    partCost        = QueryDB("SELECT Price FROM FinishingSet_Handlebars WHERE HandlebarsNo=" + bikeDetails.FinishingSet_Handlebars);
                    singleBikeCost += double.Parse(partCost);
                    singlePartTime  = Int32.Parse(QueryDB("SELECT Time FROM FinishingSet_Handlebars WHERE HandlebarsNo=" + bikeDetails.FinishingSet_Handlebars));
                    if (singlePartTime > singleBikeTime)
                    {
                        singleBikeTime = singlePartTime;
                    }
                    costBreakdown.Items.Add(partName + " handlebars - £" + partCost);
                }

                if (bikeDetails.FinishingSet_Saddle != 0)
                {
                    partName        = QueryDB("SELECT SaddleName FROM FinishingSet_Saddle WHERE SaddleNo=" + bikeDetails.FinishingSet_Saddle);
                    partCost        = QueryDB("SELECT Price FROM FinishingSet_Saddle WHERE SaddleNo=" + bikeDetails.FinishingSet_Saddle);
                    singleBikeCost += double.Parse(partCost);
                    singlePartTime  = Int32.Parse(QueryDB("SELECT Time FROM FinishingSet_Saddle WHERE SaddleNo=" + bikeDetails.FinishingSet_Saddle));
                    if (singlePartTime > singleBikeTime)
                    {
                        singleBikeTime = singlePartTime;
                    }
                    costBreakdown.Items.Add(partName + " saddle - £" + partCost);
                }

                if (bikeDetails.ExtendedWarranty)
                {
                    costBreakdown.Items.Add("Extended Warranty - £50");
                    singleBikeCost += 50;
                }

                costBreakdown.Items.Add("Building and Testing - £100");
                singleBikeCost += 100;
                costBreakdown.Items.Add(" ");
                costBreakdown.Items.Add("Bike " + bikeDetails.Bike_No + " total - £" + singleBikeCost);
                totalCost += singleBikeCost;
                costBreakdown.Items.Add(" ");
                costBreakdown.Items.Add(" ");

                if (singleBikeTime > totalTime)
                {
                    totalTime = singleBikeTime;
                }

                timeBreakdown.Items.Add("Bike " + bikeDetails.Bike_No + " Building and testing - Half a day");
            }
            if (totalTime != 0)
            {
                if (totalTime == 1)
                {
                    timeBreakdown.Items.Add("Parts delivery - 1 day");
                }
                else
                {
                    timeBreakdown.Items.Add("Parts delivery - " + totalTime + " days");
                }
            }

            totalTime += (bikeNo / 2);

            //Display the calculated total cost and total time.
            costOut.Text = "Total Cost: £" + totalCost.ToString("0.00");
            if (totalTime == 1)
            {
                timeOut.Text = "Delivery Time: 1 Day";
            }
            else
            {
                timeOut.Text = "Delivery Time: " + totalTime + " Days";
            }
        }