public decimal GetTotal() { decimal total = 0; //1. get base cost total += Desk.BaseCost; //2. get surface area total += GetSurfaceCost(); //3. number of drawers total += GetDrawerCost(); //4. get surface material total += Desk.SurfaceMaterial.Cost; //5. rush order days total += RushOrder.GetCost(Desk); FinalQuote = total; return(total); }
//constants public DeskQuote(String text) { Desk = new Desk(); var fields = text.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); CustomerName = fields[0]; Desk.Width = decimal.Parse(fields[1]); Desk.Depth = decimal.Parse(fields[2]); Desk.SurfaceMaterial = new SurfaceMaterial(fields[3], decimal.Parse(fields[4])); Desk.NumberOfDrawers = decimal.Parse(fields[5]); RushOrder = new RushOrder(fields[6], decimal.Parse(fields[7]), decimal.Parse(fields[8]), decimal.Parse(fields[9])); Date = DateTime.Parse(fields[10]); // CustomerName, Desk.Width, // Desk.Depth, Desk.SurfaceMaterial.Name,Desk.SurfaceMaterial.Cost, // Desk.NumberOfDrawers, RushOrder.Name,RushOrder.LowCost,RushOrder.MediumCost,RushOrder.HighCost, Date); }