1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| if (gr.CodeCategorie == 1)
{
if (cylindree <= 125)
pf = 1;
else if (125 < cylindree && cylindree <= 175)
pf = 2;
else if (175 < cylindree && cylindree <= 250)
pf = 3;
else if (250 < cylindree && cylindree <= 350)
pf = 4;
else if (350 < cylindree && cylindree <= 500)
pf = 5;
else
{
if ((cylindree - 500) % 125 == 0)
pf = 5 + (int)((cylindree - 500) / 125);
else pf = 5 + (int)((cylindree - 500) / 125) + 1;
}
}
else
{
if (codeCarburant.Equals("DI"))
pf = (int)(Math.Truncate(cylindree * 0.00401 * paramM));
else
pf = (int)(Math.Truncate(cylindree * 0.00573 * paramM));
}
return pf; |