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>
|
/// <returns>Cost estimate for the supplied pattern</returns>
|
||||||
public decimal GetCostEstimate(TilePattern pattern)
|
public decimal GetCostEstimate(TilePattern pattern)
|
||||||
{
|
{
|
||||||
// TODO
|
double piecesPerHour = CalcPiecesPerHour(pattern.Style);
|
||||||
return 0;
|
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>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue