");
builder.AppendHtmlLine(" | ");
builder.AppendHtmlLine(" Source ");
if (!String.IsNullOrWhiteSpace(this.source))
{
if (needTopMargin)
{
styleToUse = "style=\"MARGIN-TOP: 0.11in; MARGIN-BOTTOM: 0in;\"";
needTopMargin = false;
}
else
{
styleToUse = "style=\"MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in;\"";
}
builder.AppendFormat(" {0} " + Constants.CRLF,"Source: " + this.source);
}
if (!String.IsNullOrWhiteSpace(this.webpage))
{
if (needTopMargin)
{
styleToUse = "style=\"MARGIN-TOP: 0.11in; MARGIN-BOTTOM: 0in;\"";
needTopMargin = false;
}
else
{
styleToUse = "style=\"MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in;\"";
}
builder.AppendFormat(" {0} " + Constants.CRLF, "Web Page: " + this.webpage);
}
if (!String.IsNullOrWhiteSpace(this.copyright))
{
if (needTopMargin)
{
styleToUse = "style=\"MARGIN-TOP: 0.11in; MARGIN-BOTTOM: 0in;\"";
needTopMargin = false;
}
else
{
styleToUse = "style=\"MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in;\"";
}
builder.AppendFormat(" {0} " + Constants.CRLF, "Copyright: " + this.copyright);
}
}
using (var writer = new System.IO.StringWriter())
{
builder.WriteTo(writer, System.Text.Encodings.Web.HtmlEncoder.Default);
return writer.ToString();
}
}
public void CalcNutrition()
{
alanine = 0;
alcohol = 0;
alcoholfactor = 0;
alphacarotene = 0;
alphalinolenicacid = 0;
arachidonicacid = 0;
arginine = 0;
ash = 0;
asparticacid = 0;
betacarotene = 0;
betacryptoxanthin = 0;
betasitosterol = 0;
betatocopherol = 0;
biotin = 0;
caffeine = 0;
calcium = 0;
calories = 0;
caloriesfromalcohol = 0;
caloriesfromcarbs = 0;
caloriesfromfat = 0;
caloriesfromprotein = 0;
campesterol = 0;
carbohydratefactor = 0;
chloride = 0;
cholesterol = 0;
choline = 0;
chromium = 0;
copper = 0;
cystine = 0;
deltatocopherol = 0;
dihomogammalinolenicacid = 0;
docosahexaenoicacid = 0;
docosapentaenoicacid = 0;
eicosadienoicacid = 0;
eicosapentaenoicacid = 0;
energy = 0;
energyfromalcohol = 0;
energyfromcarbs = 0;
energyfromfat = 0;
energyfromprotein = 0;
fatfactor = 0;
fiber = 0;
fluoride = 0;
folate = 0;
fructose = 0;
galactose = 0;
gammalinolenicacid = 0;
gammatocopherol = 0;
glucose = 0;
glutamicacid = 0;
glycine = 0;
histidine = 0;
hydroxyproline = 0;
iodine = 0;
iron = 0;
isoleucine = 0;
lactose = 0;
leucine = 0;
linoleicacid = 0;
lycopene = 0;
lysine = 0;
magnesium = 0;
maltose = 0;
manganese = 0;
mass = 0;
methionine = 0;
molybdenum = 0;
monounsaturatedfat = 0;
monounsaturatedfattyacid_14_1 = 0;
monounsaturatedfattyacid_15_1 = 0;
monounsaturatedfattyacid_16_1 = 0;
monounsaturatedfattyacid_17_1 = 0;
monounsaturatedfattyacid_18_1 = 0;
monounsaturatedfattyacid_20_1 = 0;
monounsaturatedfattyacid_22_1 = 0;
monounsaturatedfattyacid_24_1 = 0;
netcarbohydrates = 0;
niacin = 0;
omega3fattyacids = 0;
omega6fattyacids = 0;
pantothenicacid = 0;
phenylalanine = 0;
phosphorus = 0;
phytosterols = 0;
polyunsaturatedfat = 0;
polyunsaturatedfattyacid_18_2 = 0;
polyunsaturatedfattyacid_18_3 = 0;
polyunsaturatedfattyacid_18_4 = 0;
polyunsaturatedfattyacid_20_3 = 0;
polyunsaturatedfattyacid_20_4 = 0;
polyunsaturatedfattyacid_21_5 = 0;
polyunsaturatedfattyacid_22_4 = 0;
potassium = 0;
proline = 0;
protein = 0;
proteinfactor = 0;
refuse = 0;
retinol = 0;
riboflavin = 0;
saturatedfat = 0;
saturatedfattyacid_10_0 = 0;
saturatedfattyacid_12_0 = 0;
saturatedfattyacid_13_0 = 0;
saturatedfattyacid_14_0 = 0;
saturatedfattyacid_15_0 = 0;
saturatedfattyacid_16_0 = 0;
saturatedfattyacid_17_0 = 0;
saturatedfattyacid_18_0 = 0;
saturatedfattyacid_20_0 = 0;
saturatedfattyacid_22_0 = 0;
saturatedfattyacid_24_0 = 0;
saturatedfattyacid_4_0 = 0;
saturatedfattyacid_6_0 = 0;
saturatedfattyacid_8_0 = 0;
selenium = 0;
serine = 0;
sodium = 0;
starch = 0;
stigmasterol = 0;
sucrose = 0;
sugar = 0;
sugaralcohols = 0;
theobromine = 0;
thiamin = 0;
threonine = 0;
totalcarbohydrate = 0;
totalfat = 0;
transfattyacids = 0;
transmonoenoicfattyacids = 0;
transpolyenoicfattyacids = 0;
tryptophan = 0;
tyrosine = 0;
valine = 0;
vitamina = 0;
vitaminb12 = 0;
vitaminb6 = 0;
vitaminc = 0;
vitamind = 0;
vitamine = 0;
vitamink = 0;
volume = 0;
water = 0;
zinc = 0;
Single servingsToUse = this.servings;
if (servingsToUse == 0)
{
servingsToUse = 1;
}
foreach (var recipeIngredient in this.recipeIngredients)
{
if (recipeIngredient is RecipeIngredientItem)
{
var recipeIngredientItem = (RecipeIngredientItem)recipeIngredient;
if (recipeIngredientItem.ingredientID != null && recipeIngredientItem.measureID != null)
{
var ingredient = new Ingredient(recipeIngredientItem.ingredientID.Value);
var gramWeight = ingredient.GramWeightByMeasureID(recipeIngredientItem.measureID.Value);
this.alanine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.alanine);
this.alcohol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.alcohol);
this.alphacarotene += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.alphacarotene);
this.alphalinolenicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.alphalinolenicacid);
this.arachidonicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.arachidonicacid);
this.arginine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.arginine);
this.ash += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.ash);
this.asparticacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.asparticacid);
this.betacarotene += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.betacarotene);
this.betacryptoxanthin += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.betacryptoxanthin);
this.betasitosterol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.betasitosterol);
this.betatocopherol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.betatocopherol);
this.biotin += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.biotin);
this.caffeine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.caffeine);
this.calcium += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.calcium);
this.calories += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.calories);
this.caloriesfromalcohol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.caloriesfromalcohol);
this.caloriesfromcarbs += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.caloriesfromcarbs);
this.caloriesfromfat += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.caloriesfromfat);
this.caloriesfromprotein += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.caloriesfromprotein);
this.campesterol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.campesterol);
this.chloride += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.chloride);
this.cholesterol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.cholesterol);
this.choline += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.choline);
this.chromium += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.chromium);
this.copper += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.copper);
this.cystine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.cystine);
this.deltatocopherol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.deltatocopherol);
this.dihomogammalinolenicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.dihomogammalinolenicacid);
this.docosahexaenoicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.docosahexaenoicacid);
this.docosapentaenoicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.docosapentaenoicacid);
this.eicosadienoicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.eicosadienoicacid);
this.eicosapentaenoicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.eicosapentaenoicacid);
this.energy += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.energy);
this.energyfromalcohol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.energyfromalcohol);
this.energyfromcarbs += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.energyfromcarbs);
this.energyfromfat += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.energyfromfat);
this.energyfromprotein += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.energyfromprotein);
this.fiber += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.fiber);
this.fluoride += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.fluoride);
this.folate += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.folate);
this.fructose += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.fructose);
this.galactose += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.galactose);
this.gammalinolenicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.gammalinolenicacid);
this.gammatocopherol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.gammatocopherol);
this.glucose += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.glucose);
this.glutamicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.glutamicacid);
this.glycine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.glycine);
this.histidine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.histidine);
this.hydroxyproline += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.hydroxyproline);
this.iodine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.iodine);
this.iron += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.iron);
this.isoleucine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.isoleucine);
this.lactose += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.lactose);
this.leucine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.leucine);
this.linoleicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.linoleicacid);
this.lycopene += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.lycopene);
this.lysine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.lysine);
this.magnesium += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.magnesium);
this.maltose += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.maltose);
this.manganese += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.manganese);
//mass calculated differently, since it directly uses gramWeight of ingredient
this.mass += recipeIngredientItem.measureQuantity * gramWeight;
this.methionine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.methionine);
this.molybdenum += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.molybdenum);
this.monounsaturatedfat += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfat);
this.monounsaturatedfattyacid_14_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_14_1);
this.monounsaturatedfattyacid_15_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_15_1);
this.monounsaturatedfattyacid_16_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_16_1);
this.monounsaturatedfattyacid_17_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_17_1);
this.monounsaturatedfattyacid_18_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_18_1);
this.monounsaturatedfattyacid_20_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_20_1);
this.monounsaturatedfattyacid_22_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_22_1);
this.monounsaturatedfattyacid_24_1 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.monounsaturatedfattyacid_24_1);
this.netcarbohydrates += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.netcarbohydrates);
this.niacin += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.niacin);
this.omega3fattyacids += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.omega3fattyacids);
this.omega6fattyacids += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.omega6fattyacids);
this.pantothenicacid += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.pantothenicacid);
this.phenylalanine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.phenylalanine);
this.phosphorus += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.phosphorus);
this.phytosterols += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.phytosterols);
this.polyunsaturatedfat += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfat);
this.polyunsaturatedfattyacid_18_2 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfattyacid_18_2);
this.polyunsaturatedfattyacid_18_3 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfattyacid_18_3);
this.polyunsaturatedfattyacid_18_4 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfattyacid_18_4);
this.polyunsaturatedfattyacid_20_3 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfattyacid_20_3);
this.polyunsaturatedfattyacid_20_4 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfattyacid_20_4);
this.polyunsaturatedfattyacid_21_5 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfattyacid_21_5);
this.polyunsaturatedfattyacid_22_4 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.polyunsaturatedfattyacid_22_4);
this.potassium += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.potassium);
this.proline += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.proline);
this.protein += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.protein);
this.refuse += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.refuse);
this.retinol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.retinol);
this.riboflavin += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.riboflavin);
this.saturatedfat += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfat);
this.saturatedfattyacid_10_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_10_0);
this.saturatedfattyacid_12_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_12_0);
this.saturatedfattyacid_13_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_13_0);
this.saturatedfattyacid_14_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_14_0);
this.saturatedfattyacid_15_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_15_0);
this.saturatedfattyacid_16_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_16_0);
this.saturatedfattyacid_17_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_17_0);
this.saturatedfattyacid_18_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_18_0);
this.saturatedfattyacid_20_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_20_0);
this.saturatedfattyacid_22_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_22_0);
this.saturatedfattyacid_24_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_24_0);
this.saturatedfattyacid_4_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_4_0);
this.saturatedfattyacid_6_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_6_0);
this.saturatedfattyacid_8_0 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.saturatedfattyacid_8_0);
this.selenium += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.selenium);
this.serine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.serine);
this.sodium += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.sodium);
this.starch += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.starch);
this.stigmasterol += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.stigmasterol);
this.sucrose += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.sucrose);
this.sugar += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.sugar);
this.sugaralcohols += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.sugaralcohols);
this.theobromine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.theobromine);
this.thiamin += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.thiamin);
this.threonine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.threonine);
this.totalcarbohydrate += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.totalcarbohydrate);
this.totalfat += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.totalfat);
this.transfattyacids += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.transfattyacids);
this.transmonoenoicfattyacids += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.transmonoenoicfattyacids);
this.transpolyenoicfattyacids += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.transpolyenoicfattyacids);
this.tryptophan += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.tryptophan);
this.tyrosine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.tyrosine);
this.valine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.valine);
this.vitamina += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.vitamina);
this.vitaminb12 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.vitaminb12);
this.vitaminb6 += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.vitaminb6);
this.vitaminc += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.vitaminc);
this.vitamind += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.vitamind);
this.vitamine += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.vitamine);
this.vitamink += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.vitamink);
this.volume += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.volume);
this.water += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.water);
this.zinc += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.zinc);
this.alcoholfactor += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.alcoholfactor);
this.carbohydratefactor += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.carbohydratefactor);
this.fatfactor += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.fatfactor);
this.proteinfactor += GetNutrientItemAmount(recipeIngredientItem, gramWeight, ingredient.proteinfactor);
}
}
}
if (this.calories == 0)
{
this.percentcaloriesfromalcohol = 0;
this.percentcaloriesfromcarbs = 0;
this.percentcaloriesfromfat = 0;
this.percentcaloriesfromprotein = 0;
}
else
{
this.percentcaloriesfromalcohol = (100F * this.caloriesfromalcohol) / this.calories;
this.percentcaloriesfromcarbs = (100F * this.caloriesfromcarbs) / this.calories;
this.percentcaloriesfromfat = (100F * this.caloriesfromfat) / this.calories;
this.percentcaloriesfromprotein = (100F * this.caloriesfromprotein) / this.calories;
}
this.netcarbohydrates = this.totalcarbohydrate - this.fiber - this.sugaralcohols;
this.alanine = this.alanine / servingsToUse;
this.alcohol = this.alcohol / servingsToUse;
this.alcoholfactor = this.alcoholfactor / servingsToUse;
this.alphacarotene = this.alphacarotene / servingsToUse;
this.alphalinolenicacid = this.alphalinolenicacid / servingsToUse;
this.arachidonicacid = this.arachidonicacid / servingsToUse;
this.arginine = this.arginine / servingsToUse;
this.ash = this.ash / servingsToUse;
this.asparticacid = this.asparticacid / servingsToUse;
this.betacarotene = this.betacarotene / servingsToUse;
this.betacryptoxanthin = this.betacryptoxanthin / servingsToUse;
this.betasitosterol = this.betasitosterol / servingsToUse;
this.betatocopherol = this.betatocopherol / servingsToUse;
this.biotin = this.biotin / servingsToUse;
this.caffeine = this.caffeine / servingsToUse;
this.calcium = this.calcium / servingsToUse;
this.calories = this.calories / servingsToUse;
this.caloriesfromalcohol = this.caloriesfromalcohol / servingsToUse;
this.caloriesfromcarbs = this.caloriesfromcarbs / servingsToUse;
this.caloriesfromfat = this.caloriesfromfat / servingsToUse;
this.caloriesfromprotein = this.caloriesfromprotein / servingsToUse;
this.campesterol = this.campesterol / servingsToUse;
this.carbohydratefactor = this.carbohydratefactor / servingsToUse;
this.chloride = this.chloride / servingsToUse;
this.cholesterol = this.cholesterol / servingsToUse;
this.choline = this.choline / servingsToUse;
this.chromium = this.chromium / servingsToUse;
this.copper = this.copper / servingsToUse;
this.cystine = this.cystine / servingsToUse;
this.deltatocopherol = this.deltatocopherol / servingsToUse;
this.dihomogammalinolenicacid = this.dihomogammalinolenicacid / servingsToUse;
this.docosahexaenoicacid = this.docosahexaenoicacid / servingsToUse;
this.docosapentaenoicacid = this.docosapentaenoicacid / servingsToUse;
this.eicosadienoicacid = this.eicosadienoicacid / servingsToUse;
this.eicosapentaenoicacid = this.eicosapentaenoicacid / servingsToUse;
this.energy = this.energy / servingsToUse;
this.energyfromalcohol = this.energyfromalcohol / servingsToUse;
this.energyfromcarbs = this.energyfromcarbs / servingsToUse;
this.energyfromfat = this.energyfromfat / servingsToUse;
this.energyfromprotein = this.energyfromprotein / servingsToUse;
this.fatfactor = this.fatfactor / servingsToUse;
this.fiber = this.fiber / servingsToUse;
this.fluoride = this.fluoride / servingsToUse;
this.folate = this.folate / servingsToUse;
this.fructose = this.fructose / servingsToUse;
this.galactose = this.galactose / servingsToUse;
this.gammalinolenicacid = this.gammalinolenicacid / servingsToUse;
this.gammatocopherol = this.gammatocopherol / servingsToUse;
this.glucose = this.glucose / servingsToUse;
this.glutamicacid = this.glutamicacid / servingsToUse;
this.glycine = this.glycine / servingsToUse;
this.histidine = this.histidine / servingsToUse;
this.hydroxyproline = this.hydroxyproline / servingsToUse;
this.iodine = this.iodine / servingsToUse;
this.iron = this.iron / servingsToUse;
this.isoleucine = this.isoleucine / servingsToUse;
this.lactose = this.lactose / servingsToUse;
this.leucine = this.leucine / servingsToUse;
this.linoleicacid = this.linoleicacid / servingsToUse;
this.lycopene = this.lycopene / servingsToUse;
this.lysine = this.lysine / servingsToUse;
this.magnesium = this.magnesium / servingsToUse;
this.maltose = this.maltose / servingsToUse;
this.manganese = this.manganese / servingsToUse;
this.mass = this.mass / servingsToUse;
this.methionine = this.methionine / servingsToUse;
this.molybdenum = this.molybdenum / servingsToUse;
this.monounsaturatedfat = this.monounsaturatedfat / servingsToUse;
this.monounsaturatedfattyacid_14_1 = this.monounsaturatedfattyacid_14_1 / servingsToUse;
this.monounsaturatedfattyacid_15_1 = this.monounsaturatedfattyacid_15_1 / servingsToUse;
this.monounsaturatedfattyacid_16_1 = this.monounsaturatedfattyacid_16_1 / servingsToUse;
this.monounsaturatedfattyacid_17_1 = this.monounsaturatedfattyacid_17_1 / servingsToUse;
this.monounsaturatedfattyacid_18_1 = this.monounsaturatedfattyacid_18_1 / servingsToUse;
this.monounsaturatedfattyacid_20_1 = this.monounsaturatedfattyacid_20_1 / servingsToUse;
this.monounsaturatedfattyacid_22_1 = this.monounsaturatedfattyacid_22_1 / servingsToUse;
this.monounsaturatedfattyacid_24_1 = this.monounsaturatedfattyacid_24_1 / servingsToUse;
this.netcarbohydrates = this.netcarbohydrates / servingsToUse;
this.niacin = this.niacin / servingsToUse;
this.omega3fattyacids = this.omega3fattyacids / servingsToUse;
this.omega6fattyacids = this.omega6fattyacids / servingsToUse;
this.pantothenicacid = this.pantothenicacid / servingsToUse;
this.phenylalanine = this.phenylalanine / servingsToUse;
this.phosphorus = this.phosphorus / servingsToUse;
this.phytosterols = this.phytosterols / servingsToUse;
this.polyunsaturatedfat = this.polyunsaturatedfat / servingsToUse;
this.polyunsaturatedfattyacid_18_2 = this.polyunsaturatedfattyacid_18_2 / servingsToUse;
this.polyunsaturatedfattyacid_18_3 = this.polyunsaturatedfattyacid_18_3 / servingsToUse;
this.polyunsaturatedfattyacid_18_4 = this.polyunsaturatedfattyacid_18_4 / servingsToUse;
this.polyunsaturatedfattyacid_20_3 = this.polyunsaturatedfattyacid_20_3 / servingsToUse;
this.polyunsaturatedfattyacid_20_4 = this.polyunsaturatedfattyacid_20_4 / servingsToUse;
this.polyunsaturatedfattyacid_21_5 = this.polyunsaturatedfattyacid_21_5 / servingsToUse;
this.polyunsaturatedfattyacid_22_4 = this.polyunsaturatedfattyacid_22_4 / servingsToUse;
this.potassium = this.potassium / servingsToUse;
this.proline = this.proline / servingsToUse;
this.protein = this.protein / servingsToUse;
this.proteinfactor = this.proteinfactor / servingsToUse;
this.refuse = this.refuse / servingsToUse;
this.retinol = this.retinol / servingsToUse;
this.riboflavin = this.riboflavin / servingsToUse;
this.saturatedfat = this.saturatedfat / servingsToUse;
this.saturatedfattyacid_10_0 = this.saturatedfattyacid_10_0 / servingsToUse;
this.saturatedfattyacid_12_0 = this.saturatedfattyacid_12_0 / servingsToUse;
this.saturatedfattyacid_13_0 = this.saturatedfattyacid_13_0 / servingsToUse;
this.saturatedfattyacid_14_0 = this.saturatedfattyacid_14_0 / servingsToUse;
this.saturatedfattyacid_15_0 = this.saturatedfattyacid_15_0 / servingsToUse;
this.saturatedfattyacid_16_0 = this.saturatedfattyacid_16_0 / servingsToUse;
this.saturatedfattyacid_17_0 = this.saturatedfattyacid_17_0 / servingsToUse;
this.saturatedfattyacid_18_0 = this.saturatedfattyacid_18_0 / servingsToUse;
this.saturatedfattyacid_20_0 = this.saturatedfattyacid_20_0 / servingsToUse;
this.saturatedfattyacid_22_0 = this.saturatedfattyacid_22_0 / servingsToUse;
this.saturatedfattyacid_24_0 = this.saturatedfattyacid_24_0 / servingsToUse;
this.saturatedfattyacid_4_0 = this.saturatedfattyacid_4_0 / servingsToUse;
this.saturatedfattyacid_6_0 = this.saturatedfattyacid_6_0 / servingsToUse;
this.saturatedfattyacid_8_0 = this.saturatedfattyacid_8_0 / servingsToUse;
this.selenium = this.selenium / servingsToUse;
this.serine = this.serine / servingsToUse;
this.sodium = this.sodium / servingsToUse;
this.starch = this.starch / servingsToUse;
this.stigmasterol = this.stigmasterol / servingsToUse;
this.sucrose = this.sucrose / servingsToUse;
this.sugar = this.sugar / servingsToUse;
this.sugaralcohols = this.sugaralcohols / servingsToUse;
this.theobromine = this.theobromine / servingsToUse;
this.thiamin = this.thiamin / servingsToUse;
this.threonine = this.threonine / servingsToUse;
this.totalcarbohydrate = this.totalcarbohydrate / servingsToUse;
this.totalfat = this.totalfat / servingsToUse;
this.transfattyacids = this.transfattyacids / servingsToUse;
this.transmonoenoicfattyacids = this.transmonoenoicfattyacids / servingsToUse;
this.transpolyenoicfattyacids = this.transpolyenoicfattyacids / servingsToUse;
this.tryptophan = this.tryptophan / servingsToUse;
this.tyrosine = this.tyrosine / servingsToUse;
this.valine = this.valine / servingsToUse;
this.vitamina = this.vitamina / servingsToUse;
this.vitaminb12 = this.vitaminb12 / servingsToUse;
this.vitaminb6 = this.vitaminb6 / servingsToUse;
this.vitaminc = this.vitaminc / servingsToUse;
this.vitamind = this.vitamind / servingsToUse;
this.vitamine = this.vitamine / servingsToUse;
this.vitamink = this.vitamink / servingsToUse;
this.volume = this.volume / servingsToUse;
this.water = this.water / servingsToUse;
this.zinc = this.zinc / servingsToUse;
}
public Single GetNutrientItemAmount(RecipeIngredientItem recipeIngredientItem, Single gramWeight, Single nutrientAmount)
{
return recipeIngredientItem.measureQuantity * nutrientAmount * (gramWeight / 100.0F);
}
public void AddToWordDoc(Microsoft.Office.Interop.Word.Application objWord, Dictionary recipePageDictionary, SortedList recipesAlpha, SortedSet pagesAlreadyAdded)
{
String pageNameToUse = SharedRoutines.RemoveSpecialCharactersFromFileName(this.recipename);
String pageNameToUseWithExtension = pageNameToUse;
while (pagesAlreadyAdded.Contains(pageNameToUseWithExtension.ToUpper()))
{
pageNameToUse += "1";
pageNameToUseWithExtension = pageNameToUse;
}
recipePageDictionary.Add(this.recipeID.Value, pageNameToUseWithExtension);
recipesAlpha.Add(this.recipename.ToUpper(), this);
pagesAlreadyAdded.Add(pageNameToUseWithExtension.ToUpper());
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 1, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Cells[1].LeftPadding = 0;
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineWidth = WdLineWidth.wdLineWidth050pt;
//objWord.Selection.Font.Bold = 1;
//objWord.Selection.Font.Size = clsWord.WORD_RECIPE_NAME_FONT_SIZE;
//objWord.Selection.TypeText(this.recipename);
//objWord.Selection.Font.Bold = 0;
objWord.Selection.set_Style(objWord.ActiveDocument.Styles["Heading 2"]);
objWord.Selection.TypeText(this.recipename);
//objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
objWord.Selection.set_Style(objWord.ActiveDocument.Styles["Normal"]);
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.Selection.ParagraphFormat.LineSpacingRule = WdLineSpacing.wdLineSpaceSingle;
objWord.Selection.ParagraphFormat.SpaceAfter = 0F;
objWord.ActiveDocument.Indexes.MarkEntry(objWord.Selection.Range, this.recipename, this.recipename, String.Empty, String.Empty, String.Empty, 0, 0);
clsWord.AddHalfSpaceLineAtEndOfDocument();
WordDocAddComments(objWord);
WordDocAddAllIngredients(objWord);
WordDocAddAllProcedures(objWord);
WordDocAddServingsYieldNutrition(objWord);
WordDocAddAllTips(objWord);
WordDocAddSourceInfo(objWord);
if (RecipeRenderedEvent != null)
{
RecipeRenderedEvent.Invoke(this, new EventArgs());
}
}
public void WordDocAddComments(Microsoft.Office.Interop.Word.Application objWord)
{
if (!String.IsNullOrWhiteSpace(this.comments))
{
objWord.Selection.TypeText(this.comments);
objWord.Selection.TypeParagraph();
clsWord.AddHalfSpaceLineAtEndOfDocument();
}
}
private void WordDocAddAllIngredients(Microsoft.Office.Interop.Word.Application objWord)
{
if (this.recipeIngredients.Count > 0)
{
//First build the two columns
List ingredientsFirstColumn = new List();
List ingredientsSecondColumn = new List();
for (int intIngredientIndex = 0; intIngredientIndex < this.recipeIngredients.Count; intIngredientIndex++)
{
if (intIngredientIndex < ((double)this.recipeIngredients.Count / 2D))
{
ingredientsFirstColumn.Add(this.recipeIngredients[intIngredientIndex]);
}
else
{
ingredientsSecondColumn.Add(this.recipeIngredients[intIngredientIndex]);
}
}
if (ingredientsFirstColumn.Count > 0 && ingredientsSecondColumn.Count > 0)
{
//Check for only two ingredients. If so, put both on first column
if (ingredientsFirstColumn.Count == 1 && ingredientsSecondColumn.Count == 1)
{
ingredientsFirstColumn.Add(ingredientsSecondColumn[0]);
ingredientsSecondColumn.RemoveAt(0);
}
else
{
//Check for orphan header at end of first column. Move to second column if orphaned
if (ingredientsFirstColumn[ingredientsFirstColumn.Count - 1].isHeading && ingredientsSecondColumn[ingredientsSecondColumn.Count - 1].isHeading == false)
{
ingredientsSecondColumn.Insert(0, ingredientsFirstColumn[ingredientsFirstColumn.Count - 1]);
ingredientsFirstColumn.RemoveAt(ingredientsFirstColumn.Count - 1);
}
}
}
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 7, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Tables[1].Rows.AllowBreakAcrossPages = 0;
objWord.Selection.Cells[1].LeftPadding = 0;
objWord.Selection.Tables[1].Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Tables[1].Borders.InsideLineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
//Now put those two columns into the table
for (int intIngredientIndex = 0; intIngredientIndex < ingredientsFirstColumn.Count || intIngredientIndex < ingredientsSecondColumn.Count; intIngredientIndex++)
{
if (intIngredientIndex > 0)
{
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
}
if (intIngredientIndex <= ingredientsFirstColumn.Count - 1)
{
WordDocAddIngredient(objWord, ingredientsFirstColumn[intIngredientIndex]);
}
else
{
//make up for empty ingredient
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
}
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
if (intIngredientIndex <= ingredientsSecondColumn.Count - 1)
{
WordDocAddIngredient(objWord, ingredientsSecondColumn[intIngredientIndex]);
}
}
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
clsWord.AddHalfSpaceLineAtEndOfDocument();
}
}
private void WordDocAddIngredient(Microsoft.Office.Interop.Word.Application objWord, RecipeIngredient ingredient)
{
if (ingredient.isHeading)
{
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText(ingredient.ingredientText);
}
else
{
objWord.Selection.TypeText(((RecipeIngredientItem)ingredient).quantityText);
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(((RecipeIngredientItem)ingredient).unitText);
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(ingredient.ingredientText);
}
}
private void WordDocAddAllProcedures(Microsoft.Office.Interop.Word.Application objWord)
{
if (this.recipeProcedures.Count > 0)
{
int taskNumber = 1;
bool blnInTable = false;
foreach (var recipeProcedure in this.recipeProcedures)
{
if (recipeProcedure.isHeading)
{
if (blnInTable)
{
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
blnInTable = false;
}
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText(recipeProcedure.procedureText);
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeParagraph();
//reset task number
taskNumber = 1;
}
else
{
if (blnInTable)
{
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
}
else
{
blnInTable = true;
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 2, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Tables[1].Rows.AllowBreakAcrossPages = 0;
objWord.Selection.Tables[1].BottomPadding = objWord.InchesToPoints(0.07F);
objWord.Selection.Cells[1].Column.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Cells[1].Column.PreferredWidth = 4F;
objWord.Selection.Cells[1].LeftPadding = 0;
objWord.Selection.Tables[1].Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Tables[1].Borders.InsideLineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Cells[1].Column.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Cells[1].Column.PreferredWidth = 96F;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
}
objWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphRight;
objWord.Selection.TypeText(taskNumber.ToString());
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphLeft;
objWord.Selection.TypeText(recipeProcedure.procedureText);
taskNumber += 1;
}
}
if (blnInTable)
{
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
blnInTable = false;
}
clsWord.AddHalfSpaceLineAtEndOfDocument();
}
}
private void WordDocAddServingsYieldNutrition(Microsoft.Office.Interop.Word.Application objWord)
{
var servingsToUse = this.servings;
if (servingsToUse == 0)
{
servingsToUse = 1;
}
bool blnNeedSpaceBeforeNutrition = false;
if (this.servings > 0)
{
objWord.Selection.TypeText("Servings: " + this.servings.ToString());
objWord.Selection.TypeParagraph();
blnNeedSpaceBeforeNutrition = true;
}
if (!String.IsNullOrWhiteSpace(this.yield))
{
objWord.Selection.TypeText("Yield: " + this.yield);
objWord.Selection.TypeParagraph();
blnNeedSpaceBeforeNutrition = true;
}
if (blnNeedSpaceBeforeNutrition)
{
clsWord.AddHalfSpaceLineAtEndOfDocument();
}
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 1, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Cells[1].LeftPadding = 0;
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Tables[1].Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Tables[1].Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Tables[1].Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineWidth = WdLineWidth.wdLineWidth050pt;
objWord.Selection.Font.Bold = 1;
objWord.Selection.Font.Size = clsWord.WORD_RECIPE_SECTION_HEADING_FONT_SIZE;
objWord.Selection.TypeText("Nutrition Facts");
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
clsWord.AddHalfSpaceLineAtEndOfDocument();
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 2, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Tables[1].Rows.AllowBreakAcrossPages = 0;
objWord.Selection.Tables[1].Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Tables[1].Borders.InsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Cells[1].Column.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Cells[1].Column.PreferredWidth = 67F;
objWord.Selection.Cells[1].LeftPadding = 0;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Cells[1].Column.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Cells[1].Column.PreferredWidth = 33F;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = WdLineStyle.wdLineStyleNone;
//objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
if (servingsToUse == 1)
{
objWord.Selection.TypeText(String.Format("Serving size: Entire recipe. ({0}g)", this.mass.ToString("F2")));
}
else
{
objWord.Selection.TypeText(String.Format("Serving size: 1/{0} of a recipe. ({1}g)", servingsToUse.ToString(), this.mass.ToString("F2")));
}
objWord.Selection.TypeParagraph();
objWord.Selection.TypeText("Percent daily values based on the Reference Daily Intake (RDI) for a 2000 calorie diet.");
objWord.Selection.TypeParagraph();
objWord.Selection.TypeText("Nutrition information calculated from recipe ingredients.");
int totalIngredients = 0;
int totalIngredientsLinked = 0;
int totalIngredientsNotLinked = 0;
foreach (var recipeIngredient in this.recipeIngredients)
{
if (recipeIngredient is RecipeIngredientItem)
{
totalIngredients += 1;
var recipeIngredientItem = (RecipeIngredientItem)recipeIngredient;
if (recipeIngredientItem.ingredientID != null)
{
totalIngredientsLinked += 1;
}
else
{
totalIngredientsNotLinked += 1;
}
}
}
if (totalIngredients > 0 && totalIngredientsNotLinked > 0)
{
objWord.Selection.TypeParagraph();
if (totalIngredientsNotLinked == 1)
{
objWord.Selection.TypeText("There is an ingredient not linked for nutrition");
}
else
{
objWord.Selection.TypeText(String.Format("There are {0} ingredient(s) not linked for nutrition", totalIngredientsNotLinked.ToString()));
}
}
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 2, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Tables[1].Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Tables[1].Borders.InsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Tables[1].AllowPageBreaks = false;
objWord.Selection.Cells[1].Column.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Cells[1].Column.PreferredWidth = 60F;
objWord.Selection.Cells[1].LeftPadding = 0;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineWidth = WdLineWidth.wdLineWidth300pt;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineWidth = WdLineWidth.wdLineWidth050pt;
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Cells[1].Column.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Cells[1].Column.PreferredWidth = 40F;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineWidth = WdLineWidth.wdLineWidth300pt;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineWidth = WdLineWidth.wdLineWidth050pt;
objWord.Selection.MoveLeft(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Size = clsWord.WORD_NUTRITION_FONT_SIZE;
objWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphLeft;
objWord.Selection.TypeText("Amount Per Serving");
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphRight;
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Size = clsWord.WORD_NUTRITION_FONT_SIZE;
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText("Calories");
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Size = clsWord.WORD_NUTRITION_FONT_SIZE;
objWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphRight;
objWord.Selection.TypeText(this.calories.ToString("F2"));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" Calories From Fat ({0}%)", this.percentcaloriesfromfat.ToString("F0")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}", this.caloriesfromfat.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineWidth = WdLineWidth.wdLineWidth150pt;
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineWidth = WdLineWidth.wdLineWidth150pt;
objWord.Selection.TypeText("% Daily Value");
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineWidth = WdLineWidth.wdLineWidth050pt;
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText("Total Fat");
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" {0}g", this.totalfat.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.totalfat * 100) / Constants.DAILY_VALUE_FAT).ToString("F0")));
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderTop].LineWidth = WdLineWidth.wdLineWidth050pt;
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" Saturated Fat {0}g", this.saturatedfat.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.saturatedfat * 100) / Constants.DAILY_VALUE_SATURATED_FAT).ToString("F0")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText("Cholesterol");
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" {0}mg", this.cholesterol.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.cholesterol * 100) / Constants.DAILY_VALUE_CHOLESTEROL).ToString("F0")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText("Sodium");
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" {0}mg" , this.sodium.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.sodium * 100) / Constants.DAILY_VALUE_SODIUM).ToString("F0")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText("Potassium");
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" {0}mg", this.potassium.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.potassium * 100) / Constants.DAILY_VALUE_POTASSIUM).ToString("F0")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText("Total Carbohydrates");
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" {0}g", this.totalcarbohydrate.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.totalcarbohydrate * 100) / Constants.DAILY_VALUE_TOTAL_CARBOHYDRATE).ToString("F0")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" Fiber {0}g", this.fiber.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.fiber * 100) / Constants.DAILY_VALUE_DIETARY_FIBER).ToString("F0")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("Sugar {0}g", this.sugar.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.Font.Bold = 1;
objWord.Selection.TypeText("Protein");
objWord.Selection.Font.Bold = 0;
objWord.Selection.TypeText(String.Format(" {0}g", this.protein.ToString("F2")));
objWord.Selection.MoveRight(Microsoft.Office.Interop.Word.WdUnits.wdCell, 1);
objWord.Selection.TypeText(String.Format("{0}%", ((this.protein * 100) / Constants.DAILY_VALUE_PROTEIN).ToString("F0")));
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
clsWord.AddHalfSpaceLineAtEndOfDocument();
}
private void WordDocAddAllTips(Microsoft.Office.Interop.Word.Application objWord)
{
if (this.recipeTips.Count > 0)
{
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 1, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Cells[1].LeftPadding = 0;
objWord.Selection.Tables[1].Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineWidth = WdLineWidth.wdLineWidth050pt;
objWord.Selection.Font.Bold = 1;
objWord.Selection.Font.Size = clsWord.WORD_RECIPE_SECTION_HEADING_FONT_SIZE;
objWord.Selection.TypeText("Tips");
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
foreach (var recipeTip in this.recipeTips)
{
if (recipeTip.isHeading)
{
objWord.Selection.Font.Bold = 1;
}
else
{
objWord.Selection.Font.Bold = 0;
}
objWord.Selection.TypeText(recipeTip.tipText);
objWord.Selection.TypeParagraph();
objWord.Selection.Font.Bold = 0;
}
clsWord.AddHalfSpaceLineAtEndOfDocument();
}
}
private void WordDocAddSourceInfo(Microsoft.Office.Interop.Word.Application objWord)
{
if (!String.IsNullOrWhiteSpace(this.source) || !String.IsNullOrWhiteSpace(this.webpage) || !String.IsNullOrWhiteSpace(this.copyright))
{
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.ActiveDocument.Tables.Add(objWord.Selection.Range, 1, 1, Microsoft.Office.Interop.Word.WdDefaultTableBehavior.wdWord9TableBehavior, Microsoft.Office.Interop.Word.WdAutoFitBehavior.wdAutoFitContent);
objWord.Selection.Tables[1].PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
objWord.Selection.Tables[1].PreferredWidth = 100F;
objWord.Selection.Cells[1].LeftPadding = 0;
objWord.Selection.Tables[1].Borders.OutsideLineStyle = WdLineStyle.wdLineStyleNone;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleSingle;
objWord.Selection.Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderBottom].LineWidth = WdLineWidth.wdLineWidth050pt;
objWord.Selection.Font.Bold = 1;
objWord.Selection.Font.Size = clsWord.WORD_RECIPE_SECTION_HEADING_FONT_SIZE;
objWord.Selection.TypeText("Source");
objWord.Selection.Font.Bold = 0;
objWord.Selection.Font.Size = clsWord.WORD_NORMAL_FONT_SIZE;
objWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
clsWord.AddHalfSpaceLineAtEndOfDocument();
if (!String.IsNullOrWhiteSpace(this.source))
{
objWord.Selection.TypeText("Source: " + this.source);
objWord.Selection.TypeParagraph();
}
if (!String.IsNullOrWhiteSpace(this.webpage))
{
objWord.Selection.TypeText("Web Page: " + this.webpage);
objWord.Selection.TypeParagraph();
}
if (!String.IsNullOrWhiteSpace(this.copyright))
{
objWord.Selection.TypeText("Copyright: " + this.copyright);
objWord.Selection.TypeParagraph();
}
clsWord.AddHalfSpaceLineAtEndOfDocument();
}
}
public void JRJRTestNutritionRecalc(ref String originalNutrition, ref String recalcNutrition)
{
Recipe recipeClone = (Recipe)this.Clone();
recipeClone.CalcNutrition();
originalNutrition = this.JRJRTestDumpForCompare();
recalcNutrition = recipeClone.JRJRTestDumpForCompare();
}
public string JRJRTestDumpForCompare()
{
StringBuilder strbResult = new StringBuilder();
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "---------------------------------------------------------------" + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "recipename" + Constants.TAB +this.recipename.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "recipeID" + Constants.TAB +this.recipeID.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "cookbookID" + Constants.TAB +this.cookbookID.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "cookbookchapterID" + Constants.TAB + (this.cookbookchapterID ?? Guid.Empty).ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "author" + Constants.TAB +this.author.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "source" + Constants.TAB +this.source.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "webpage" + Constants.TAB +this.webpage.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "comments" + Constants.TAB +this.comments.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "copyright" + Constants.TAB +this.copyright.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "servings" + Constants.TAB +this.servings.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "nutritionservinglabel" + Constants.TAB +this.nutritionservinglabel.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "yield" + Constants.TAB +this.yield.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "preparationtime" + Constants.TAB +this.preparationtime.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "cookingtime" + Constants.TAB +this.cookingtime.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "readyintime" + Constants.TAB +this.readyintime.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "inactivetime" + Constants.TAB +this.inactivetime.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "oventemperaturec" + Constants.TAB +this.oventemperaturec.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "oventemperaturef" + Constants.TAB +this.oventemperaturef.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "percentcaloriesfromalcohol" + Constants.TAB +this.percentcaloriesfromalcohol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "percentcaloriesfromcarbs" + Constants.TAB +this.percentcaloriesfromcarbs.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "percentcaloriesfromfat" + Constants.TAB +this.percentcaloriesfromfat.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "percentcaloriesfromprotein" + Constants.TAB +this.percentcaloriesfromprotein.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "alanine" + Constants.TAB +this.alanine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "alcohol" + Constants.TAB +this.alcohol.ToString() + Constants.CRLF);
//strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "alcoholfactor" + Constants.TAB +this.alcoholfactor.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "alphacarotene" + Constants.TAB +this.alphacarotene.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "alphalinolenicacid" + Constants.TAB +this.alphalinolenicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "arachidonicacid" + Constants.TAB +this.arachidonicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "arginine" + Constants.TAB +this.arginine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "ash" + Constants.TAB +this.ash.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "asparticacid" + Constants.TAB +this.asparticacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "betacarotene" + Constants.TAB +this.betacarotene.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "betacryptoxanthin" + Constants.TAB +this.betacryptoxanthin.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "betasitosterol" + Constants.TAB +this.betasitosterol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "betatocopherol" + Constants.TAB +this.betatocopherol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "biotin" + Constants.TAB +this.biotin.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "caffeine" + Constants.TAB +this.caffeine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "calcium" + Constants.TAB +this.calcium.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "calories" + Constants.TAB +this.calories.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "caloriesfromalcohol" + Constants.TAB +this.caloriesfromalcohol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "caloriesfromcarbs" + Constants.TAB +this.caloriesfromcarbs.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "caloriesfromfat" + Constants.TAB +this.caloriesfromfat.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "caloriesfromprotein" + Constants.TAB +this.caloriesfromprotein.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "campesterol" + Constants.TAB +this.campesterol.ToString() + Constants.CRLF);
//strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "carbohydratefactor" + Constants.TAB +this.carbohydratefactor.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "chloride" + Constants.TAB +this.chloride.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "cholesterol" + Constants.TAB +this.cholesterol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "choline" + Constants.TAB +this.choline.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "chromium" + Constants.TAB +this.chromium.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "copper" + Constants.TAB +this.copper.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "cystine" + Constants.TAB +this.cystine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "deltatocopherol" + Constants.TAB +this.deltatocopherol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "dihomogammalinolenicacid" + Constants.TAB +this.dihomogammalinolenicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "docosahexaenoicacid" + Constants.TAB +this.docosahexaenoicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "docosapentaenoicacid" + Constants.TAB +this.docosapentaenoicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "eicosadienoicacid" + Constants.TAB +this.eicosadienoicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "eicosapentaenoicacid" + Constants.TAB +this.eicosapentaenoicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "energy" + Constants.TAB +this.energy.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "energyfromalcohol" + Constants.TAB +this.energyfromalcohol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "energyfromcarbs" + Constants.TAB +this.energyfromcarbs.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "energyfromfat" + Constants.TAB +this.energyfromfat.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "energyfromprotein" + Constants.TAB +this.energyfromprotein.ToString() + Constants.CRLF);
//strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "fatfactor" + Constants.TAB +this.fatfactor.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "fiber" + Constants.TAB +this.fiber.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "fluoride" + Constants.TAB +this.fluoride.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "folate" + Constants.TAB +this.folate.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "fructose" + Constants.TAB +this.fructose.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "galactose" + Constants.TAB +this.galactose.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "gammalinolenicacid" + Constants.TAB +this.gammalinolenicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "gammatocopherol" + Constants.TAB +this.gammatocopherol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "glucose" + Constants.TAB +this.glucose.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "glutamicacid" + Constants.TAB +this.glutamicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "glycine" + Constants.TAB +this.glycine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "histidine" + Constants.TAB +this.histidine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "hydroxyproline" + Constants.TAB +this.hydroxyproline.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "iodine" + Constants.TAB +this.iodine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "iron" + Constants.TAB +this.iron.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "isoleucine" + Constants.TAB +this.isoleucine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "lactose" + Constants.TAB +this.lactose.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "leucine" + Constants.TAB +this.leucine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "linoleicacid" + Constants.TAB +this.linoleicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "lycopene" + Constants.TAB +this.lycopene.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "lysine" + Constants.TAB +this.lysine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "magnesium" + Constants.TAB +this.magnesium.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "maltose" + Constants.TAB +this.maltose.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "manganese" + Constants.TAB +this.manganese.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "mass" + Constants.TAB +this.mass.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "methionine" + Constants.TAB +this.methionine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "molybdenum" + Constants.TAB +this.molybdenum.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfat" + Constants.TAB +this.monounsaturatedfat.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_14_1" + Constants.TAB +this.monounsaturatedfattyacid_14_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_15_1" + Constants.TAB +this.monounsaturatedfattyacid_15_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_16_1" + Constants.TAB +this.monounsaturatedfattyacid_16_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_17_1" + Constants.TAB +this.monounsaturatedfattyacid_17_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_18_1" + Constants.TAB +this.monounsaturatedfattyacid_18_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_20_1" + Constants.TAB +this.monounsaturatedfattyacid_20_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_22_1" + Constants.TAB +this.monounsaturatedfattyacid_22_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "monounsaturatedfattyacid_24_1" + Constants.TAB +this.monounsaturatedfattyacid_24_1.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "netcarbohydrates" + Constants.TAB +this.netcarbohydrates.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "niacin" + Constants.TAB +this.niacin.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "omega3fattyacids" + Constants.TAB +this.omega3fattyacids.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "omega6fattyacids" + Constants.TAB +this.omega6fattyacids.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "pantothenicacid" + Constants.TAB +this.pantothenicacid.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "phenylalanine" + Constants.TAB +this.phenylalanine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "phosphorus" + Constants.TAB +this.phosphorus.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "phytosterols" + Constants.TAB +this.phytosterols.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfat" + Constants.TAB +this.polyunsaturatedfat.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfattyacid_18_2" + Constants.TAB +this.polyunsaturatedfattyacid_18_2.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfattyacid_18_3" + Constants.TAB +this.polyunsaturatedfattyacid_18_3.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfattyacid_18_4" + Constants.TAB +this.polyunsaturatedfattyacid_18_4.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfattyacid_20_3" + Constants.TAB +this.polyunsaturatedfattyacid_20_3.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfattyacid_20_4" + Constants.TAB +this.polyunsaturatedfattyacid_20_4.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfattyacid_21_5" + Constants.TAB +this.polyunsaturatedfattyacid_21_5.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "polyunsaturatedfattyacid_22_4" + Constants.TAB +this.polyunsaturatedfattyacid_22_4.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "potassium" + Constants.TAB +this.potassium.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "proline" + Constants.TAB +this.proline.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "protein" + Constants.TAB +this.protein.ToString() + Constants.CRLF);
//strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "proteinfactor" + Constants.TAB +this.proteinfactor.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "refuse" + Constants.TAB +this.refuse.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "retinol" + Constants.TAB +this.retinol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "riboflavin" + Constants.TAB +this.riboflavin.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfat" + Constants.TAB +this.saturatedfat.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_10_0" + Constants.TAB +this.saturatedfattyacid_10_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_12_0" + Constants.TAB +this.saturatedfattyacid_12_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_13_0" + Constants.TAB +this.saturatedfattyacid_13_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_14_0" + Constants.TAB +this.saturatedfattyacid_14_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_15_0" + Constants.TAB +this.saturatedfattyacid_15_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_16_0" + Constants.TAB +this.saturatedfattyacid_16_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_17_0" + Constants.TAB +this.saturatedfattyacid_17_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_18_0" + Constants.TAB +this.saturatedfattyacid_18_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_20_0" + Constants.TAB +this.saturatedfattyacid_20_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_22_0" + Constants.TAB +this.saturatedfattyacid_22_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_24_0" + Constants.TAB +this.saturatedfattyacid_24_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_4_0" + Constants.TAB +this.saturatedfattyacid_4_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_6_0" + Constants.TAB +this.saturatedfattyacid_6_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "saturatedfattyacid_8_0" + Constants.TAB +this.saturatedfattyacid_8_0.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "selenium" + Constants.TAB +this.selenium.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "serine" + Constants.TAB +this.serine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "sodium" + Constants.TAB +this.sodium.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "starch" + Constants.TAB +this.starch.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "stigmasterol" + Constants.TAB +this.stigmasterol.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "sucrose" + Constants.TAB +this.sucrose.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "sugar" + Constants.TAB +this.sugar.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "sugaralcohols" + Constants.TAB +this.sugaralcohols.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "theobromine" + Constants.TAB +this.theobromine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "thiamin" + Constants.TAB +this.thiamin.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "threonine" + Constants.TAB +this.threonine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "totalcarbohydrate" + Constants.TAB +this.totalcarbohydrate.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "totalfat" + Constants.TAB +this.totalfat.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "transfattyacids" + Constants.TAB +this.transfattyacids.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "transmonoenoicfattyacids" + Constants.TAB +this.transmonoenoicfattyacids.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "transpolyenoicfattyacids" + Constants.TAB +this.transpolyenoicfattyacids.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "tryptophan" + Constants.TAB +this.tryptophan.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "tyrosine" + Constants.TAB +this.tyrosine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "valine" + Constants.TAB +this.valine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "vitamina" + Constants.TAB +this.vitamina.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "vitaminb12" + Constants.TAB +this.vitaminb12.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "vitaminb6" + Constants.TAB +this.vitaminb6.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "vitaminc" + Constants.TAB +this.vitaminc.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "vitamind" + Constants.TAB +this.vitamind.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "vitamine" + Constants.TAB +this.vitamine.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "vitamink" + Constants.TAB +this.vitamink.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "volume" + Constants.TAB +this.volume.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "water" + Constants.TAB +this.water.ToString() + Constants.CRLF);
strbResult.Append(this.cookbookID.ToString() + Constants.TAB + this.recipename + Constants.TAB + "zinc" + Constants.TAB +this.zinc.ToString() + Constants.CRLF);
return strbResult.ToString();
}
public object Clone()
{
var copy = (Recipe)(this.MemberwiseClone());
var originalIngredient = copy.recipeIngredients;
copy.recipeIngredients = new List();
foreach (var ingredient in originalIngredient)
{
var newIngredient = (RecipeIngredient)(ingredient.Clone());
copy.recipeIngredients.Add(newIngredient);
}
var originalProcedures = copy.recipeProcedures;
copy.recipeProcedures = new List();
foreach (var procedure in originalProcedures)
{
var newProcedure = (RecipeProcedure)(procedure.Clone());
copy.recipeProcedures.Add(newProcedure);
}
var originalTips = copy.recipeTips;
copy.recipeTips = new List();
foreach(var tip in originalTips)
{
var newTip = (RecipeTip)(tip.Clone());
copy.recipeTips.Add(newTip);
}
return copy;
}
}
}
|