[code]
int numberOfDays = 0;
int total = 0;
if (validation.Month == 12 || validation.Month == 01)
{
numberOfDays = 14;
}
total += numberOfDays;
[/code]
The total variable is not storing the numberOfDays total, only 14 is for Dec and Jan, it does not increase.
If statement variable
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Dipa AhujaRank #1,168 · 1.5K reputationPosted Apr 28, 2010, 2:55 AM EDT
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Apr 28, 2010, 3:20 AM EDT
thanks
Sarah Nel19 reputationPosted Apr 28, 2010, 3:42 AM EDT
Dipa AhujaRank #1,168 · 1.5K reputationPosted Apr 28, 2010, 4:43 AM EDT
Amit ChoudharyRank #145 · 15.8K reputationPosted Apr 28, 2010, 8:06 AM EDT
make total global with public and static
public static int total=0;
don' t put it inside the function every time the function called it'll reinitialised with 0 and lost he prev value.
Please mark the "Do you like this post" if it helps you.