private void openAddQuoteButton_Click(object sender, EventArgs e)
        {
            AddQuote addNewQuoteForm = new AddQuote();

            addNewQuoteForm.Tag = this;
            addNewQuoteForm.Show(this);
            Hide();
        }
Esempio n. 2
0
        public void calculatePrice(Desk desk, AddQuote addQuote)
        {
            int basePrice         = 200;
            int deskSurface       = desk.depth * desk.width;
            int drawersPrice      = desk.drawers * 50;
            int rushDays          = this.rushDays;
            int extraSurfacePrice = 0;
            int rushDaysPrice     = 0;
            int materialPrice     = 0;

            int[,] extraCharges = new int[3, 3];

            extraCharges = getRushOrder("rushOrderPrices.txt");


            if (deskSurface > 1000)
            {
                extraSurfacePrice = deskSurface - 1000;
            }


            switch (addQuote.getMaterial())
            {
            case "Oak": materialPrice = (int)Desk.desktopMaterials.Oak; break;

            case "Laminate": materialPrice = (int)Desk.desktopMaterials.Laminate; break;

            case "Pine": materialPrice = (int)Desk.desktopMaterials.Pine; break;

            case "Rossewood": materialPrice = (int)Desk.desktopMaterials.Rossewood; break;

            case "Veneer": materialPrice = (int)Desk.desktopMaterials.Veneer; break;

            default: materialPrice = 0; break;
            }

            if (deskSurface > 0 && deskSurface < 1000)
            {
                switch (rushDays)
                {
                case 3: rushDaysPrice = extraCharges[0, 0]; break;

                case 5: rushDaysPrice = extraCharges[0, 1]; break;

                case 7: rushDaysPrice = extraCharges[0, 2]; break;

                default: rushDaysPrice = 0; break;
                }
            }
            else if (deskSurface >= 1000 && deskSurface <= 2000)
            {
                switch (rushDays)
                {
                case 3: rushDaysPrice = extraCharges[1, 0]; break;

                case 5: rushDaysPrice = extraCharges[1, 1]; break;

                case 7: rushDaysPrice = extraCharges[1, 2]; break;

                default: rushDaysPrice = 0; break;
                }
            }
            else
            {
                switch (rushDays)
                {
                case 3: rushDaysPrice = extraCharges[2, 0]; break;

                case 5: rushDaysPrice = extraCharges[2, 1]; break;

                case 7: rushDaysPrice = extraCharges[2, 2]; break;

                default: rushDaysPrice = 0; break;
                }
            }

            this.price = basePrice + extraSurfacePrice + drawersPrice + rushDaysPrice + materialPrice;
        }
Esempio n. 3
0
 public void saveQuote(AddQuote addQuote)
 {
     writeFile("Quotes.txt", addQuote);
 }