how we can increase and decrease financial year value
how we can increase or decrease the value of financial year. means suppose that financial year is 2013-14 and we want to next 5 or next 10 year of given financial year or previous 5 or 10 years of that financial year what is the code for that

Jignesh TrivediPosted Sep 2, 2014, 12:52 AM
hi,
try...
string CurrentYear = "2013-14"; pyear = new List(); nYear = new List(); final = pyear.Union(nYear).ToList();
int currentYearNumber = int.Parse(CurrentYear.Split('-')[0]);
int j = 10;
List
List
for (int i = 0; i <= 10; i++)
{
pyear.Add(String.Format("{0}-{1}", currentYearNumber - j, ((currentYearNumber - j + 1) % 100).ToString().PadLeft(2,'0')));
nYear.Add(String.Format("{0}-{1}", currentYearNumber + i, ((currentYearNumber + i + 1) % 100).ToString().PadLeft(2,'0')));
j = j - 1;
}
List
In final list you get all previous and next year....
hope this will help you.
VulpesPosted Sep 1, 2014, 9:41 AM
Although it's ASP.NET, I've used a console app for illustration:
The output is :
If you want the second year to always be two digits (e.g. 2008-09 rather than 2008-9), then change this line:
finYears[i - 1] = String.Format("{0}-{1}", year1, (year1 + 1) % 100);
to this:
finYears[i - 1] = String.Format("{0}-{1:D2}", year1, (year1 + 1) % 100);