Esempio n. 1
0
        public static int getMaterialPrice(DeskMaterial material)
        {
            int materialPrice;

            switch (material.ToString())
            {
            case "Pine":
                materialPrice = 50;
                break;

            case "Laminate":
                materialPrice = 100;
                break;

            case "Veneer":
                materialPrice = 125;
                break;

            case "Oak":
                materialPrice = 200;
                break;

            case "Rosewood":
                materialPrice = 300;
                break;

            default:
                // Throw an error
                materialPrice = 999;
                break;
            }

            return(materialPrice);
        }
Esempio n. 2
0
 public Desk(int width, int depth, int numDrawers, DeskMaterial material)
 {
     this.Width      = width;
     this.Depth      = depth;
     this.NumDrawers = numDrawers;
     this.Material   = material;
 }
Esempio n. 3
0
 public Desk(int isWidth, int isDepth, int isDrawerCount, DeskMaterial isMaterial)
 {
     this.Width       = isWidth;
     this.Depth       = isDepth;
     this.DrawerCount = isDrawerCount;
     this.Material    = isMaterial;
 }
Esempio n. 4
0
 public Desk(int width, int depth, int drawers, DeskMaterial material)
 {
     this.DeskWidth       = width;
     this.DeskDepth       = depth;
     this.numberOfDrawers = drawers;
     this.Material        = material;
 }
Esempio n. 5
0
 public Desk(double widthArg, double depthArg, int nDrawersArg, string surfaceArg)
 {
     width    = widthArg;
     depth    = depthArg;
     nDrawers = nDrawersArg;
     surface  = (DeskMaterial)Enum.Parse(typeof(DeskMaterial), surfaceArg);
 }
 //Constructor
 public Desk(int inWidth, int inDepth, int inDrawCount, DeskMaterial inMaterial)
 {
     setDeskWidth(inWidth);
     setDeskDepth(inDepth);
     setNumOfDrawers(inDrawCount);
     setMaterial(inMaterial);
 }
Esempio n. 7
0
 //Constructors
 public DeskQuote(string inName, int inWidth, int inDepth, int inDrawerCount, DeskMaterial inMaterial, int inProductionDays)
 {
     desk = new Desk(inWidth, inDepth, inDrawerCount, inMaterial); //Most of the eror handling is already built into Desk class
     setCustomerName(inName);
     setProductionDays(inProductionDays);
     calculateQuote();
     calculateDate();
 }
Esempio n. 8
0
        private const int SURFACEAREA_ADD_PRICE = 1;    //extra charge per square inch over BASE_SIZE

        public DeskQuote(string customerName, DateTime quoteDate, int width, int depth, int drawers, int rush, DeskMaterial material)
        {
            //setting attributes
            CustomerName         = customerName;
            Desk.Width           = width;
            Desk.Depth           = depth;
            Desk.NumberOfDrawers = drawers;
            Desk.DeskMaterial    = material;
            RushDays             = rush;

            //get surface area
            SurfaceArea = Desk.Width * Desk.Depth;
        }
Esempio n. 9
0
 public DisplayQuote(string customerName, string viewDate, int width, int depth, int drawers, DeskMaterial material, int rushDays, int quoteTotal)
 {
     InitializeComponent();
     CustomerNameDisplay.Text = customerName;
     //quoteDateDisplay.Text = quoteDate.ToString("MM/dd/yyyy");
     widthDisplay.Text      = width.ToString();
     depthDisplay.Text      = depth.ToString();
     drawersDisplay.Text    = drawers.ToString();
     materialDisplay.Text   = material.ToString();
     rushDisplay.Text       = rushDays.ToString();
     quoteTotalDisplay.Text = quoteTotal.ToString();
     quoteDateDisplay.Text  = viewDate;
 }
 private void setMaterial(DeskMaterial _material)
 {
     material = _material;
 }