public void AddTranslationForSeveralIngredients(int startNDBNo, int count)
{
log.InfoFormat("[AddTranslationForSeveralIngredients] startIndex={0}, count={1}.", startNDBNo, count);
List<Ingredient> list = serviceLayer.GetAllIngredients();
int ingrCount = 0;
int ingrNDBNo = 0;
foreach (Ingredient tempIngr in list)
{
if (tempIngr.USDA_NDB_No >= startNDBNo && (ingrCount++ <= count || count == -1))
{
AddTranslationForIngredient(tempIngr);
ingrNDBNo = tempIngr.USDA_NDB_No;
//string text = (tempIngr.LongDesc != null && tempIngr.LongDesc.GetDescription() != null) ? tempIngr.LongDesc.GetDescription() : "";
//log.InfoFormat("[AddTranslationForSeveralIngredients] Ingredient.LongDescription={0}, translation={1}", text, tempIngr.LongDesc.GetDescription("he"));
}
else
{
if (ingrCount > count)
{
log.InfoFormat("[AddTranslationForSeveralIngredients] Last translated Ingredient NDB_No={0}.", ingrNDBNo);
break;
}
}
}
log.InfoFormat("[AddTranslationForSeveralIngredients] Total characters count={0}, ingredientCount={1}.", charsCount, IngredientCount);
}