You need to use recursion -- typically you would only have values at a leaf node in such a case... like this:
public int getSumOfTimes()
{
int sum;
if (subordinates.Count() == 0)
{
sum = getIdealTime();
}
else
{
foreach (var prodel in subordinates)
{
sum += prodel.getSumOfTimes();
}
}
return sum;
}
If you have data at a regular node also then you would need to add a call to getIdealTime() after the foreach