I have a foreach loop in the code-behind file which is meant to evaluate and calculate for each item shown in a grid and update a total fee on the page. The problem is that the calculation is only returning part of the answer. The part it returns is correct, but it is not performing the full calculation. I believe it is failing when it finds the first condition.
The business logic is this:
If an asset has a monthly or total cost less than or equal to $2000, then the cost of that asset is $1007.95 period, regardless of how many months it is checked out (refer to the duration spinner in the grid).
If an asset has a monthly or total cost greater than $2000, then the cost of that asset is its cost multiplied by the number of months (duration) it is checked out.
I have inherited this bug & project, so I have included the full code for the foreach, and supplied two supporting screenshots below (I have had to obfuscate some of the information in the screenshots but relevant elements are shown).
The Code:
private void PopulateFormFees(CheckOut c)
{
double dblTotalMonthlyFee = 0;
double dblTotalCharge = 0;
c.CheckOutAssets.ForEach(delegate(CheckOutAsset coa)
{
if (coa.UsageFee < 2001)
{
dblTotalMonthlyFee = 1007.95;
dblTotalCharge = 1007.95 * 1;
}
if (coa.UsageFee > 2000)
{
dblTotalMonthlyFee += coa.UsageFee;
dblTotalCharge += (coa.UsageFee * coa.DurationMonths);
}
});
Screencaptures:
Screenshot 1 displays the form data on initial view. Here we can see that the Total Charge label is displaying $5,132.95 which indicates that the foreach loop is calculating for the $4,125.00 fee and one $1,007.95 fee, but not the others.

Screenshot 2 displays an example where duration was increased for each item. Here we see that the Total Charge label is displaying $21,632.95 which indicates that the foreach loop is calculating correctly for the $4,125.00 fee and for one $1,007.95 fee, but not the others.

Thank you for your consideration and taking a look.