private double getAllSubsSumRate(int id, DateTime dateEnd) { double result = STSysTechEmployeesData.GetEmployeeById(id).GetRate(dateEnd); foreach (STSysTechEmployee emp in STSysTechEmployeesData.GetChildren(id)) { result += getAllSubsSumRate(emp.ID, dateEnd); } return(result); }
public override double GetRate(DateTime dateEnd) { double max_percent = 0.4; double stazh_premia = 0.05 * YearsOfWorking(dateEnd); double current_premia = (stazh_premia > max_percent ? max_percent:stazh_premia) * BaseRate; double result = this.BaseRate + current_premia; foreach (STSysTechEmployee emp in STSysTechEmployeesData.GetChildren(this.ID)) { result += emp.GetRate(dateEnd) * 0.005; } return(result); }