Made the GetCostEstimate method in Company.cs
This commit is contained in:
parent
e6b4276661
commit
d8aa1cde7b
1 changed files with 9 additions and 2 deletions
|
|
@ -42,8 +42,15 @@ public sealed class Company
|
|||
/// <returns>Cost estimate for the supplied pattern</returns>
|
||||
public decimal GetCostEstimate(TilePattern pattern)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
double piecesPerHour = CalcPiecesPerHour(pattern.Style);
|
||||
double hours = pattern.Pieces / piecesPerHour;
|
||||
|
||||
decimal productionCost = pattern.CalcProductionCost();
|
||||
decimal workCost = (decimal)hours * _hourlyWage * _workers.Length;
|
||||
decimal basePrice = (decimal)pattern.Area * _m2Price;
|
||||
decimal totalCost = basePrice + productionCost + workCost + (productionCost * _profitMargin / 100);
|
||||
|
||||
return Math.Ceiling(totalCost);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue