public DeskQuote(desk desk1, String fullName, int rush) { this.quoteNo = GetNextQuoteNo(); this.basePrice = BASE_DESK; this.quoteDate = DateTime.Now; this.inDesk = desk1; this.fullName = fullName; this.rush = rush; this.deskCost = TotalCost(desk1, rush); }
private void btnAddQuote_Click(object sender, EventArgs e) { desk newDesk = new desk(); newDesk.setWidth(Int32.Parse(txtWidth.Text)); newDesk.setDepth(Int32.Parse(txtDepth.Text)); newDesk.setDrawers((int)numDrawers.Value); newDesk.setMaterial((int)lstMaterial.SelectedIndex); DeskQuote newQuote = new DeskQuote(newDesk, txtName.Text, lstRush.SelectedIndex); WriteToDeskFile(newQuote); var displayQuoteForm = new DisplayQuote(); displayQuoteForm.Show(); this.Close(); }
public double TotalCost(desk desk, int rush) { return(BASE_DESK + DrawerCost(desk.getDrawers()) + AreaCost(desk.getWidth(), desk.getDepth()) + SurfaceCost(desk.getMaterial()) + RushRate(rush, desk.getWidth(), desk.getDepth())); }