Example #1
0
 public MainMenuForm()
 {
     InitializeComponent();
     addQuote          = new AddQuote(this);
     searchAllQuotes   = new SearchAllQuotes(this);
     viewAllQuotes     = new ViewAllQuotes(this);
     this.mainMenuForm = this;
 }
Example #2
0
        public void calculatePrice(Desk desk, AddQuote addQuote)
        {
            int calcSA            = desk.depth * desk.width;
            int drawersPrice      = desk.numOfDrawers * 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 (calcSA > 1000)
            {
                extraSurfacePrice = calcSA - 1000;
            }


            switch (addQuote.getMaterial())
            {
            case "Oak": materialPrice = (int)Desk.DesktopMaterial.Oak;
                price += 200;
                break;

            case "Laminate": materialPrice = (int)Desk.DesktopMaterial.Laminate;
                price += 100;
                break;

            case "Pine": materialPrice = (int)Desk.DesktopMaterial.Pine;
                price += 50;
                break;

            case "Rosewood": materialPrice = (int)Desk.DesktopMaterial.Rosewood;
                price += 300;
                break;

            case "Veneer": materialPrice = (int)Desk.DesktopMaterial.Veneer;
                price += 125;
                break;

            default: materialPrice = 0;
                break;
            }

            if (calcSA > 0 && calcSA < 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 (calcSA >= 1000 && calcSA <= 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 = 200 + extraSurfacePrice + drawersPrice + rushDaysPrice + materialPrice;
        }
Example #3
0
 public void saveQuote(AddQuote addQuote)
 {
     writeJSONFile("Quotes.json", addQuote);
 }