I have the following code that generates an invoice line and includes the month a company has used it's coupons:
invoice.InvoiceLine += CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(month.Month) + " (" + usedThisMonth + "), ";
My problem is that companies have a company language (in the DB it's saved under the values 1 or 2).
1 means the Dutch Language, 2 is the French language.
How would I edit my line to let the months appear in the corresponding languages?
I guess I need to start by:
if(invoice.CompanyLanguage == 1)
{
invoice.InvoiceLine += CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(month.Month) + " (" + usedThisMonth + "), ";
}
else
{
invoice.InvoiceLine += CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(month.Month) + " (" + usedThisMonth + "), ";
}
I have only found samples of creating new CultureInfo
objects but not how to assign it programmatically. How would my code need to look like?