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); }
public Desk(int width, int depth, int numDrawers, DeskMaterial material) { this.Width = width; this.Depth = depth; this.NumDrawers = numDrawers; this.Material = material; }
public Desk(int isWidth, int isDepth, int isDrawerCount, DeskMaterial isMaterial) { this.Width = isWidth; this.Depth = isDepth; this.DrawerCount = isDrawerCount; this.Material = isMaterial; }
public Desk(int width, int depth, int drawers, DeskMaterial material) { this.DeskWidth = width; this.DeskDepth = depth; this.numberOfDrawers = drawers; this.Material = material; }
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); }
//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(); }
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; }
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; }