");
+ 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;
+ }
+ }
+}
diff --git a/JRCookbookBusiness/RecipeHighlights.cs b/JRCookbookBusiness/RecipeHighlights.cs
new file mode 100644
index 0000000..e97ab4d
--- /dev/null
+++ b/JRCookbookBusiness/RecipeHighlights.cs
@@ -0,0 +1,116 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ public class RecipeHighlights
+ {
+ public Guid? recipeID = null;
+ public Guid? cookbookID = null;
+ public Guid? cookbookchapterID = null;
+
+ public String recipename = String.Empty;
+
+ public RecipeHighlights()
+ {
+ }
+
+ public RecipeHighlights(Guid recipeID)
+ {
+ PopulateByID(recipeID);
+ }
+
+
+
+ public void Delete()
+ {
+ Recipe.DeleteByID(recipeID.Value);
+ }
+
+ public static RecipeHighlights GetRecipeByID(Guid recipeID)
+ {
+ return new RecipeHighlights(recipeID);
+ }
+
+ public static List GetAllRecipes()
+ {
+ DataSet recordSet;
+ var returnValue = new List();
+
+ recordSet = clsDatabaseLayer.GetDatabaseLayer().GetAllRecipes();
+
+ if (recordSet.Tables[0].Rows.Count > 0)
+ {
+ foreach(DataRow ldbrwRow in recordSet.Tables[0].Rows)
+ {
+ var newRecipe = new RecipeHighlights();
+ newRecipe.PopulateFromDataRow(ldbrwRow);
+ returnValue.Add(newRecipe);
+ }
+ }
+ return returnValue;
+ }
+
+ public static RecipeHighlights GetRecipeHighlightsByDataRow(DataRow row)
+ {
+ var newRecipe = new RecipeHighlights();
+ newRecipe.PopulateFromDataRow(row);
+ return newRecipe;
+ }
+
+ private void PopulateByID(Guid recipeID)
+ {
+ DataSet recordSet;
+
+ recordSet = clsDatabaseLayer.GetDatabaseLayer().GetRecipeByID(recipeID);
+
+ if (recordSet.Tables[0].Rows.Count > 0)
+ {
+ DataRow ldbrwRow;
+ ldbrwRow = recordSet.Tables[0].Rows[0];
+
+ PopulateFromDataRow(ldbrwRow);
+ }
+ }
+
+ private void PopulateFromDataRow(DataRow dataRow)
+ {
+ InitializeAllFields();
+
+ if (dataRow.IsNull("recipeID"))
+ recipeID = null;
+ else
+ recipeID = (Guid)dataRow["recipeID"];
+
+ if (dataRow.IsNull("cookbookID"))
+ cookbookID = null;
+ else
+ cookbookID = (Guid)dataRow["cookbookID"];
+
+ if (dataRow.IsNull("cookbookchapterID"))
+ cookbookchapterID = null;
+ else
+ cookbookchapterID = (Guid)dataRow["cookbookchapterID"];
+
+ if (dataRow.IsNull("recipename"))
+ recipename = String.Empty;
+ else
+ recipename = (String)dataRow["recipename"];
+
+
+ }
+
+ private void InitializeAllFields()
+ {
+ recipeID = null;
+ cookbookID = null;
+ cookbookchapterID = null;
+ recipename = String.Empty;
+ }
+
+ }
+}
diff --git a/JRCookbookBusiness/RecipeIngredient.cs b/JRCookbookBusiness/RecipeIngredient.cs
new file mode 100644
index 0000000..8c3c851
--- /dev/null
+++ b/JRCookbookBusiness/RecipeIngredient.cs
@@ -0,0 +1,295 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Net.Security;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ public enum RecipeIngredientLinkType
+ {
+ Unlinked,
+ Ingredient,
+ NoLink
+ }
+
+ public class RecipeIngredient: ICloneable
+ {
+ public Guid? recipeIngredientID = null;
+ public Guid? recipeID = null;
+ public Int32 ingredientIndex = 0;
+ public String ingredientText = String.Empty;
+ private bool _isHeading = false;
+ public RecipeIngredientLinkType linkType = RecipeIngredientLinkType.Unlinked;
+
+ private static SortedList ingredientSkipWords = null;
+
+ public bool isHeading
+ {
+ get
+ {
+ return (this is RecipeIngredientHeading);
+ }
+ }
+
+ internal string linkTypeAsString
+ {
+ get
+ {
+ return Enum.GetName(typeof(RecipeIngredientLinkType), linkType);
+ }
+ }
+
+ public RecipeIngredientHeading ConvertToHeading()
+ {
+ if (isHeading)
+ {
+ return (RecipeIngredientHeading)this;
+ }
+ else
+ {
+ RecipeIngredientHeading temp = new RecipeIngredientHeading();
+ temp.recipeIngredientID = this.recipeIngredientID;
+ temp.recipeID = this.recipeID;
+ temp.ingredientIndex = this.ingredientIndex;
+ temp.ingredientText = this.ingredientText;
+ temp.linkType = RecipeIngredientLinkType.NoLink;
+
+ return temp;
+ }
+ }
+ public RecipeIngredientItem ConvertToItem()
+ {
+ if (!isHeading)
+ {
+ return (RecipeIngredientItem)this;
+ }
+ else
+ {
+ RecipeIngredientItem temp = new RecipeIngredientItem();
+ temp.recipeIngredientID = this.recipeIngredientID;
+ temp.recipeID = this.recipeID;
+ temp.ingredientIndex = this.ingredientIndex;
+ temp.ingredientText = this.ingredientText;
+ temp.linkType = RecipeIngredientLinkType.Unlinked;
+ temp.linkQuality = 0;
+
+ return temp;
+ }
+ }
+
+ //protected RecipeIngredient()
+ //{
+ //}
+
+ public void PasteIntoChapter(Guid newRecipeID)
+ {
+ this.recipeIngredientID = null;
+ this.recipeID = newRecipeID;
+ }
+
+ public void Save()
+ {
+ if (this.recipeIngredientID == null)
+ {
+ this.recipeIngredientID = clsDatabaseLayer.GetDatabaseLayer().GetNewIDRecipeIngredient();
+ clsDatabaseLayer.GetDatabaseLayer().InsertRecipeIngredient(this);
+ }
+ else
+ {
+ clsDatabaseLayer.GetDatabaseLayer().UpdateRecipeIngredient(this);
+ }
+ }
+
+ public void Delete()
+ {
+ clsDatabaseLayer.GetDatabaseLayer().DeleteRecipeIngredientByID(recipeIngredientID.Value);
+ }
+
+ public static void DeleteAllByRecipeID(Guid recipeID)
+ {
+ clsDatabaseLayer.GetDatabaseLayer().DeleteRecipeIngredientsByRecipeID(recipeID);
+ }
+
+ public static RecipeIngredient GetRecipeIngredientByID(Guid recipeIngredientID)
+ {
+ DataSet recordSet;
+ recordSet = clsDatabaseLayer.GetDatabaseLayer().GetRecipeIngredientByID(recipeIngredientID);
+
+ var row = recordSet.Tables[0].Rows[0];
+ return GetRecipeIngredientByDataRow(row);
+ }
+
+ internal static RecipeIngredient GetRecipeIngredientByDataRow(DataRow recipeIngredientDataRow)
+ {
+ if (recipeIngredientDataRow["Heading"].ToString() == "Y")
+ {
+ var recipeIngredientHeading = new RecipeIngredientHeading();
+ recipeIngredientHeading.PopulateFromDataRow(recipeIngredientDataRow);
+ return recipeIngredientHeading;
+ }
+ else
+ {
+ var recipeIngredientItem = new RecipeIngredientItem();
+ recipeIngredientItem.PopulateFromDataRow(recipeIngredientDataRow);
+ return recipeIngredientItem;
+ }
+ }
+
+ internal virtual void PopulateFromDataRow(DataRow dataRow)
+ {
+ //initializing in child objects
+
+ if (dataRow.IsNull("recipeIngredientID"))
+ recipeIngredientID = null;
+ else
+ recipeIngredientID = (Guid)dataRow["recipeIngredientID"];
+
+ if (dataRow.IsNull("recipeID"))
+ recipeID = null;
+ else
+ recipeID = (Guid)dataRow["recipeID"];
+
+ if (dataRow.IsNull("ingredientindex"))
+ ingredientIndex = 0;
+ else
+ ingredientIndex = (Int32)dataRow["ingredientindex"];
+
+ if (dataRow.IsNull("ingredientText"))
+ ingredientText = String.Empty;
+ else
+ ingredientText = (String)dataRow["ingredientText"];
+
+ if (dataRow.IsNull("Heading"))
+ _isHeading = false;
+ else
+ _isHeading = (((String)dataRow["Heading"]).ToUpper() == "Y");
+
+
+ if (dataRow.IsNull("linkType"))
+ linkType = RecipeIngredientLinkType.Unlinked;
+ else
+ linkType = (RecipeIngredientLinkType)Enum.Parse(typeof(RecipeIngredientLinkType),(String)dataRow["linkType"]);
+
+ //Convert back to string
+ //String t = Enum.GetName(typeof(Roles), roleValue);
+
+
+ }
+
+ protected virtual void InitializeAllFields()
+ {
+ recipeIngredientID = null;
+ recipeID = null;
+ ingredientIndex = 0;
+ ingredientText = String.Empty;
+ _isHeading = false;
+ linkType = RecipeIngredientLinkType.Unlinked;
+
+
+ }
+
+ public static String NormalizeRecipeIngredientName(String strInputRecipeIngredientName)
+ {
+ LoadSkipWords();
+
+ strInputRecipeIngredientName = clsDiacriticRemover.RemoveDiacritics(strInputRecipeIngredientName).ToLower();
+
+ StringBuilder thisWord = new StringBuilder();
+
+ SortedList allWords = new SortedList();
+
+ foreach (var thisChar in strInputRecipeIngredientName)
+ {
+ if (thisChar >= 'a' && thisChar <= 'z')
+ {
+ thisWord.Append(thisChar);
+ }
+ else
+ {
+ if (thisWord.Length > 0)
+ {
+ String fullWord = thisWord.ToString();
+
+ if (!allWords.ContainsKey(fullWord))
+ {
+ allWords.Add(fullWord,fullWord);
+
+ }
+
+ thisWord.Clear();
+ }
+ }
+ }
+
+ if (thisWord.Length > 0)
+ {
+ String fullWord = thisWord.ToString();
+
+ if (!allWords.ContainsKey(fullWord))
+ {
+ allWords.Add(fullWord, fullWord);
+
+ }
+
+ thisWord.Clear();
+ }
+
+ StringBuilder normalizedName = new StringBuilder();
+
+ foreach (var wordToAdd in allWords.Values)
+ {
+ if (!ingredientSkipWords.ContainsKey(wordToAdd))
+ {
+ normalizedName.Append(wordToAdd);
+ normalizedName.Append(' ');
+ }
+ }
+
+ return normalizedName.ToString().Trim();
+ }
+
+ private static void LoadSkipWords()
+ {
+ if (ingredientSkipWords == null)
+ {
+ var ingredientSkipWordsUnsorted = IngredientSkipSearchWord.GetAllIngredientSkipSearchWords();
+ ingredientSkipWords = new SortedList();
+ foreach (var loadVal in ingredientSkipWordsUnsorted)
+ {
+ ingredientSkipWords.Add(loadVal.word, loadVal);
+ }
+ }
+ }
+
+
+ public static List GetRecipeIngredientAll()
+ {
+ List allIngredients = new List();
+ DataSet recordSet;
+ recordSet = clsDatabaseLayer.GetDatabaseLayer().GetRecipeIngredientAll();
+
+ foreach (DataRow row in recordSet.Tables[0].Rows)
+ {
+ var recipeIngredient = GetRecipeIngredientByDataRow(row);
+ if (recipeIngredient.isHeading == false)
+ {
+ if (((RecipeIngredientItem)recipeIngredient).ingredientID != null)
+ {
+ allIngredients.Add(recipeIngredient);
+ }
+ }
+ }
+
+ return allIngredients;
+ }
+
+
+ public object Clone()
+ {
+ return this.MemberwiseClone();
+ }
+ }
+}
diff --git a/JRCookbookBusiness/RecipeIngredientHeading.cs b/JRCookbookBusiness/RecipeIngredientHeading.cs
new file mode 100644
index 0000000..f50ce75
--- /dev/null
+++ b/JRCookbookBusiness/RecipeIngredientHeading.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ public class RecipeIngredientHeading : RecipeIngredient
+ {
+
+ public RecipeIngredientHeading()
+ {
+ }
+
+ internal override void PopulateFromDataRow(DataRow dataRow)
+ {
+ InitializeAllFields();
+
+ base.PopulateFromDataRow(dataRow);
+
+ }
+
+ protected override void InitializeAllFields()
+ {
+ base.InitializeAllFields();
+ }
+ }
+}
diff --git a/JRCookbookBusiness/RecipeIngredientItem.cs b/JRCookbookBusiness/RecipeIngredientItem.cs
new file mode 100644
index 0000000..43c92d7
--- /dev/null
+++ b/JRCookbookBusiness/RecipeIngredientItem.cs
@@ -0,0 +1,163 @@
+using System;
+using System.Data;
+
+namespace JRCookbookBusiness
+{
+ public class RecipeIngredientItem: RecipeIngredient
+ {
+ public Guid? ingredientID = null;
+ public String quantityText = String.Empty;
+ public String unitText = String.Empty;
+
+ public String measureName = String.Empty;
+ private Guid? _measureID = null;
+ private bool isMeasureLoaded = false;
+ private Measure _measure = null;
+
+ public Single measureQuantity = 0;
+ public Int16 linkQuality = 1;
+
+ public RecipeIngredientItem()
+ {
+ linkQuality = 0;
+ }
+
+ public RecipeIngredientItem(Recipe parentRecipe)
+ {
+ recipeID = parentRecipe.recipeID;
+ linkQuality = 0;
+ }
+
+ public Measure measure {
+ get {
+ if (_measureID == null)
+ {
+ return null;
+ }
+ if (!isMeasureLoaded)
+ {
+ Measure.GetMeasureByID(_measureID.Value);
+ isMeasureLoaded = true;
+ }
+ return _measure;
+ }
+ set
+ {
+ if (value == null)
+ {
+ measureName = String.Empty;
+ _measureID = null;
+ isMeasureLoaded = false;
+ _measure = null;
+ }
+ else
+ {
+ _measure = value;
+ measureName = _measure.description;
+ _measureID = _measure.measureID;
+ isMeasureLoaded = true;
+ }
+ }
+ }
+
+ public Guid? measureID
+ {
+ get
+ {
+ return _measureID;
+ }
+ set
+ {
+ if (value == null)
+ {
+ measureName = String.Empty;
+ _measureID = null;
+ isMeasureLoaded = false;
+ _measure = null;
+ }
+ _measureID = value;
+ _measure = Measure.GetMeasureByID(_measureID.Value);
+ isMeasureLoaded = true;
+ measureName = _measure.description;
+ }
+ }
+
+
+
+
+ internal override void PopulateFromDataRow(DataRow dataRow)
+ {
+ InitializeAllFields();
+
+ base.PopulateFromDataRow(dataRow);
+
+ if (dataRow.IsNull("ingredientID"))
+ ingredientID = null;
+ else
+ ingredientID = (Guid)dataRow["ingredientID"];
+
+ if (dataRow.IsNull("quantityText"))
+ quantityText = String.Empty;
+ else
+ quantityText = (String)dataRow["quantityText"];
+
+ if (dataRow.IsNull("unitText"))
+ unitText = String.Empty;
+ else
+ unitText = (String)dataRow["unitText"];
+
+ if (dataRow.IsNull("measureQuantity"))
+ measureQuantity = 0;
+ else
+ measureQuantity = (Single)dataRow["measureQuantity"];
+
+ if (dataRow.IsNull("linkQuality"))
+ linkQuality = 0;
+ else
+ linkQuality = (Int16)dataRow["linkQuality"];
+
+
+
+ if (dataRow.IsNull("measureID"))
+ _measureID = null;
+ else
+ _measureID = (Guid)dataRow["measureID"];
+
+ measureName = String.Empty;
+ isMeasureLoaded = false;
+ _measure = null;
+
+ if (dataRow.Table.Columns.Contains("measureName") && !dataRow.IsNull("measureName") && !String.IsNullOrEmpty(dataRow[measureName].ToString()))
+ {
+ measureName = (String)dataRow[measureName];
+ }
+ else
+ {
+ if (_measureID != null)
+ {
+ measure = Measure.GetMeasureByID(_measureID.Value);
+ isMeasureLoaded = true;
+ measureName = measure.description;
+ }
+ }
+ }
+
+ protected override void InitializeAllFields()
+ {
+ base.InitializeAllFields();
+
+ ingredientID = null;
+ quantityText = String.Empty;
+ unitText = String.Empty;
+
+ measureName = String.Empty;
+ _measureID = null;
+ isMeasureLoaded = false;
+ _measure = null;
+
+ measureQuantity = 0;
+ linkQuality = 0;
+ }
+
+ }
+}
diff --git a/JRCookbookBusiness/RecipeProcedure.cs b/JRCookbookBusiness/RecipeProcedure.cs
new file mode 100644
index 0000000..fe93df8
--- /dev/null
+++ b/JRCookbookBusiness/RecipeProcedure.cs
@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ public class RecipeProcedure: ICloneable
+ {
+ public Guid? recipeProcedureID = null;
+ public Guid? recipeID = null;
+ public String procedureText = String.Empty;
+ public Int32 procedureIndex = 0;
+ public bool isHeading = false;
+
+ public RecipeProcedure()
+ {
+ }
+
+ public RecipeProcedure(Recipe parentRecipe)
+ {
+ recipeID = parentRecipe.recipeID;
+ }
+
+ public RecipeProcedure(Guid recipeProcedureID)
+ {
+ PopulateByID(recipeProcedureID);
+ }
+
+
+ public void PasteIntoChapter(Guid newRecipeID)
+ {
+ this.recipeProcedureID = null;
+ this.recipeID = newRecipeID;
+ }
+
+ public void Save()
+ {
+ if (this.recipeProcedureID == null)
+ {
+ this.recipeProcedureID = clsDatabaseLayer.GetDatabaseLayer().GetNewIDRecipeProcedure();
+ clsDatabaseLayer.GetDatabaseLayer().InsertRecipeProcedure(this);
+ }
+ else
+ {
+ clsDatabaseLayer.GetDatabaseLayer().UpdateRecipeProcedure(this);
+ }
+ }
+
+ public void Delete()
+ {
+ clsDatabaseLayer.GetDatabaseLayer().DeleteRecipeProcedureByID(recipeProcedureID.Value);
+ }
+
+ public static void DeleteAllByRecipeID(Guid recipeID)
+ {
+ clsDatabaseLayer.GetDatabaseLayer().DeleteRecipeProceduresByRecipeID(recipeID);
+ }
+
+ public static RecipeProcedure GetRecipeProcedureByID(Guid recipeProcedureID)
+ {
+ return new RecipeProcedure(recipeProcedureID);
+ }
+
+ public static RecipeProcedure GetRecipeProcedureByDataRow(DataRow row)
+ {
+ var newProcedure = new RecipeProcedure();
+ newProcedure.PopulateFromDataRow(row);
+ return newProcedure;
+ }
+
+ private void PopulateByID(Guid recipeProcedureID)
+ {
+ DataSet recordSet;
+
+ recordSet = clsDatabaseLayer.GetDatabaseLayer().GetRecipeProcedureByID(recipeProcedureID);
+
+ if (recordSet.Tables[0].Rows.Count > 0)
+ {
+ DataRow ldbrwRow;
+ ldbrwRow = recordSet.Tables[0].Rows[0];
+
+ PopulateFromDataRow(ldbrwRow);
+ }
+
+ }
+
+ private void PopulateFromDataRow(DataRow dataRow)
+ {
+ InitializeAllFields();
+
+ if (dataRow.IsNull("recipeProcedureID"))
+ recipeProcedureID = null;
+ else
+ recipeProcedureID = (Guid)dataRow["recipeProcedureID"];
+
+ if (dataRow.IsNull("recipeID"))
+ recipeID = null;
+ else
+ recipeID = (Guid)dataRow["recipeID"];
+
+ if (dataRow.IsNull("procedureText"))
+ procedureText = String.Empty;
+ else
+ procedureText = (String)dataRow["procedureText"];
+
+ if (dataRow.IsNull("procedureIndex"))
+ procedureIndex = 0;
+ else
+ procedureIndex = (Int32)dataRow["procedureIndex"];
+
+ if (dataRow.IsNull("Heading"))
+ isHeading = false;
+ else
+ isHeading = (((String)dataRow["Heading"]).ToUpper() == "Y");
+ }
+
+ private void InitializeAllFields()
+ {
+ recipeProcedureID = null;
+ recipeID = null;
+ procedureText = String.Empty;
+ procedureIndex = 0;
+ isHeading = false;
+ }
+
+ public object Clone()
+ {
+ return this.MemberwiseClone();
+ }
+
+ }
+}
diff --git a/JRCookbookBusiness/RecipeTip.cs b/JRCookbookBusiness/RecipeTip.cs
new file mode 100644
index 0000000..efda281
--- /dev/null
+++ b/JRCookbookBusiness/RecipeTip.cs
@@ -0,0 +1,137 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ public class RecipeTip: ICloneable
+ {
+ public Guid? recipeTipID = null;
+ public Guid? recipeID = null;
+ public String tipText = String.Empty;
+ public Int32 tipIndex = 0;
+ public bool isHeading = false;
+
+ public RecipeTip()
+ {
+ }
+
+ public RecipeTip(Recipe parentRecipe)
+ {
+ recipeID = parentRecipe.recipeID;
+ }
+
+ public RecipeTip(Guid recipeTipID)
+ {
+ PopulateByID(recipeTipID);
+ }
+
+
+ public void PasteIntoChapter(Guid newRecipeID)
+ {
+ this.recipeTipID = null;
+ this.recipeID = newRecipeID;
+ }
+
+
+ public void Save()
+ {
+ if (this.recipeTipID == null)
+ {
+ this.recipeTipID = clsDatabaseLayer.GetDatabaseLayer().GetNewIDRecipeTip();
+ clsDatabaseLayer.GetDatabaseLayer().InsertRecipeTip(this);
+ }
+ else
+ {
+ clsDatabaseLayer.GetDatabaseLayer().UpdateRecipeTip(this);
+ }
+ }
+
+ public void Delete()
+ {
+ clsDatabaseLayer.GetDatabaseLayer().DeleteRecipeTipByID(recipeTipID.Value);
+ }
+
+ public static void DeleteAllByRecipeID(Guid recipeID)
+ {
+ clsDatabaseLayer.GetDatabaseLayer().DeleteRecipeTipsByRecipeID(recipeID);
+ }
+
+ public static RecipeTip GetRecipeTipByID(Guid recipeTipID)
+ {
+ return new RecipeTip(recipeTipID);
+ }
+
+ public static RecipeTip GetRecipeTipByDataRow(DataRow row)
+ {
+ var newTip = new RecipeTip();
+ newTip.PopulateFromDataRow(row);
+ return newTip;
+ }
+
+ private void PopulateByID(Guid recipeTipID)
+ {
+ DataSet recordSet;
+
+ recordSet = clsDatabaseLayer.GetDatabaseLayer().GetRecipeTipByID(recipeTipID);
+
+ if (recordSet.Tables[0].Rows.Count > 0)
+ {
+ DataRow ldbrwRow;
+ ldbrwRow = recordSet.Tables[0].Rows[0];
+
+ PopulateFromDataRow(ldbrwRow);
+ }
+
+ }
+
+ private void PopulateFromDataRow(DataRow dataRow)
+ {
+ InitializeAllFields();
+
+ if (dataRow.IsNull("recipeTipID"))
+ recipeTipID = null;
+ else
+ recipeTipID = (Guid)dataRow["recipeTipID"];
+
+ if (dataRow.IsNull("recipeID"))
+ recipeID = null;
+ else
+ recipeID = (Guid) dataRow["recipeID"];
+
+ if (dataRow.IsNull("tipText"))
+ tipText = String.Empty;
+ else
+ tipText = (String)dataRow["tipText"];
+
+ if (dataRow.IsNull("tipIndex"))
+ tipIndex = 0;
+ else
+ tipIndex = (Int32) dataRow["tipIndex"];
+
+ if (dataRow.IsNull("Heading"))
+ isHeading = false;
+ else
+ isHeading = (((String)dataRow["Heading"]).ToUpper() == "Y");
+ }
+
+ private void InitializeAllFields()
+ {
+ recipeTipID = null;
+ recipeID = null;
+ tipText = String.Empty;
+ tipIndex = 0;
+ isHeading = false;
+ }
+
+ public object Clone()
+ {
+ return this.MemberwiseClone();
+ }
+
+
+ }
+}
diff --git a/JRCookbookBusiness/SharedRoutines.cs b/JRCookbookBusiness/SharedRoutines.cs
new file mode 100644
index 0000000..ec0680d
--- /dev/null
+++ b/JRCookbookBusiness/SharedRoutines.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ internal static class SharedRoutines
+ {
+ public static string RemoveSpecialCharactersFromFileName(string str)
+ {
+ return Regex.Replace(str, "[^a-zA-Z0-9_. ]+", String.Empty, RegexOptions.Compiled);
+ }
+
+
+ internal static string GenerateTrackbackLinks(List trackbackList)
+ {
+ bool firstTrackback = true;
+
+ StringBuilder trackbacksHTML = new StringBuilder();
+ foreach(Trackback trackback in trackbackList)
+ {
+ if (firstTrackback)
+ {
+ firstTrackback = false;
+ }
+ else
+ {
+ trackbacksHTML.Append(" > ");
+ }
+
+ trackbacksHTML.Append(trackback.GenerateLink());
+ }
+
+ return trackbacksHTML.ToString();
+ }
+ }
+
+}
diff --git a/JRCookbookBusiness/Trackback.cs b/JRCookbookBusiness/Trackback.cs
new file mode 100644
index 0000000..3c5fb1c
--- /dev/null
+++ b/JRCookbookBusiness/Trackback.cs
@@ -0,0 +1,30 @@
+using Microsoft.AspNetCore.Html;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ public class Trackback
+ {
+ public String TrackbackText = String.Empty;
+ public String TrackbackURL = String.Empty;
+
+ public String GenerateLink()
+ {
+ var builder = new HtmlContentBuilder();
+ builder.AppendFormat("", TrackbackURL);
+ builder.AppendFormat("{0}", TrackbackText);
+ builder.AppendHtml("");
+
+ using (var writer = new System.IO.StringWriter())
+ {
+ builder.WriteTo(writer, System.Text.Encodings.Web.HtmlEncoder.Default);
+ return writer.ToString();
+ }
+ }
+
+ }
+}
diff --git a/JRCookbookBusiness/Utility.cs b/JRCookbookBusiness/Utility.cs
new file mode 100644
index 0000000..9b48448
--- /dev/null
+++ b/JRCookbookBusiness/Utility.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using HtmlToXamlDemo;
+using Microsoft.VisualBasic;
+
+namespace JRCookbookBusiness
+{
+ public static class Utility
+ {
+ public static string ConvertHTLMLToRTF(string strInputHTML)
+ {
+ try
+ {
+ string objXAML = HtmlToXamlConverter.ConvertHtmlToXaml(strInputHTML, false);
+
+ TextWriter asdf;
+
+ if (File.Exists("C:\\ReussData\\DeleteMe.html"))
+ {
+ File.Delete("C:\\ReussData\\DeleteMe.html");
+ }
+ asdf = new StreamWriter("C:\\ReussData\\DeleteMe.html");
+ asdf.Write(strInputHTML);
+ asdf.Close();
+ asdf.Dispose();
+ asdf = null;
+
+ if (File.Exists("C:\\ReussData\\DeleteMe.xaml"))
+ {
+ File.Delete("C:\\ReussData\\DeleteMe.xaml");
+ }
+ asdf = new StreamWriter("C:\\ReussData\\DeleteMe.xaml");
+ asdf.Write(objXAML);
+ asdf.Close() ;
+ asdf.Dispose();
+ asdf = null;
+
+ if (File.Exists("C:\\ReussData\\DeleteMe.rtf"))
+ {
+ File.Delete("C:\\ReussData\\DeleteMe.rtf");
+ }
+ asdf = new StreamWriter("C:\\ReussData\\DeleteMe.rtf");
+ asdf.Write(ConvertXamlToRtf(objXAML));
+ asdf.Close();
+ asdf.Dispose();
+ asdf = null;
+
+ return ConvertXamlToRtf(objXAML);
+ }
+ catch(Exception ex)
+ {
+ throw;
+ }
+
+
+ }
+ private static string ConvertXamlToRtf(string xamlText)
+ {
+ var richTextBox = new RichTextBox();
+ MessageBox.Show("Before:" + ControlChars.CrLf + "width = " + richTextBox.Width.ToString() + ControlChars.CrLf
+ + "ActualWidth = " + richTextBox.ActualWidth.ToString() + ControlChars.CrLf
+ + "ExtentWidth = " + richTextBox.ExtentWidth.ToString() + ControlChars.CrLf
+ + "MaxWidth = " + richTextBox.MaxWidth.ToString() + ControlChars.CrLf
+ + "ViewportWidth = " + richTextBox.ViewportWidth.ToString());
+
+ richTextBox.Width = 10000;
+
+ MessageBox.Show("Width:" + ControlChars.CrLf + "width = " + richTextBox.Width.ToString() + ControlChars.CrLf
+ + "ActualWidth = " + richTextBox.ActualWidth.ToString() + ControlChars.CrLf
+ + "ExtentWidth = " + richTextBox.ExtentWidth.ToString() + ControlChars.CrLf
+ + "MaxWidth = " + richTextBox.MaxWidth.ToString() + ControlChars.CrLf
+ + "ViewportWidth = " + richTextBox.ViewportWidth.ToString());
+
+ if (string.IsNullOrEmpty(xamlText)) return "";
+ var textRange = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd);
+ using (var xamlMemoryStream = new MemoryStream())
+ {
+ using (var xamlStreamWriter = new StreamWriter(xamlMemoryStream))
+ {
+ xamlStreamWriter.Write(xamlText);
+ xamlStreamWriter.Flush();
+ xamlMemoryStream.Seek(0, SeekOrigin.Begin);
+ textRange.Load(xamlMemoryStream, DataFormats.Xaml);
+ }
+ }
+ using (var rtfMemoryStream = new MemoryStream())
+ {
+ textRange = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd);
+ textRange.Save(rtfMemoryStream, DataFormats.Rtf);
+ rtfMemoryStream.Seek(0, SeekOrigin.Begin);
+ using (var rtfStreamReader = new StreamReader(rtfMemoryStream))
+ {
+ return rtfStreamReader.ReadToEnd();
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/JRCookbookBusiness/clsDatabaseLayer.cs b/JRCookbookBusiness/clsDatabaseLayer.cs
new file mode 100644
index 0000000..7449e46
--- /dev/null
+++ b/JRCookbookBusiness/clsDatabaseLayer.cs
@@ -0,0 +1,1196 @@
+using System;
+using System.Diagnostics;
+using System.Data;
+using System.Data.OleDb;
+using JRCookbookBusiness;
+
+public class clsDatabaseLayer : clsDatabaseLayerBase
+{
+ static clsDatabaseLayer _DatabaseLayer = null;
+
+ internal static clsDatabaseLayer GetDatabaseLayer()
+ {
+ if (_DatabaseLayer == null)
+ {
+ _DatabaseLayer = new clsDatabaseLayer();
+ }
+ return _DatabaseLayer;
+ }
+
+ public static void CloseSharedDatabaseConnection()
+ {
+ if (_DatabaseLayer != null)
+ {
+ _DatabaseLayer.CloseDatabaseConnection();
+ _DatabaseLayer.Dispose(true);
+ _DatabaseLayer = null;
+ }
+ }
+
+ public DataSet GetIngredientByID(Guid ingredientID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredient where ingredientid=@ingredientid"))
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientid", ingredientID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+
+ }
+
+ public DataSet GetIngredientsBySearchString(String searchString)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("SELECT * FROM ingredient where name like (@searchString) order by name"))
+ {
+ dbCommand.Parameters.AddWithValue("@searchString", "%" + searchString + "%");
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+
+ }
+
+ public DataSet GetAllIngredients()
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("SELECT * FROM ingredient order by name"))
+ {
+ return this.ExecuteDataSet(dbCommand);
+ }
+
+ }
+
+
+ public DataSet GetIngredientMeasureByID(Guid ingredientID, Guid measureID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredientmeasure where ingredientid=@ingredientid and measureid=@measureid"))
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientid", ingredientID);
+ dbCommand.Parameters.AddWithValue("@measureid", measureID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetIngredientMeasureByIngredientID(Guid ingredientID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredientmeasure where ingredientid=@ingredientid"))
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientid", ingredientID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetMeasureByID(Guid measureID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from measure where measureid=@measureid"))
+ {
+ dbCommand.Parameters.AddWithValue("@measureid", measureID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetMeasuresByIngredientID(Guid ingredientID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select measure.* from measure inner join ingredientmeasure ON measure.measureid=ingredientmeasure.measureid" +
+ " where ingredientmeasure.ingredientid=@ingredientid order by measure.description"))
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientid", ingredientID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetAllCookbooks()
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from cookbook order by name"))
+ {
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetCookbookByID(Guid cookbookID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from cookbook AS r where cookbookid=@cookbookid"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookid", cookbookID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetCookbookChapterByID(Guid cookbookID, Guid cookbookChapterID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from cookbookchapter where cookbookid=@cookbookid and cookbookchapterid=@cookbookchapterid"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookid", cookbookID);
+ dbCommand.Parameters.AddWithValue("@cookbookchapterid", cookbookChapterID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetCookbookChaptersByParentChapter(Guid cookbookID, Guid? parentChapterID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from cookbookchapter where cookbookid=@cookbookid" +
+ " and (parentchapterid=@parentchapterid or (parentchapterid is null and @parentchapterid is null)) order by name"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookid", cookbookID);
+ dbCommand.Parameters.AddWithValue("@parentchapterid", parentChapterID ?? (object)DBNull.Value);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetAllRecipes()
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipe order by recipename"))
+ {
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeByID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipe AS r where recipeid=@recipeid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeHighlightsByParentChapter(Guid cookbookID, Guid? cookbookChapterID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipe AS r where cookbookid=@cookbookid" +
+ " and (cookbookchapterid=@cookbookchapterid or (cookbookchapterid is null and @cookbookchapterid is null)) order by recipename"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookid", cookbookID);
+ dbCommand.Parameters.AddWithValue("@cookbookchapterid", cookbookChapterID ?? (object)DBNull.Value);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+
+ public DataSet GetRecipeIngredientsByRecipeID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipeingredient where recipeid=@recipeid order by ingredientindex"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeIngredientByID(Guid recipeIngredientID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipeingredient where recipeingredientid=@recipeingredientid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeingredientid", recipeIngredientID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeIngredientAll()
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipeingredient"))
+ {
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeProceduresByRecipeID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipeprocedure where recipeid=@recipeid order by procedureindex"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeProcedureByID(Guid recipeProcedureID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipeprocedure where recipeprocedureid=@recipeprocedureid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeprocedureid", recipeProcedureID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeTipsByRecipeID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipetip where recipeid=@recipeid order by tipindex"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public DataSet GetRecipeTipByID(Guid recipeTipID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from recipetip where recipetipid=@recipetipid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipetipid", recipeTipID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public Int32 DeleteCookbookByID(Guid cookbookID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM cookbook where cookbookid=@cookbookid"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookid", cookbookID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 DeleteCookbookChapterByID(Guid cookbookID, Guid cookbookChapterID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM cookbookchapter where cookbookid=@cookbookid and cookbookchapterid=@cookbookchapterid"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookid", cookbookID);
+ dbCommand.Parameters.AddWithValue("@cookbookchapterid", cookbookChapterID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 DeleteRecipeByID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM recipe where recipeid=@recipeid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 DeleteRecipeIngredientByID(Guid recipeIngredientID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM recipeingredient where recipeingredientid=@recipeingredientid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeingredientid", recipeIngredientID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 DeleteRecipeIngredientsByRecipeID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM recipeingredient where recipeid=@recipeid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+
+ public Int32 DeleteRecipeProcedureByID(Guid recipeProcedureID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM recipeprocedure where recipeprocedureid=@recipeprocedcureid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeprocedureid", recipeProcedureID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 DeleteRecipeProceduresByRecipeID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM recipeprocedure where recipeid=@recipeid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 DeleteRecipeTipByID(Guid recipeTipID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM recipetip where recipetipid=@recipetipid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipetipid", recipeTipID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 DeleteRecipeTipsByRecipeID(Guid recipeID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("delete FROM recipetip where recipeid=@recipeid"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeid", recipeID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+
+ }
+
+ public Int32 InsertCookbook(Cookbook cookbook)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO cookbook ([cookbookID],[name],[author],[copyright],[comments]) VALUES (@cookbookID,@name,@author,@copyright,@comments)"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookID", cookbook.cookbookID);
+ dbCommand.Parameters.AddWithValue("@name", cookbook.name);
+ dbCommand.Parameters.AddWithValue("@author", cookbook.author);
+ dbCommand.Parameters.AddWithValue("@copyright", cookbook.copyright);
+ dbCommand.Parameters.AddWithValue("@comments", cookbook.comments);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 UpdateCookbook(Cookbook cookbook)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("UPDATE cookbook SET [name]=@name,[author]=@author,[copyright]=@copyright,[comments]=@comments WHERE [cookbookID]=@cookbookID"))
+ {
+ dbCommand.Parameters.AddWithValue("@name", cookbook.name);
+ dbCommand.Parameters.AddWithValue("@author", cookbook.author);
+ dbCommand.Parameters.AddWithValue("@copyright", cookbook.copyright);
+ dbCommand.Parameters.AddWithValue("@comments", cookbook.comments);
+ dbCommand.Parameters.AddWithValue("@cookbookID", cookbook.cookbookID.Value);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 InsertCookbookChapter(CookbookChapter cookbookChapter)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO cookbookchapter ([cookbookchapterid],[cookbookID],[parentchapterid],[name],[comments]) VALUES (@cookbookChapterID,@cookbookID,@parentChapterID,@name,@comments)"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookChapterID", cookbookChapter.cookbookChapterID);
+ dbCommand.Parameters.AddWithValue("@cookbookID", cookbookChapter.cookbookID);
+ dbCommand.Parameters.AddWithValue("@parentChapterID", cookbookChapter.parentChapterID ?? (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@name", cookbookChapter.name);
+ dbCommand.Parameters.AddWithValue("@comments", cookbookChapter.comments);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 UpdateCookbookChapter(CookbookChapter cookbookChapter)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("UPDATE cookbookchapter SET [cookbookid]=@cookbookID,[parentchapterid]=@parentChapterID,[name]=@name,[comments]=@comments WHERE [cookbookchapterID]=@cookbookChapterID"))
+ {
+ dbCommand.Parameters.AddWithValue("@cookbookID", cookbookChapter.cookbookID);
+ dbCommand.Parameters.AddWithValue("@parentChapterID", cookbookChapter.parentChapterID ?? (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@name", cookbookChapter.name);
+ dbCommand.Parameters.AddWithValue("@comments", cookbookChapter.comments);
+ dbCommand.Parameters.AddWithValue("@cookbookChapterID", cookbookChapter.cookbookChapterID);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+
+
+
+ public Int32 InsertRecipe(Recipe recipe)
+ {
+ //using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO recipe ([recipeID],[cookbookID],[cookbookchapterID],[recipename]," +
+ // "[author],[source],[webpage],[comments],[copyright],[servings],[nutritionservinglabel],[yield],[preparationtime],[cookingtime]," +
+ // "[readyintime],[inactivetime],[oventemperaturec],[oventemperaturef],[percentcaloriesfromalcohol],[percentcaloriesfromcarbs]," +
+ // "[percentcaloriesfromfat],[percentcaloriesfromprotein],[alanine],[alcohol],[alcoholfactor],[alphacarotene],[alphalinolenicacid]," +
+ // "[arachidonicacid],[arginine],[ash],[asparticacid],[betacarotene],[betacryptoxanthin],[betasitosterol],[betatocopherol],[biotin]," +
+ // "[caffeine],[calcium],[calories],[caloriesfromalcohol],[caloriesfromcarbs],[caloriesfromfat],[caloriesfromprotein],[campesterol]," +
+ // "[carbohydratefactor],[chloride],[cholesterol],[choline],[chromium],[copper],[cystine],[deltatocopherol],[dihomogammalinolenicacid]," +
+ // "[docosahexaenoicacid],[docosapentaenoicacid],[eicosadienoicacid],[eicosapentaenoicacid],[energy],[energyfromalcohol],[energyfromcarbs]," +
+ // "[energyfromfat],[energyfromprotein],[fatfactor],[fiber],[fluoride],[folate],[fructose],[galactose],[gammalinolenicacid],[gammatocopherol]," +
+ // "[glucose],[glutamicacid],[glycine],[histidine],[hydroxyproline],[iodine],[iron],[isoleucine],[lactose],[leucine],[linoleicacid]," +
+ // "[lycopene],[lysine],[magnesium],[maltose],[manganese],[mass],[methionine],[molybdenum],[monounsaturatedfat],[monounsaturatedfattyacid_14_1]," +
+ // "[monounsaturatedfattyacid_15_1],[monounsaturatedfattyacid_16_1],[monounsaturatedfattyacid_17_1],[monounsaturatedfattyacid_18_1]," +
+ // "[monounsaturatedfattyacid_20_1],[monounsaturatedfattyacid_22_1],[monounsaturatedfattyacid_24_1],[netcarbohydrates],[niacin]," +
+ // "[omega3fattyacids],[omega6fattyacids],[pantothenicacid],[phenylalanine],[phosphorus],[phytosterols],[polyunsaturatedfat]," +
+ // "[polyunsaturatedfattyacid_18_2],[polyunsaturatedfattyacid_18_3],[polyunsaturatedfattyacid_18_4],[polyunsaturatedfattyacid_20_3]," +
+ // "[polyunsaturatedfattyacid_20_4],[polyunsaturatedfattyacid_21_5],[polyunsaturatedfattyacid_22_4],[potassium],[proline],[protein]," +
+ // "[proteinfactor],[refuse],[retinol],[riboflavin],[saturatedfat],[saturatedfattyacid_10_0],[saturatedfattyacid_12_0]," +
+ // "[saturatedfattyacid_13_0],[saturatedfattyacid_14_0],[saturatedfattyacid_15_0],[saturatedfattyacid_16_0],[saturatedfattyacid_17_0]," +
+ // "[saturatedfattyacid_18_0],[saturatedfattyacid_20_0],[saturatedfattyacid_22_0],[saturatedfattyacid_24_0],[saturatedfattyacid_4_0]," +
+ // "[saturatedfattyacid_6_0],[saturatedfattyacid_8_0],[selenium],[serine],[sodium],[starch],[stigmasterol],[sucrose],[sugar],[sugaralcohols]," +
+ // "[theobromine],[thiamin],[threonine],[totalcarbohydrate],[totalfat],[transfattyacids],[transmonoenoicfattyacids],[transpolyenoicfattyacids]," +
+ // "[tryptophan],[tyrosine],[valine],[vitamina],[vitaminb12],[vitaminb6],[vitaminc],[vitamind],[vitamine],[vitamink],[volume],[water],[zinc])" +
+ // " VALUES (@recipeID,@cookbookID,@cookbookchapterID,@recipename," +
+ // "@author,@source,@webpage,@comments,@copyright,@servings,@nutritionservinglabel,@yield,@preparationtime,@cookingtime," +
+ // "@readyintime,@inactivetime,@oventemperaturec,@oventemperaturef,@percentcaloriesfromalcohol,@percentcaloriesfromcarbs," +
+ // "@percentcaloriesfromfat,@percentcaloriesfromprotein,@alanine,@alcohol,@alcoholfactor,@alphacarotene,@alphalinolenicacid," +
+ // "@arachidonicacid,@arginine,@ash,@asparticacid,@betacarotene,@betacryptoxanthin,@betasitosterol,@betatocopherol,@biotin," +
+ // "@caffeine,@calcium,@calories,@caloriesfromalcohol,@caloriesfromcarbs,@caloriesfromfat,@caloriesfromprotein,@campesterol," +
+ // "@carbohydratefactor,@chloride,@cholesterol,@choline,@chromium,@copper,@cystine,@deltatocopherol,@dihomogammalinolenicacid," +
+ // "@docosahexaenoicacid,@docosapentaenoicacid,@eicosadienoicacid,@eicosapentaenoicacid,@energy,@energyfromalcohol,@energyfromcarbs," +
+ // "@energyfromfat,@energyfromprotein,@fatfactor,@fiber,@fluoride,@folate,@fructose,@galactose,@gammalinolenicacid,@gammatocopherol," +
+ // "@glucose,@glutamicacid,@glycine,@histidine,@hydroxyproline,@iodine,@iron,@isoleucine,@lactose,@leucine,@linoleicacid," +
+ // "@lycopene,@lysine,@magnesium,@maltose,@manganese,@mass,@methionine,@molybdenum,@monounsaturatedfat,@monounsaturatedfattyacid_14_1," +
+ // "@monounsaturatedfattyacid_15_1,@monounsaturatedfattyacid_16_1,@monounsaturatedfattyacid_17_1,@monounsaturatedfattyacid_18_1," +
+ // "@monounsaturatedfattyacid_20_1,@monounsaturatedfattyacid_22_1,@monounsaturatedfattyacid_24_1,@netcarbohydrates,@niacin," +
+ // "@omega3fattyacids,@omega6fattyacids,@pantothenicacid,@phenylalanine,@phosphorus,@phytosterols,@polyunsaturatedfat," +
+ // "@polyunsaturatedfattyacid_18_2,@polyunsaturatedfattyacid_18_3,@polyunsaturatedfattyacid_18_4,@polyunsaturatedfattyacid_20_3," +
+ // "@polyunsaturatedfattyacid_20_4,@polyunsaturatedfattyacid_21_5,@polyunsaturatedfattyacid_22_4,@potassium,@proline,@protein," +
+ // "@proteinfactor,@refuse,@retinol,@riboflavin,@saturatedfat,@saturatedfattyacid_10_0,@saturatedfattyacid_12_0," +
+ // "@saturatedfattyacid_13_0,@saturatedfattyacid_14_0,@saturatedfattyacid_15_0,@saturatedfattyacid_16_0,@saturatedfattyacid_17_0," +
+ // "@saturatedfattyacid_18_0,@saturatedfattyacid_20_0,@saturatedfattyacid_22_0,@saturatedfattyacid_24_0,@saturatedfattyacid_4_0," +
+ // "@saturatedfattyacid_6_0,@saturatedfattyacid_8_0,@selenium,@serine,@sodium,@starch,@stigmasterol,@sucrose,@sugar,@sugaralcohols," +
+ // "@theobromine,@thiamin,@threonine,@totalcarbohydrate,@totalfat,@transfattyacids,@transmonoenoicfattyacids,@transpolyenoicfattyacids," +
+ // "@tryptophan,@tyrosine,@valine,@vitamina,@vitaminb12,@vitaminb6,@vitaminc,@vitamind,@vitamine,@vitamink,@volume,@water,@zinc)"))
+ //{
+
+ // dbCommand.Parameters.AddWithValue("@recipeID", recipe.recipeID);
+ // dbCommand.Parameters.AddWithValue("@cookbookID", recipe.cookbookID);
+ // dbCommand.Parameters.AddWithValue("@cookbookchapterID", recipe.cookbookchapterID ?? (object)DBNull.Value);
+ // dbCommand.Parameters.AddWithValue("@recipename", recipe.recipename);
+ // dbCommand.Parameters.AddWithValue("@author", recipe.author);
+ // dbCommand.Parameters.AddWithValue("@source", recipe.source);
+ // dbCommand.Parameters.AddWithValue("@webpage", recipe.webpage);
+ // dbCommand.Parameters.AddWithValue("@comments", recipe.comments);
+ // dbCommand.Parameters.AddWithValue("@copyright", recipe.copyright);
+ // dbCommand.Parameters.AddWithValue("@servings", recipe.servings);
+ // dbCommand.Parameters.AddWithValue("@nutritionservinglabel", recipe.nutritionservinglabel);
+ // dbCommand.Parameters.AddWithValue("@yield", recipe.yield);
+ // dbCommand.Parameters.AddWithValue("@preparationtime", recipe.preparationtime);
+ // dbCommand.Parameters.AddWithValue("@cookingtime", recipe.cookingtime);
+ // dbCommand.Parameters.AddWithValue("@readyintime", recipe.readyintime);
+ // dbCommand.Parameters.AddWithValue("@inactivetime", recipe.inactivetime);
+ // dbCommand.Parameters.AddWithValue("@oventemperaturec", recipe.oventemperaturec);
+ // dbCommand.Parameters.AddWithValue("@oventemperaturef", recipe.oventemperaturef);
+ // dbCommand.Parameters.AddWithValue("@percentcaloriesfromalcohol", recipe.percentcaloriesfromalcohol);
+ // dbCommand.Parameters.AddWithValue("@percentcaloriesfromcarbs", recipe.percentcaloriesfromcarbs);
+ // dbCommand.Parameters.AddWithValue("@percentcaloriesfromfat", recipe.percentcaloriesfromfat);
+ // dbCommand.Parameters.AddWithValue("@percentcaloriesfromprotein", recipe.percentcaloriesfromprotein);
+ // dbCommand.Parameters.AddWithValue("@alanine", recipe.alanine);
+ // dbCommand.Parameters.AddWithValue("@alcohol", recipe.alcohol);
+ // dbCommand.Parameters.AddWithValue("@alcoholfactor", recipe.alcoholfactor);
+ // dbCommand.Parameters.AddWithValue("@alphacarotene", recipe.alphacarotene);
+ // dbCommand.Parameters.AddWithValue("@alphalinolenicacid", recipe.alphalinolenicacid);
+ // dbCommand.Parameters.AddWithValue("@arachidonicacid", recipe.arachidonicacid);
+ // dbCommand.Parameters.AddWithValue("@arginine", recipe.arginine);
+ // dbCommand.Parameters.AddWithValue("@ash", recipe.ash);
+ // dbCommand.Parameters.AddWithValue("@asparticacid", recipe.asparticacid);
+ // dbCommand.Parameters.AddWithValue("@betacarotene", recipe.betacarotene);
+ // dbCommand.Parameters.AddWithValue("@betacryptoxanthin", recipe.betacryptoxanthin);
+ // dbCommand.Parameters.AddWithValue("@betasitosterol", recipe.betasitosterol);
+ // dbCommand.Parameters.AddWithValue("@betatocopherol", recipe.betatocopherol);
+ // dbCommand.Parameters.AddWithValue("@biotin", recipe.biotin);
+ // dbCommand.Parameters.AddWithValue("@caffeine", recipe.caffeine);
+ // dbCommand.Parameters.AddWithValue("@calcium", recipe.calcium);
+ // dbCommand.Parameters.AddWithValue("@calories", recipe.calories);
+ // dbCommand.Parameters.AddWithValue("@caloriesfromalcohol", recipe.caloriesfromalcohol);
+ // dbCommand.Parameters.AddWithValue("@caloriesfromcarbs", recipe.caloriesfromcarbs);
+ // dbCommand.Parameters.AddWithValue("@caloriesfromfat", recipe.caloriesfromfat);
+ // dbCommand.Parameters.AddWithValue("@caloriesfromprotein", recipe.caloriesfromprotein);
+ // dbCommand.Parameters.AddWithValue("@campesterol", recipe.campesterol);
+ // dbCommand.Parameters.AddWithValue("@carbohydratefactor", recipe.carbohydratefactor);
+ // dbCommand.Parameters.AddWithValue("@chloride", recipe.chloride);
+ // dbCommand.Parameters.AddWithValue("@cholesterol", recipe.cholesterol);
+ // dbCommand.Parameters.AddWithValue("@choline", recipe.choline);
+ // dbCommand.Parameters.AddWithValue("@chromium", recipe.chromium);
+ // dbCommand.Parameters.AddWithValue("@copper", recipe.copper);
+ // dbCommand.Parameters.AddWithValue("@cystine", recipe.cystine);
+ // dbCommand.Parameters.AddWithValue("@deltatocopherol", recipe.deltatocopherol);
+ // dbCommand.Parameters.AddWithValue("@dihomogammalinolenicacid", recipe.dihomogammalinolenicacid);
+ // dbCommand.Parameters.AddWithValue("@docosahexaenoicacid", recipe.docosahexaenoicacid);
+ // dbCommand.Parameters.AddWithValue("@docosapentaenoicacid", recipe.docosapentaenoicacid);
+ // dbCommand.Parameters.AddWithValue("@eicosadienoicacid", recipe.eicosadienoicacid);
+ // dbCommand.Parameters.AddWithValue("@eicosapentaenoicacid", recipe.eicosapentaenoicacid);
+ // dbCommand.Parameters.AddWithValue("@energy", recipe.energy);
+ // dbCommand.Parameters.AddWithValue("@energyfromalcohol", recipe.energyfromalcohol);
+ // dbCommand.Parameters.AddWithValue("@energyfromcarbs", recipe.energyfromcarbs);
+ // dbCommand.Parameters.AddWithValue("@energyfromfat", recipe.energyfromfat);
+ // dbCommand.Parameters.AddWithValue("@energyfromprotein", recipe.energyfromprotein);
+ // dbCommand.Parameters.AddWithValue("@fatfactor", recipe.fatfactor);
+ // dbCommand.Parameters.AddWithValue("@fiber", recipe.fiber);
+ // dbCommand.Parameters.AddWithValue("@fluoride", recipe.fluoride);
+ // dbCommand.Parameters.AddWithValue("@folate", recipe.folate);
+ // dbCommand.Parameters.AddWithValue("@fructose", recipe.fructose);
+ // dbCommand.Parameters.AddWithValue("@galactose", recipe.galactose);
+ // dbCommand.Parameters.AddWithValue("@gammalinolenicacid", recipe.gammalinolenicacid);
+ // dbCommand.Parameters.AddWithValue("@gammatocopherol", recipe.gammatocopherol);
+ // dbCommand.Parameters.AddWithValue("@glucose", recipe.glucose);
+ // dbCommand.Parameters.AddWithValue("@glutamicacid", recipe.glutamicacid);
+ // dbCommand.Parameters.AddWithValue("@glycine", recipe.glycine);
+ // dbCommand.Parameters.AddWithValue("@histidine", recipe.histidine);
+ // dbCommand.Parameters.AddWithValue("@hydroxyproline", recipe.hydroxyproline);
+ // dbCommand.Parameters.AddWithValue("@iodine", recipe.iodine);
+ // dbCommand.Parameters.AddWithValue("@iron", recipe.iron);
+ // dbCommand.Parameters.AddWithValue("@isoleucine", recipe.isoleucine);
+ // dbCommand.Parameters.AddWithValue("@lactose", recipe.lactose);
+ // dbCommand.Parameters.AddWithValue("@leucine", recipe.leucine);
+ // dbCommand.Parameters.AddWithValue("@linoleicacid", recipe.linoleicacid);
+ // dbCommand.Parameters.AddWithValue("@lycopene", recipe.lycopene);
+ // dbCommand.Parameters.AddWithValue("@lysine", recipe.lysine);
+ // dbCommand.Parameters.AddWithValue("@magnesium", recipe.magnesium);
+ // dbCommand.Parameters.AddWithValue("@maltose", recipe.maltose);
+ // dbCommand.Parameters.AddWithValue("@manganese", recipe.manganese);
+ // dbCommand.Parameters.AddWithValue("@mass", recipe.mass);
+ // dbCommand.Parameters.AddWithValue("@methionine", recipe.methionine);
+ // dbCommand.Parameters.AddWithValue("@molybdenum", recipe.molybdenum);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfat", recipe.monounsaturatedfat);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_14_1", recipe.monounsaturatedfattyacid_14_1);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_15_1", recipe.monounsaturatedfattyacid_15_1);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_16_1", recipe.monounsaturatedfattyacid_16_1);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_17_1", recipe.monounsaturatedfattyacid_17_1);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_18_1", recipe.monounsaturatedfattyacid_18_1);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_20_1", recipe.monounsaturatedfattyacid_20_1);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_22_1", recipe.monounsaturatedfattyacid_22_1);
+ // dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_24_1", recipe.monounsaturatedfattyacid_24_1);
+ // dbCommand.Parameters.AddWithValue("@netcarbohydrates", recipe.netcarbohydrates);
+ // dbCommand.Parameters.AddWithValue("@niacin", recipe.niacin);
+ // dbCommand.Parameters.AddWithValue("@omega3fattyacids", recipe.omega3fattyacids);
+ // dbCommand.Parameters.AddWithValue("@omega6fattyacids", recipe.omega6fattyacids);
+ // dbCommand.Parameters.AddWithValue("@pantothenicacid", recipe.pantothenicacid);
+ // dbCommand.Parameters.AddWithValue("@phenylalanine", recipe.phenylalanine);
+ // dbCommand.Parameters.AddWithValue("@phosphorus", recipe.phosphorus);
+ // dbCommand.Parameters.AddWithValue("@phytosterols", recipe.phytosterols);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfat", recipe.polyunsaturatedfat);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfattyacid_18_2", recipe.polyunsaturatedfattyacid_18_2);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfattyacid_18_3", recipe.polyunsaturatedfattyacid_18_3);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfattyacid_18_4", recipe.polyunsaturatedfattyacid_18_4);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfattyacid_20_3", recipe.polyunsaturatedfattyacid_20_3);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfattyacid_20_4", recipe.polyunsaturatedfattyacid_20_4);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfattyacid_21_5", recipe.polyunsaturatedfattyacid_21_5);
+ // dbCommand.Parameters.AddWithValue("@polyunsaturatedfattyacid_22_4", recipe.polyunsaturatedfattyacid_22_4);
+ // dbCommand.Parameters.AddWithValue("@potassium", recipe.potassium);
+ // dbCommand.Parameters.AddWithValue("@proline", recipe.proline);
+ // dbCommand.Parameters.AddWithValue("@protein", recipe.protein);
+ // dbCommand.Parameters.AddWithValue("@proteinfactor", recipe.proteinfactor);
+ // dbCommand.Parameters.AddWithValue("@refuse", recipe.refuse);
+ // dbCommand.Parameters.AddWithValue("@retinol", recipe.retinol);
+ // dbCommand.Parameters.AddWithValue("@riboflavin", recipe.riboflavin);
+ // dbCommand.Parameters.AddWithValue("@saturatedfat", recipe.saturatedfat);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_10_0", recipe.saturatedfattyacid_10_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_12_0", recipe.saturatedfattyacid_12_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_13_0", recipe.saturatedfattyacid_13_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_14_0", recipe.saturatedfattyacid_14_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_15_0", recipe.saturatedfattyacid_15_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_16_0", recipe.saturatedfattyacid_16_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_17_0", recipe.saturatedfattyacid_17_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_18_0", recipe.saturatedfattyacid_18_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_20_0", recipe.saturatedfattyacid_20_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_22_0", recipe.saturatedfattyacid_22_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_24_0", recipe.saturatedfattyacid_24_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_4_0", recipe.saturatedfattyacid_4_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_6_0", recipe.saturatedfattyacid_6_0);
+ // dbCommand.Parameters.AddWithValue("@saturatedfattyacid_8_0", recipe.saturatedfattyacid_8_0);
+ // dbCommand.Parameters.AddWithValue("@selenium", recipe.selenium);
+ // dbCommand.Parameters.AddWithValue("@serine", recipe.serine);
+ // dbCommand.Parameters.AddWithValue("@sodium", recipe.sodium);
+ // dbCommand.Parameters.AddWithValue("@starch", recipe.starch);
+ // dbCommand.Parameters.AddWithValue("@stigmasterol", recipe.stigmasterol);
+ // dbCommand.Parameters.AddWithValue("@sucrose", recipe.sucrose);
+ // dbCommand.Parameters.AddWithValue("@sugar", recipe.sugar);
+ // dbCommand.Parameters.AddWithValue("@sugaralcohols", recipe.sugaralcohols);
+ // dbCommand.Parameters.AddWithValue("@theobromine", recipe.theobromine);
+ // dbCommand.Parameters.AddWithValue("@thiamin", recipe.thiamin);
+ // dbCommand.Parameters.AddWithValue("@threonine", recipe.threonine);
+ // dbCommand.Parameters.AddWithValue("@totalcarbohydrate", recipe.totalcarbohydrate);
+ // dbCommand.Parameters.AddWithValue("@totalfat", recipe.totalfat);
+ // dbCommand.Parameters.AddWithValue("@transfattyacids", recipe.transfattyacids);
+ // dbCommand.Parameters.AddWithValue("@transmonoenoicfattyacids", recipe.transmonoenoicfattyacids);
+ // dbCommand.Parameters.AddWithValue("@transpolyenoicfattyacids", recipe.transpolyenoicfattyacids);
+ // dbCommand.Parameters.AddWithValue("@tryptophan", recipe.tryptophan);
+ // dbCommand.Parameters.AddWithValue("@tyrosine", recipe.tyrosine);
+ // dbCommand.Parameters.AddWithValue("@valine", recipe.valine);
+ // dbCommand.Parameters.AddWithValue("@vitamina", recipe.vitamina);
+ // dbCommand.Parameters.AddWithValue("@vitaminb12", recipe.vitaminb12);
+ // dbCommand.Parameters.AddWithValue("@vitaminb6", recipe.vitaminb6);
+ // dbCommand.Parameters.AddWithValue("@vitaminc", recipe.vitaminc);
+ // dbCommand.Parameters.AddWithValue("@vitamind", recipe.vitamind);
+ // dbCommand.Parameters.AddWithValue("@vitamine", recipe.vitamine);
+ // dbCommand.Parameters.AddWithValue("@vitamink", recipe.vitamink);
+ // dbCommand.Parameters.AddWithValue("@volume", recipe.volume);
+ // dbCommand.Parameters.AddWithValue("@water", recipe.water);
+ // dbCommand.Parameters.AddWithValue("@zinc", recipe.zinc);
+
+ using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO recipe ([recipeID],[cookbookID],[cookbookchapterID],[recipename]) " +
+ "VALUES (@recipeID,@cookbookID,@cookbookchapterID,@recipename)"))
+ {
+
+ dbCommand.Parameters.AddWithValue("@recipeID", recipe.recipeID);
+ dbCommand.Parameters.AddWithValue("@cookbookID", recipe.cookbookID);
+ dbCommand.Parameters.AddWithValue("@cookbookchapterID", recipe.cookbookchapterID ?? (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@recipename", recipe.recipename);
+ //Insert shell, then update
+ return this.ExecuteNonQuery(dbCommand) + this.UpdateRecipe(recipe);
+ }
+ }
+
+ public Int32 UpdateRecipe(Recipe recipe)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("UPDATE recipe SET alanine=@alanine,alcohol=@alcohol,alcoholfactor=@alcoholfactor,alphacarotene=@alphacarotene," +
+ "alphalinolenicacid=@alphalinolenicacid,arachidonicacid=@arachidonicacid,arginine=@arginine,ash=@ash,asparticacid=@asparticacid,author=@author,betacarotene=@betacarotene," +
+ "betacryptoxanthin=@betacryptoxanthin,betasitosterol=@betasitosterol,betatocopherol=@betatocopherol,biotin=@biotin,caffeine=@caffeine,calcium=@calcium,calories=@calories," +
+ "caloriesfromalcohol=@caloriesfromalcohol,caloriesfromcarbs=@caloriesfromcarbs,caloriesfromfat=@caloriesfromfat,caloriesfromprotein=@caloriesfromprotein,campesterol=@campesterol," +
+ "carbohydratefactor=@carbohydratefactor,chloride=@chloride,cholesterol=@cholesterol,choline=@choline,chromium=@chromium,comments=@comments,cookbookchapterid=@cookbookchapterid," +
+ "cookbookid=@cookbookid,cookingtime=@cookingtime,copper=@copper,copyright=@copyright,cystine=@cystine,deltatocopherol=@deltatocopherol," +
+ "dihomogammalinolenicacid=@dihomogammalinolenicacid,docosahexaenoicacid=@docosahexaenoicacid,docosapentaenoicacid=@docosapentaenoicacid,eicosadienoicacid=@eicosadienoicacid," +
+ "eicosapentaenoicacid=@eicosapentaenoicacid,energy=@energy,energyfromalcohol=@energyfromalcohol,energyfromcarbs=@energyfromcarbs,energyfromfat=@energyfromfat," +
+ "energyfromprotein=@energyfromprotein,fatfactor=@fatfactor,fiber=@fiber,fluoride=@fluoride,folate=@folate,fructose=@fructose,galactose=@galactose," +
+ "gammalinolenicacid=@gammalinolenicacid,gammatocopherol=@gammatocopherol,glucose=@glucose,glutamicacid=@glutamicacid,glycine=@glycine,histidine=@histidine," +
+ "hydroxyproline=@hydroxyproline,inactivetime=@inactivetime,iodine=@iodine,iron=@iron,isoleucine=@isoleucine,lactose=@lactose,leucine=@leucine,linoleicacid=@linoleicacid," +
+ "lycopene=@lycopene,lysine=@lysine,magnesium=@magnesium,maltose=@maltose,manganese=@manganese,mass=@mass,methionine=@methionine,molybdenum=@molybdenum," +
+ "monounsaturatedfat=@monounsaturatedfat,monounsaturatedfattyacid_14_1=@monounsaturatedfattyacid_14_1,monounsaturatedfattyacid_15_1=@monounsaturatedfattyacid_15_1," +
+ "monounsaturatedfattyacid_16_1=@monounsaturatedfattyacid_16_1,monounsaturatedfattyacid_17_1=@monounsaturatedfattyacid_17_1," +
+ "monounsaturatedfattyacid_18_1=@monounsaturatedfattyacid_18_1,monounsaturatedfattyacid_20_1=@monounsaturatedfattyacid_20_1," +
+ "monounsaturatedfattyacid_22_1=@monounsaturatedfattyacid_22_1,monounsaturatedfattyacid_24_1=@monounsaturatedfattyacid_24_1,netcarbohydrates=@netcarbohydrates," +
+ "niacin=@niacin,nutritionservinglabel=@nutritionservinglabel,omega3fattyacids=@omega3fattyacids,omega6fattyacids=@omega6fattyacids,oventemperaturec=@oventemperaturec " +
+ " WHERE recipeid=@recipeID"))
+ {
+ using (OleDbCommand dbCommand2 = new OleDbCommand("UPDATE recipe SET oventemperaturef=@oventemperaturef,pantothenicacid=@pantothenicacid,percentcaloriesfromalcohol=@percentcaloriesfromalcohol,percentcaloriesfromcarbs=@percentcaloriesfromcarbs," +
+ "percentcaloriesfromfat=@percentcaloriesfromfat,percentcaloriesfromprotein=@percentcaloriesfromprotein,phenylalanine=@phenylalanine,phosphorus=@phosphorus," +
+ "phytosterols=@phytosterols,polyunsaturatedfat=@polyunsaturatedfat,polyunsaturatedfattyacid_18_2=@polyunsaturatedfattyacid_18_2," +
+ "polyunsaturatedfattyacid_18_3=@polyunsaturatedfattyacid_18_3,polyunsaturatedfattyacid_18_4=@polyunsaturatedfattyacid_18_4," +
+ "polyunsaturatedfattyacid_20_3=@polyunsaturatedfattyacid_20_3,polyunsaturatedfattyacid_20_4=@polyunsaturatedfattyacid_20_4," +
+ "polyunsaturatedfattyacid_21_5=@polyunsaturatedfattyacid_21_5,polyunsaturatedfattyacid_22_4=@polyunsaturatedfattyacid_22_4,potassium=@potassium,preparationtime=@preparationtime," +
+ "proline=@proline,protein=@protein,proteinfactor=@proteinfactor,readyintime=@readyintime,recipename=@recipename,refuse=@refuse,retinol=@retinol,riboflavin=@riboflavin," +
+ "saturatedfat=@saturatedfat,saturatedfattyacid_10_0=@saturatedfattyacid_10_0,saturatedfattyacid_12_0=@saturatedfattyacid_12_0,saturatedfattyacid_13_0=@saturatedfattyacid_13_0," +
+ "saturatedfattyacid_14_0=@saturatedfattyacid_14_0,saturatedfattyacid_15_0=@saturatedfattyacid_15_0,saturatedfattyacid_16_0=@saturatedfattyacid_16_0," +
+ "saturatedfattyacid_17_0=@saturatedfattyacid_17_0,saturatedfattyacid_18_0=@saturatedfattyacid_18_0,saturatedfattyacid_20_0=@saturatedfattyacid_20_0," +
+ "saturatedfattyacid_22_0=@saturatedfattyacid_22_0,saturatedfattyacid_24_0=@saturatedfattyacid_24_0,saturatedfattyacid_4_0=@saturatedfattyacid_4_0," +
+ "saturatedfattyacid_6_0=@saturatedfattyacid_6_0,saturatedfattyacid_8_0=@saturatedfattyacid_8_0,selenium=@selenium,serine=@serine,servings=@servings,sodium=@sodium," +
+ "source=@source,starch=@starch,stigmasterol=@stigmasterol,sucrose=@sucrose,sugar=@sugar,sugaralcohols=@sugaralcohols,theobromine=@theobromine,thiamin=@thiamin," +
+ "threonine=@threonine,totalcarbohydrate=@totalcarbohydrate,totalfat=@totalfat,transfattyacids=@transfattyacids,transmonoenoicfattyacids=@transmonoenoicfattyacids," +
+ "transpolyenoicfattyacids=@transpolyenoicfattyacids,tryptophan=@tryptophan,tyrosine=@tyrosine,valine=@valine,vitamina=@vitamina,vitaminb12=@vitaminb12,vitaminb6=@vitaminb6," +
+ "vitaminc=@vitaminc,vitamind=@vitamind,vitamine=@vitamine,vitamink=@vitamink,volume=@volume,water=@water,webpage=@webpage,yield=@yield,zinc=@zinc WHERE recipeid=@recipeID"))
+ {
+ dbCommand.Parameters.AddWithValue("@alanine", recipe.alanine);
+ dbCommand.Parameters.AddWithValue("@alcohol", recipe.alcohol);
+ dbCommand.Parameters.AddWithValue("@alcoholfactor", recipe.alcoholfactor);
+ dbCommand.Parameters.AddWithValue("@alphacarotene", recipe.alphacarotene);
+ dbCommand.Parameters.AddWithValue("@alphalinolenicacid", recipe.alphalinolenicacid);
+ dbCommand.Parameters.AddWithValue("@arachidonicacid", recipe.arachidonicacid);
+ dbCommand.Parameters.AddWithValue("@arginine", recipe.arginine);
+ dbCommand.Parameters.AddWithValue("@ash", recipe.ash);
+ dbCommand.Parameters.AddWithValue("@asparticacid", recipe.asparticacid);
+ dbCommand.Parameters.AddWithValue("@author", recipe.author);
+ dbCommand.Parameters.AddWithValue("@betacarotene", recipe.betacarotene);
+ dbCommand.Parameters.AddWithValue("@betacryptoxanthin", recipe.betacryptoxanthin);
+ dbCommand.Parameters.AddWithValue("@betasitosterol", recipe.betasitosterol);
+ dbCommand.Parameters.AddWithValue("@betatocopherol", recipe.betatocopherol);
+ dbCommand.Parameters.AddWithValue("@biotin", recipe.biotin);
+ dbCommand.Parameters.AddWithValue("@caffeine", recipe.caffeine);
+ dbCommand.Parameters.AddWithValue("@calcium", recipe.calcium);
+ dbCommand.Parameters.AddWithValue("@calories", recipe.calories);
+ dbCommand.Parameters.AddWithValue("@caloriesfromalcohol", recipe.caloriesfromalcohol);
+ dbCommand.Parameters.AddWithValue("@caloriesfromcarbs", recipe.caloriesfromcarbs);
+ dbCommand.Parameters.AddWithValue("@caloriesfromfat", recipe.caloriesfromfat);
+ dbCommand.Parameters.AddWithValue("@caloriesfromprotein", recipe.caloriesfromprotein);
+ dbCommand.Parameters.AddWithValue("@campesterol", recipe.campesterol);
+ dbCommand.Parameters.AddWithValue("@carbohydratefactor", recipe.carbohydratefactor);
+ dbCommand.Parameters.AddWithValue("@chloride", recipe.chloride);
+ dbCommand.Parameters.AddWithValue("@cholesterol", recipe.cholesterol);
+ dbCommand.Parameters.AddWithValue("@choline", recipe.choline);
+ dbCommand.Parameters.AddWithValue("@chromium", recipe.chromium);
+ dbCommand.Parameters.AddWithValue("@comments", recipe.comments);
+ dbCommand.Parameters.AddWithValue("@cookbookchapterid", recipe.cookbookchapterID ?? (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@cookbookID", recipe.cookbookID);
+ dbCommand.Parameters.AddWithValue("@cookingtime", recipe.cookingtime);
+ dbCommand.Parameters.AddWithValue("@copper", recipe.copper);
+ dbCommand.Parameters.AddWithValue("@copyright", recipe.copyright);
+ dbCommand.Parameters.AddWithValue("@cystine", recipe.cystine);
+ dbCommand.Parameters.AddWithValue("@deltatocopherol", recipe.deltatocopherol);
+ dbCommand.Parameters.AddWithValue("@dihomogammalinolenicacid", recipe.dihomogammalinolenicacid);
+ dbCommand.Parameters.AddWithValue("@docosahexaenoicacid", recipe.docosahexaenoicacid);
+ dbCommand.Parameters.AddWithValue("@docosapentaenoicacid", recipe.docosapentaenoicacid);
+ dbCommand.Parameters.AddWithValue("@eicosadienoicacid", recipe.eicosadienoicacid);
+ dbCommand.Parameters.AddWithValue("@eicosapentaenoicacid", recipe.eicosapentaenoicacid);
+ dbCommand.Parameters.AddWithValue("@energy", recipe.energy);
+ dbCommand.Parameters.AddWithValue("@energyfromalcohol", recipe.energyfromalcohol);
+ dbCommand.Parameters.AddWithValue("@energyfromcarbs", recipe.energyfromcarbs);
+ dbCommand.Parameters.AddWithValue("@energyfromfat", recipe.energyfromfat);
+ dbCommand.Parameters.AddWithValue("@energyfromprotein", recipe.energyfromprotein);
+ dbCommand.Parameters.AddWithValue("@fatfactor", recipe.fatfactor);
+ dbCommand.Parameters.AddWithValue("@fiber", recipe.fiber);
+ dbCommand.Parameters.AddWithValue("@fluoride", recipe.fluoride);
+ dbCommand.Parameters.AddWithValue("@folate", recipe.folate);
+ dbCommand.Parameters.AddWithValue("@fructose", recipe.fructose);
+ dbCommand.Parameters.AddWithValue("@galactose", recipe.galactose);
+ dbCommand.Parameters.AddWithValue("@gammalinolenicacid", recipe.gammalinolenicacid);
+ dbCommand.Parameters.AddWithValue("@gammatocopherol", recipe.gammatocopherol);
+ dbCommand.Parameters.AddWithValue("@glucose", recipe.glucose);
+ dbCommand.Parameters.AddWithValue("@glutamicacid", recipe.glutamicacid);
+ dbCommand.Parameters.AddWithValue("@glycine", recipe.glycine);
+ dbCommand.Parameters.AddWithValue("@histidine", recipe.histidine);
+ dbCommand.Parameters.AddWithValue("@hydroxyproline", recipe.hydroxyproline);
+ dbCommand.Parameters.AddWithValue("@inactivetime", recipe.inactivetime);
+ dbCommand.Parameters.AddWithValue("@iodine", recipe.iodine);
+ dbCommand.Parameters.AddWithValue("@iron", recipe.iron);
+ dbCommand.Parameters.AddWithValue("@isoleucine", recipe.isoleucine);
+ dbCommand.Parameters.AddWithValue("@lactose", recipe.lactose);
+ dbCommand.Parameters.AddWithValue("@leucine", recipe.leucine);
+ dbCommand.Parameters.AddWithValue("@linoleicacid", recipe.linoleicacid);
+ dbCommand.Parameters.AddWithValue("@lycopene", recipe.lycopene);
+ dbCommand.Parameters.AddWithValue("@lysine", recipe.lysine);
+ dbCommand.Parameters.AddWithValue("@magnesium", recipe.magnesium);
+ dbCommand.Parameters.AddWithValue("@maltose", recipe.maltose);
+ dbCommand.Parameters.AddWithValue("@manganese", recipe.manganese);
+ dbCommand.Parameters.AddWithValue("@mass", recipe.mass);
+ dbCommand.Parameters.AddWithValue("@methionine", recipe.methionine);
+ dbCommand.Parameters.AddWithValue("@molybdenum", recipe.molybdenum);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfat", recipe.monounsaturatedfat);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_14_1", recipe.monounsaturatedfattyacid_14_1);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_15_1", recipe.monounsaturatedfattyacid_15_1);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_16_1", recipe.monounsaturatedfattyacid_16_1);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_17_1", recipe.monounsaturatedfattyacid_17_1);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_18_1", recipe.monounsaturatedfattyacid_18_1);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_20_1", recipe.monounsaturatedfattyacid_20_1);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_22_1", recipe.monounsaturatedfattyacid_22_1);
+ dbCommand.Parameters.AddWithValue("@monounsaturatedfattyacid_24_1", recipe.monounsaturatedfattyacid_24_1);
+ dbCommand.Parameters.AddWithValue("@netcarbohydrates", recipe.netcarbohydrates);
+ dbCommand.Parameters.AddWithValue("@niacin", recipe.niacin);
+ dbCommand.Parameters.AddWithValue("@nutritionservinglabel", recipe.nutritionservinglabel);
+ dbCommand.Parameters.AddWithValue("@omega3fattyacids", recipe.omega3fattyacids);
+ dbCommand.Parameters.AddWithValue("@omega6fattyacids", recipe.omega6fattyacids);
+ dbCommand.Parameters.AddWithValue("@oventemperaturec", recipe.oventemperaturec);
+ dbCommand.Parameters.AddWithValue("@recipeID", recipe.recipeID);
+
+
+ dbCommand2.Parameters.AddWithValue("@oventemperaturef", recipe.oventemperaturef);
+ dbCommand2.Parameters.AddWithValue("@pantothenicacid", recipe.pantothenicacid);
+ dbCommand2.Parameters.AddWithValue("@percentcaloriesfromalcohol", recipe.percentcaloriesfromalcohol);
+ dbCommand2.Parameters.AddWithValue("@percentcaloriesfromcarbs", recipe.percentcaloriesfromcarbs);
+ dbCommand2.Parameters.AddWithValue("@percentcaloriesfromfat", recipe.percentcaloriesfromfat);
+ dbCommand2.Parameters.AddWithValue("@percentcaloriesfromprotein", recipe.percentcaloriesfromprotein);
+ dbCommand2.Parameters.AddWithValue("@phenylalanine", recipe.phenylalanine);
+ dbCommand2.Parameters.AddWithValue("@phosphorus", recipe.phosphorus);
+ dbCommand2.Parameters.AddWithValue("@phytosterols", recipe.phytosterols);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfat", recipe.polyunsaturatedfat);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfattyacid_18_2", recipe.polyunsaturatedfattyacid_18_2);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfattyacid_18_3", recipe.polyunsaturatedfattyacid_18_3);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfattyacid_18_4", recipe.polyunsaturatedfattyacid_18_4);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfattyacid_20_3", recipe.polyunsaturatedfattyacid_20_3);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfattyacid_20_4", recipe.polyunsaturatedfattyacid_20_4);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfattyacid_21_5", recipe.polyunsaturatedfattyacid_21_5);
+ dbCommand2.Parameters.AddWithValue("@polyunsaturatedfattyacid_22_4", recipe.polyunsaturatedfattyacid_22_4);
+ dbCommand2.Parameters.AddWithValue("@potassium", recipe.potassium);
+ dbCommand2.Parameters.AddWithValue("@preparationtime", recipe.preparationtime);
+ dbCommand2.Parameters.AddWithValue("@proline", recipe.proline);
+ dbCommand2.Parameters.AddWithValue("@protein", recipe.protein);
+ dbCommand2.Parameters.AddWithValue("@proteinfactor", recipe.proteinfactor);
+ dbCommand2.Parameters.AddWithValue("@readyintime", recipe.readyintime);
+ dbCommand2.Parameters.AddWithValue("@recipename", recipe.recipename);
+ dbCommand2.Parameters.AddWithValue("@refuse", recipe.refuse);
+ dbCommand2.Parameters.AddWithValue("@retinol", recipe.retinol);
+ dbCommand2.Parameters.AddWithValue("@riboflavin", recipe.riboflavin);
+ dbCommand2.Parameters.AddWithValue("@saturatedfat", recipe.saturatedfat);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_10_0", recipe.saturatedfattyacid_10_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_12_0", recipe.saturatedfattyacid_12_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_13_0", recipe.saturatedfattyacid_13_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_14_0", recipe.saturatedfattyacid_14_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_15_0", recipe.saturatedfattyacid_15_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_16_0", recipe.saturatedfattyacid_16_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_17_0", recipe.saturatedfattyacid_17_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_18_0", recipe.saturatedfattyacid_18_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_20_0", recipe.saturatedfattyacid_20_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_22_0", recipe.saturatedfattyacid_22_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_24_0", recipe.saturatedfattyacid_24_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_4_0", recipe.saturatedfattyacid_4_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_6_0", recipe.saturatedfattyacid_6_0);
+ dbCommand2.Parameters.AddWithValue("@saturatedfattyacid_8_0", recipe.saturatedfattyacid_8_0);
+ dbCommand2.Parameters.AddWithValue("@selenium", recipe.selenium);
+ dbCommand2.Parameters.AddWithValue("@serine", recipe.serine);
+ dbCommand2.Parameters.AddWithValue("@servings", recipe.servings);
+ dbCommand2.Parameters.AddWithValue("@sodium", recipe.sodium);
+ dbCommand2.Parameters.AddWithValue("@source", recipe.source);
+ dbCommand2.Parameters.AddWithValue("@starch", recipe.starch);
+ dbCommand2.Parameters.AddWithValue("@stigmasterol", recipe.stigmasterol);
+ dbCommand2.Parameters.AddWithValue("@sucrose", recipe.sucrose);
+ dbCommand2.Parameters.AddWithValue("@sugar", recipe.sugar);
+ dbCommand2.Parameters.AddWithValue("@sugaralcohols", recipe.sugaralcohols);
+ dbCommand2.Parameters.AddWithValue("@theobromine", recipe.theobromine);
+ dbCommand2.Parameters.AddWithValue("@thiamin", recipe.thiamin);
+ dbCommand2.Parameters.AddWithValue("@threonine", recipe.threonine);
+ dbCommand2.Parameters.AddWithValue("@totalcarbohydrate", recipe.totalcarbohydrate);
+ dbCommand2.Parameters.AddWithValue("@totalfat", recipe.totalfat);
+ dbCommand2.Parameters.AddWithValue("@transfattyacids", recipe.transfattyacids);
+ dbCommand2.Parameters.AddWithValue("@transmonoenoicfattyacids", recipe.transmonoenoicfattyacids);
+ dbCommand2.Parameters.AddWithValue("@transpolyenoicfattyacids", recipe.transpolyenoicfattyacids);
+ dbCommand2.Parameters.AddWithValue("@tryptophan", recipe.tryptophan);
+ dbCommand2.Parameters.AddWithValue("@tyrosine", recipe.tyrosine);
+ dbCommand2.Parameters.AddWithValue("@valine", recipe.valine);
+ dbCommand2.Parameters.AddWithValue("@vitamina", recipe.vitamina);
+ dbCommand2.Parameters.AddWithValue("@vitaminb12", recipe.vitaminb12);
+ dbCommand2.Parameters.AddWithValue("@vitaminb6", recipe.vitaminb6);
+ dbCommand2.Parameters.AddWithValue("@vitaminc", recipe.vitaminc);
+ dbCommand2.Parameters.AddWithValue("@vitamind", recipe.vitamind);
+ dbCommand2.Parameters.AddWithValue("@vitamine", recipe.vitamine);
+ dbCommand2.Parameters.AddWithValue("@vitamink", recipe.vitamink);
+ dbCommand2.Parameters.AddWithValue("@volume", recipe.volume);
+ dbCommand2.Parameters.AddWithValue("@water", recipe.water);
+ dbCommand2.Parameters.AddWithValue("@webpage", recipe.webpage);
+ dbCommand2.Parameters.AddWithValue("@yield", recipe.yield);
+ dbCommand2.Parameters.AddWithValue("@zinc", recipe.zinc);
+ dbCommand2.Parameters.AddWithValue("@recipeID", recipe.recipeID);
+
+
+ return this.ExecuteNonQuery(dbCommand) + this.ExecuteNonQuery(dbCommand2);
+ }
+ }
+ }
+ ///
+
+
+
+ public Int32 InsertRecipeIngredient(RecipeIngredient recipeIngredient)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO recipeingredient ([recipeIngredientID],[recipeID],[ingredientIndex],[ingredientText],[Heading],[linkType]," +
+ "[ingredientID],[quantityText],[unitText],[measureID],[measureQuantity],[linkQuality])" +
+ " VALUES (@recipeIngredientID,@recipeID,@ingredientIndex,@ingredientText,@Heading,@linkType,@ingredientID,@quantityText,@unitText,@measureID,@measureQuantity,@linkQuality)"))
+ {
+
+ dbCommand.Parameters.AddWithValue("@recipeIngredientID", recipeIngredient.recipeIngredientID);
+ dbCommand.Parameters.AddWithValue("@recipeID", recipeIngredient.recipeID);
+ dbCommand.Parameters.AddWithValue("@ingredientIndex", recipeIngredient.ingredientIndex);
+ dbCommand.Parameters.AddWithValue("@ingredientText", recipeIngredient.ingredientText);
+
+ if (recipeIngredient.isHeading)
+ {
+ dbCommand.Parameters.AddWithValue("@Heading", "Y");
+ }
+ else
+ {
+ dbCommand.Parameters.AddWithValue("@Heading", "N");
+ }
+
+ dbCommand.Parameters.AddWithValue("@linkType", recipeIngredient.linkTypeAsString);
+
+ if (recipeIngredient is RecipeIngredientItem)
+ {
+ var recipeIngredientItem = (RecipeIngredientItem)recipeIngredient;
+ dbCommand.Parameters.AddWithValue("@ingredientID", recipeIngredientItem.ingredientID ?? (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@quantityText", recipeIngredientItem.quantityText);
+ dbCommand.Parameters.AddWithValue("@unitText", recipeIngredientItem.unitText);
+ dbCommand.Parameters.AddWithValue("@measureID", recipeIngredientItem.measureID ?? (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@measureQuantity", recipeIngredientItem.measureQuantity);
+ dbCommand.Parameters.AddWithValue("@linkQuality", recipeIngredientItem.linkQuality);
+ }
+ else
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientID", (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@quantityText", String.Empty);
+ dbCommand.Parameters.AddWithValue("@unitText", String.Empty);
+ dbCommand.Parameters.AddWithValue("@measureID", (object)DBNull.Value);
+ dbCommand.Parameters.AddWithValue("@measureQuantity", 0F);
+ dbCommand.Parameters.AddWithValue("@linkQuality", 0);
+ }
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 UpdateRecipeIngredient(RecipeIngredient recipeIngredient)
+ {
+ //using (OleDbCommand dbCommand = new OleDbCommand("UPDATE recipeingredient SET [recipeID]=@recipeID,[ingredientIndex]=@ingredientIndex,[ingredientText]=@ingredientText," +
+ // "[Heading]=@Heading,[linkType]=@linkType,[ingredientID]=@ingredientID,[quantityText]=@quantityText,[unitText]=@unitText,[measureID]=@measureID,[measureQuantity]=@measureQuantity," +
+ // "[linkQuality]=@linkQuality WHERE [recipeIngredientID]=@recipeIngredientID"))
+ //{
+ // dbCommand.Parameters.AddWithValue("@recipeID", recipeIngredient.recipeID);
+ // dbCommand.Parameters.AddWithValue("@ingredientIndex", recipeIngredient.ingredientIndex);
+ // dbCommand.Parameters.AddWithValue("@ingredientText", recipeIngredient.ingredientText);
+
+ // if (recipeIngredient.isHeading)
+ // {
+ // dbCommand.Parameters.AddWithValue("@Heading", "Y");
+ // }
+ // else
+ // {
+ // dbCommand.Parameters.AddWithValue("@Heading", "N");
+ // }
+
+ // dbCommand.Parameters.AddWithValue("@linkType", recipeIngredient.linkTypeAsString);
+
+ // if (recipeIngredient is RecipeIngredientItem)
+ // {
+ // var recipeIngredientItem = (RecipeIngredientItem)recipeIngredient;
+ // dbCommand.Parameters.AddWithValue("@ingredientID", recipeIngredientItem.ingredientID ?? (object)DBNull.Value);
+ // dbCommand.Parameters.AddWithValue("@quantityText", recipeIngredientItem.quantityText);
+ // dbCommand.Parameters.AddWithValue("@unitText", recipeIngredientItem.unitText);
+ // dbCommand.Parameters.AddWithValue("@measureID", recipeIngredientItem.measureID ?? (object)DBNull.Value);
+ // dbCommand.Parameters.AddWithValue("@measureQuantity", recipeIngredientItem.measureQuantity);
+ // dbCommand.Parameters.AddWithValue("@linkQuality", recipeIngredientItem.linkQuality);
+ // }
+ // else
+ // {
+ // dbCommand.Parameters.AddWithValue("@ingredientID", (object)DBNull.Value);
+ // dbCommand.Parameters.AddWithValue("@quantityText", String.Empty);
+ // dbCommand.Parameters.AddWithValue("@unitText", String.Empty);
+ // dbCommand.Parameters.AddWithValue("@measureID", (object)DBNull.Value);
+ // dbCommand.Parameters.AddWithValue("@measureQuantity", 0F);
+ // dbCommand.Parameters.AddWithValue("@linkQuality", 0);
+ // }
+
+ // dbCommand.Parameters.AddWithValue("@recipeIngredientID", recipeIngredient.recipeIngredientID);
+
+
+ // return this.ExecuteNonQuery(dbCommand);
+ //}
+
+
+
+
+ using (OleDbCommand dbCommand = new OleDbCommand("DELETE FROM recipeingredient WHERE [recipeIngredientID]=@recipeIngredientID"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeIngredientID", recipeIngredient.recipeIngredientID);
+
+
+ this.ExecuteNonQuery(dbCommand);
+ }
+
+ return InsertRecipeIngredient(recipeIngredient);
+ }
+
+ public Int32 InsertRecipeProcedure(RecipeProcedure recipeProcedure)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO recipeprocedure ([recipeProcedureID],[recipeID],[procedureText],[procedureIndex],[Heading])" +
+ " VALUES (@recipeProcedureID,@recipeID,@procedureText,@procedureIndex,@Heading)"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeProcedureID", recipeProcedure.recipeProcedureID);
+ dbCommand.Parameters.AddWithValue("@recipeID", recipeProcedure.recipeID);
+ dbCommand.Parameters.AddWithValue("@procedureText", recipeProcedure.procedureText);
+ dbCommand.Parameters.AddWithValue("@procedureIndex", recipeProcedure.procedureIndex);
+
+ if (recipeProcedure.isHeading)
+ {
+ dbCommand.Parameters.AddWithValue("@Heading", "Y");
+ }
+ else
+ {
+ dbCommand.Parameters.AddWithValue("@Heading", "N");
+ }
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 UpdateRecipeProcedure(RecipeProcedure recipeProcedure)
+ {
+ ////using (OleDbCommand dbCommand = new OleDbCommand("UPDATE recipeprocedure SET [recipeID]=@recipeID,[procedureText]=@procedureText,[procedureIndex]=@procedureIndex,[Heading]=@Heading" +
+ //// " WHERE [recipeProcedureID]=@recipeProcedureID"))
+ ////{
+ //// dbCommand.Parameters.AddWithValue("@recipeID", recipeProcedure.recipeID);
+ //// dbCommand.Parameters.AddWithValue("@procedureText", recipeProcedure.procedureText);
+ //// dbCommand.Parameters.AddWithValue("@procedureIndex", recipeProcedure.procedureIndex);
+
+ //// if (recipeProcedure.isHeading)
+ //// {
+ //// dbCommand.Parameters.AddWithValue("@Heading", "Y");
+ //// }
+ //// else
+ //// {
+ //// dbCommand.Parameters.AddWithValue("@Heading", "N");
+ //// }
+
+ //// dbCommand.Parameters.AddWithValue("@recipeProcedureID", recipeProcedure.recipeProcedureID);
+
+ //// return this.ExecuteNonQuery(dbCommand);
+ ////}
+
+
+ using (OleDbCommand dbCommand = new OleDbCommand("DELETE FROM recipeprocedure WHERE [recipeProcedureID]=@recipeProcedureID"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeProcedureID", recipeProcedure.recipeProcedureID);
+
+ this.ExecuteNonQuery(dbCommand);
+ }
+
+ return InsertRecipeProcedure(recipeProcedure);
+ }
+
+ public Int32 InsertRecipeTip(RecipeTip recipeTip)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO recipetip ([recipeTipID],[recipeID],[tipText],[tipIndex],[Heading])" +
+ " VALUES (@recipeTipID,@recipeID,@tipText,@tipIndex,@Heading)"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeTipID", recipeTip.recipeTipID);
+ dbCommand.Parameters.AddWithValue("@recipeID", recipeTip.recipeID);
+ dbCommand.Parameters.AddWithValue("@tipText", recipeTip.tipText);
+ dbCommand.Parameters.AddWithValue("@tipIndex", recipeTip.tipIndex);
+
+ if (recipeTip.isHeading)
+ {
+ dbCommand.Parameters.AddWithValue("@Heading", "Y");
+ }
+ else
+ {
+ dbCommand.Parameters.AddWithValue("@Heading", "N");
+ }
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 UpdateRecipeTip(RecipeTip recipeTip)
+ {
+ //using (OleDbCommand dbCommand = new OleDbCommand("UPDATE recipetip SET [recipeID]=@recipeID,[tipText]=@tipText,[tipIndex]=@tipIndex,[Heading]=@Heading" +
+ // " WHERE [recipeTipID]=@recipeTipID"))
+ //{
+ // dbCommand.Parameters.AddWithValue("@recipeID", recipeTip.recipeID);
+ // dbCommand.Parameters.AddWithValue("@tipText", recipeTip.tipText);
+ // dbCommand.Parameters.AddWithValue("@tipIndex", recipeTip.tipIndex);
+
+ // if (recipeTip.isHeading)
+ // {
+ // dbCommand.Parameters.AddWithValue("@Heading", "Y");
+ // }
+ // else
+ // {
+ // dbCommand.Parameters.AddWithValue("@Heading", "N");
+ // }
+
+ // dbCommand.Parameters.AddWithValue("@recipeTipID", recipeTip.recipeTipID);
+
+ // return this.ExecuteNonQuery(dbCommand);
+ //}
+
+
+ using (OleDbCommand dbCommand = new OleDbCommand("DELETE FROM recipetip WHERE [recipeTipID]=@recipeTipID"))
+ {
+ dbCommand.Parameters.AddWithValue("@recipeTipID", recipeTip.recipeTipID);
+
+ this.ExecuteNonQuery(dbCommand);
+ }
+
+ return InsertRecipeTip(recipeTip);
+ }
+
+ public DataSet GetIngredientUsageByID(Guid ingredientUsageID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredientusage where ingredientusageid=@ingredientusageid"))
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientusageid", ingredientUsageID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+
+ }
+
+ public DataSet GetIngredientUsageByNameAndIngredientID(String normalizedIngredientName, Guid ingredientID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredientusage where normalizedingredientname=@normalizedingredientname AND ingredientid=@ingredientID"))
+ {
+ dbCommand.Parameters.AddWithValue("@normalizedingredientname", normalizedIngredientName);
+ dbCommand.Parameters.AddWithValue("@ingredientid", ingredientID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+
+ }
+
+ public DataSet GetIngredientUsageAll()
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredientusage"))
+ {
+ return this.ExecuteDataSet(dbCommand);
+ }
+
+ }
+
+ public Int32 DeleteIngredientUsageAll()
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("DELETE FROM ingredientusage"))
+ {
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public Int32 InsertIngredientUsage(IngredientUsage ingredientUsage)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("INSERT INTO ingredientUsage ([ingredientusageid],[normalizedingredientname],[ingredientID],[usagecount]) VALUES (@ingredientusageID,@normalizedingredientname,@ingredientID,@usagecount)"))
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientusageID", ingredientUsage.ingredientUsageID);
+ dbCommand.Parameters.AddWithValue("@normalizedingredientname", ingredientUsage.normalizedIngredientName);
+ dbCommand.Parameters.AddWithValue("@ingredientID", ingredientUsage.ingredientID);
+ dbCommand.Parameters.AddWithValue("@usagecount", ingredientUsage.usageCount);
+
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+ public Int32 UpdateIngredientUsage(IngredientUsage ingredientUsage)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("DELETE FROM ingredientusage WHERE [ingredientusageID]=@ingredientusageID"))
+ {
+ dbCommand.Parameters.AddWithValue("@ingredientusageID", ingredientUsage.ingredientUsageID);
+
+ this.ExecuteNonQuery(dbCommand);
+ }
+
+ return InsertIngredientUsage(ingredientUsage);
+ }
+
+ public DataSet GetIngredientSkipSearchWordByID(Guid wordID)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredientskipsearchword where wordid=@wordid"))
+ {
+ dbCommand.Parameters.AddWithValue("@wordID", wordID);
+
+ return this.ExecuteDataSet(dbCommand);
+ }
+
+ }
+
+ public DataSet GetAllIngredientSkipSearchWords()
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand("select * from ingredientskipsearchword order by word"))
+ {
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+ public Guid GetNewIDCookbook()
+ {
+ return Guid.NewGuid();
+ }
+
+ public Guid GetNewIDCookbookChapter()
+ {
+ return Guid.NewGuid();
+ }
+
+ public Guid GetNewIDRecipe()
+ {
+ return Guid.NewGuid();
+ }
+
+ public Guid GetNewIDRecipeIngredient()
+ {
+ return Guid.NewGuid();
+ }
+
+ public Guid GetNewIDRecipeProcedure()
+ {
+ return Guid.NewGuid();
+ }
+
+ public Guid GetNewIDRecipeTip()
+ {
+ return Guid.NewGuid();
+ }
+
+ public Guid GetNewIDIngredientUsage()
+ {
+ return Guid.NewGuid();
+ }
+
+
+ public Int32 JRJRUpdateAdhoc(String strCommand)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand(strCommand))
+ {
+ return this.ExecuteNonQuery(dbCommand);
+ }
+ }
+
+ public DataSet JRJRSelectAdhoc(String strCommand)
+ {
+ using (OleDbCommand dbCommand = new OleDbCommand(strCommand))
+ {
+ return this.ExecuteDataSet(dbCommand);
+ }
+ }
+
+}
diff --git a/JRCookbookBusiness/clsDatabaseLayerBase.cs b/JRCookbookBusiness/clsDatabaseLayerBase.cs
new file mode 100644
index 0000000..175c65b
--- /dev/null
+++ b/JRCookbookBusiness/clsDatabaseLayerBase.cs
@@ -0,0 +1,171 @@
+using System;
+using System.Diagnostics;
+using System.Data;
+using System.Data.OleDb;
+using JRCookbookBusiness;
+
+public class clsDatabaseLayerBase : IDisposable
+
+{
+ private OleDbConnection m_dbcnctConnection;
+ private bool disposedValue;
+
+ //public static String DockerHostMachineIpAddress => Dns.GetHostAddresses(new Uri("http://host.docker.internal").Host)[0].ToString();
+
+ protected bool OpenDatabaseConnection()
+ {
+ try
+ {
+ if (m_dbcnctConnection != null)
+ return true;
+ m_dbcnctConnection = new OleDbConnection();
+ // m_dbcnctConnection.ConnectionString = "Persist Security Info=False;Integrated Security=SSPI;database=OrganLit;server=REUSS\SQLEXPRESS;Connect Timeout=30"
+ // m_dbcnctConnection.ConnectionString = "Persist Security Info=False;Integrated Security=False;User ID=OrganLitDBLogin;Password=OrganLitDBL0gin7;database=OrganLit;server=SIRJON\\REUSSSQL;Connect Timeout=30"
+ //m_dbcnctConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=\"" + "C:\\ReussData\\lc50.mdb" + "\"";
+ m_dbcnctConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\ReussData\\lc50.mdb";
+ //m_dbcnctConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data source=" + "C:\\ReussData\\lc50.mdb";
+ //m_dbcnctConnection.ConnectionString = "Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=C:/ReussData/lc50.mdb; Uid = Admin; Pwd =; ";
+ //m_dbcnctConnection.ConnectionString = "Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=C:/ReussData/lc50.mdb;";
+ // m_dbcnctConnection.ConnectionString = "Data Source=tcp:bu7zkus8nd.database.windows.net,1433;Initial Catalog=OrganLitDB;User Id=OrganLitDBUser@bu7zkus8nd;Password=ILamfi0gAdm;";
+ m_dbcnctConnection.Open();
+ return true;
+ }
+ catch (OleDbException e)
+ {
+ m_dbcnctConnection = null;
+ Debug.Print("Error in OpenDatabaseConnection: " + e.Message);
+ //return false;
+ throw;
+ }
+ catch (Exception e)
+ {
+ m_dbcnctConnection = null;
+ Debug.Print("Error in OpenDatabaseConnection: " + e.Message);
+ //return false;
+ throw;
+ }
+ }
+
+ protected bool CloseDatabaseConnection()
+ {
+ try
+ {
+ if (m_dbcnctConnection != null)
+ {
+ m_dbcnctConnection.Close();
+ m_dbcnctConnection.Dispose();
+ m_dbcnctConnection = null;
+ }
+ return true;
+ }
+ catch (OleDbException e)
+ {
+ Debug.Print("Error in CloseDatabaseConnection: " + e.Message);
+ return false;
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Error in CloseDatabaseConnection: " + e.Message);
+ return false;
+ }
+ }
+
+ protected DataSet ExecuteDataSet(OleDbCommand objOleDbCommand)
+ {
+ try
+ {
+ if (OpenDatabaseConnection() == false)
+ throw new ApplicationException("Database not opened");
+ objOleDbCommand.Connection = m_dbcnctConnection;
+ OleDbDataAdapter ldbdaDataAdapter = new OleDbDataAdapter();
+ ldbdaDataAdapter.SelectCommand = objOleDbCommand;
+ DataSet ldbdsDataSet = new DataSet();
+ ldbdaDataAdapter.Fill(ldbdsDataSet);
+
+ return ldbdsDataSet;
+ }
+ catch (OleDbException e)
+ {
+ //Debug.Print("Error in ExecuteDataSet: Procedure=" + e.Procedure + Constants.CRLF + "Error=" + e.Message);
+ Debug.Print("Error in ExecuteDataSet: Error=" + e.Message);
+ //return null/* TODO Change to default(_) if this is not a reference type */;
+ throw;
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Error in ExecuteDataSet: " + e.Message);
+ //return null/* TODO Change to default(_) if this is not a reference type */;
+ throw;
+ }
+ //finally
+ //{
+ // if (m_dbcnctConnection != null)
+ // {
+ // m_dbcnctConnection.Dispose();
+ // m_dbcnctConnection = null;
+ // }
+ //}
+ }
+
+ protected Int32 ExecuteNonQuery(OleDbCommand objOleDbCommand)
+ {
+ // Returns rows affected
+
+ try
+ {
+ if (OpenDatabaseConnection() == false)
+ throw new ApplicationException("Database not opened");
+ objOleDbCommand.Connection = m_dbcnctConnection;
+ Int32 lintRowsAffected = objOleDbCommand.ExecuteNonQuery();
+
+ return lintRowsAffected;
+ }
+ catch (OleDbException e)
+ {
+ //Debug.Print("Error in ExecuteNonQuery: Procedure=" + e.Procedure + Constants.CRLF + "Error=" + e.Message);
+ Debug.Print("Error in ExecuteNonQuery: Error=" + e.Message);
+ //return 0;
+ throw;
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Error in ExecuteNonQuery: " + e.Message);
+ //return 0;
+ throw;
+ }
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!disposedValue)
+ {
+ if (disposing)
+ {
+ // TODO: dispose managed state (managed objects)
+ if (m_dbcnctConnection != null)
+ {
+ m_dbcnctConnection.Dispose();
+ m_dbcnctConnection = null;
+ }
+ }
+
+ // TODO: free unmanaged resources (unmanaged objects) and override finalizer
+ // TODO: set large fields to null
+ disposedValue = true;
+ }
+ }
+
+ // // TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
+ // ~clsDatabaseLayerBase()
+ // {
+ // // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
+ // Dispose(disposing: false);
+ // }
+
+ void IDisposable.Dispose()
+ {
+ // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
+ Dispose(disposing: true);
+ GC.SuppressFinalize(this);
+ }
+}
diff --git a/JRCookbookBusiness/clsDiacriticRemover.cs b/JRCookbookBusiness/clsDiacriticRemover.cs
new file mode 100644
index 0000000..df123c8
--- /dev/null
+++ b/JRCookbookBusiness/clsDiacriticRemover.cs
@@ -0,0 +1,376 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookBusiness
+{
+ public static class clsDiacriticRemover
+ {
+ private static Char[] mc_Convert;
+
+ ///
+ /// This function is ultra fast because it uses a lookup table.
+ /// This function does not depend on Windows functionality. It also works on Linux.
+ /// This function removes all diacritics, accents, etc.
+ /// For example "Crème Brûlée mit Soße" is converted to "Creme Brulee mit Sosse".
+ ///
+ public static String RemoveDiacritics(String s_Text)
+ {
+ StringBuilder i_Out = new StringBuilder(s_Text.Length);
+ foreach (Char c_Char in s_Text)
+ {
+ /* This switch statement is optional!
+ switch (c_Char)
+ {
+ // If you like you can add your own conversions, like here for German.
+ // Otherwise remove this switch and 'ä' will be translated to 'a', etc.
+ case 'ä': i_Out.Append("ae"); continue;
+ case 'ö': i_Out.Append("oe"); continue;
+ case 'ü': i_Out.Append("ue"); continue;
+ case 'Ä': i_Out.Append("Ae"); continue;
+ case 'Ö': i_Out.Append("Oe"); continue;
+ case 'Ü': i_Out.Append("Ue"); continue;
+ case 'ß': i_Out.Append("ss"); continue;
+ } */
+
+ if (c_Char < mc_Convert.Length)
+ i_Out.Append(mc_Convert[c_Char]);
+ else
+ i_Out.Append(c_Char);
+ }
+ return i_Out.ToString();
+ }
+
+ // static constructor
+ // See https://www.compart.com/en/unicode/U+0180
+ static clsDiacriticRemover()
+ {
+ mc_Convert = new Char[0x270];
+
+ // Fill char array with translation of each character to itself
+ for (int i = 0; i < 0x270; i++)
+ {
+ mc_Convert[i] = (Char)i;
+ }
+
+ // Store the replacements for 310 special characters
+ #region Fill mc_Convert
+
+ mc_Convert[0x0C0] = 'A'; // À
+ mc_Convert[0x0C1] = 'A'; // Á
+ mc_Convert[0x0C2] = 'A'; // Â
+ mc_Convert[0x0C3] = 'A'; // Ã
+ mc_Convert[0x0C4] = 'A'; // Ä
+ mc_Convert[0x0C5] = 'A'; // Å
+ mc_Convert[0x0C6] = 'A'; // Æ
+ mc_Convert[0x0C7] = 'C'; // Ç
+ mc_Convert[0x0C8] = 'E'; // È
+ mc_Convert[0x0C9] = 'E'; // É
+ mc_Convert[0x0CA] = 'E'; // Ê
+ mc_Convert[0x0CB] = 'E'; // Ë
+ mc_Convert[0x0CC] = 'I'; // Ì
+ mc_Convert[0x0CD] = 'I'; // Í
+ mc_Convert[0x0CE] = 'I'; // Î
+ mc_Convert[0x0CF] = 'I'; // Ï
+ mc_Convert[0x0D0] = 'D'; // Ð
+ mc_Convert[0x0D1] = 'N'; // Ñ
+ mc_Convert[0x0D2] = 'O'; // Ò
+ mc_Convert[0x0D3] = 'O'; // Ó
+ mc_Convert[0x0D4] = 'O'; // Ô
+ mc_Convert[0x0D5] = 'O'; // Õ
+ mc_Convert[0x0D6] = 'O'; // Ö
+ mc_Convert[0x0D8] = 'O'; // Ø
+ mc_Convert[0x0D9] = 'U'; // Ù
+ mc_Convert[0x0DA] = 'U'; // Ú
+ mc_Convert[0x0DB] = 'U'; // Û
+ mc_Convert[0x0DC] = 'U'; // Ü
+ mc_Convert[0x0DD] = 'Y'; // Ý
+ mc_Convert[0x0DF] = 's'; // ß
+ mc_Convert[0x0E0] = 'a'; // à
+ mc_Convert[0x0E1] = 'a'; // á
+ mc_Convert[0x0E2] = 'a'; // â
+ mc_Convert[0x0E3] = 'a'; // ã
+ mc_Convert[0x0E4] = 'a'; // ä
+ mc_Convert[0x0E5] = 'a'; // å
+ mc_Convert[0x0E6] = 'a'; // æ
+ mc_Convert[0x0E7] = 'c'; // ç
+ mc_Convert[0x0E8] = 'e'; // è
+ mc_Convert[0x0E9] = 'e'; // é
+ mc_Convert[0x0EA] = 'e'; // ê
+ mc_Convert[0x0EB] = 'e'; // ë
+ mc_Convert[0x0EC] = 'i'; // ì
+ mc_Convert[0x0ED] = 'i'; // í
+ mc_Convert[0x0EE] = 'i'; // î
+ mc_Convert[0x0EF] = 'i'; // ï
+ mc_Convert[0x0F1] = 'n'; // ñ
+ mc_Convert[0x0F2] = 'o'; // ò
+ mc_Convert[0x0F3] = 'o'; // ó
+ mc_Convert[0x0F4] = 'o'; // ô
+ mc_Convert[0x0F5] = 'o'; // õ
+ mc_Convert[0x0F6] = 'o'; // ö
+ mc_Convert[0x0F8] = 'o'; // ø
+ mc_Convert[0x0F9] = 'u'; // ù
+ mc_Convert[0x0FA] = 'u'; // ú
+ mc_Convert[0x0FB] = 'u'; // û
+ mc_Convert[0x0FC] = 'u'; // ü
+ mc_Convert[0x0FD] = 'y'; // ý
+ mc_Convert[0x0FF] = 'y'; // ÿ
+ mc_Convert[0x100] = 'A'; // Ā
+ mc_Convert[0x101] = 'a'; // ā
+ mc_Convert[0x102] = 'A'; // Ă
+ mc_Convert[0x103] = 'a'; // ă
+ mc_Convert[0x104] = 'A'; // Ą
+ mc_Convert[0x105] = 'a'; // ą
+ mc_Convert[0x106] = 'C'; // Ć
+ mc_Convert[0x107] = 'c'; // ć
+ mc_Convert[0x108] = 'C'; // Ĉ
+ mc_Convert[0x109] = 'c'; // ĉ
+ mc_Convert[0x10A] = 'C'; // Ċ
+ mc_Convert[0x10B] = 'c'; // ċ
+ mc_Convert[0x10C] = 'C'; // Č
+ mc_Convert[0x10D] = 'c'; // č
+ mc_Convert[0x10E] = 'D'; // Ď
+ mc_Convert[0x10F] = 'd'; // ď
+ mc_Convert[0x110] = 'D'; // Đ
+ mc_Convert[0x111] = 'd'; // đ
+ mc_Convert[0x112] = 'E'; // Ē
+ mc_Convert[0x113] = 'e'; // ē
+ mc_Convert[0x114] = 'E'; // Ĕ
+ mc_Convert[0x115] = 'e'; // ĕ
+ mc_Convert[0x116] = 'E'; // Ė
+ mc_Convert[0x117] = 'e'; // ė
+ mc_Convert[0x118] = 'E'; // Ę
+ mc_Convert[0x119] = 'e'; // ę
+ mc_Convert[0x11A] = 'E'; // Ě
+ mc_Convert[0x11B] = 'e'; // ě
+ mc_Convert[0x11C] = 'G'; // Ĝ
+ mc_Convert[0x11D] = 'g'; // ĝ
+ mc_Convert[0x11E] = 'G'; // Ğ
+ mc_Convert[0x11F] = 'g'; // ğ
+ mc_Convert[0x120] = 'G'; // Ġ
+ mc_Convert[0x121] = 'g'; // ġ
+ mc_Convert[0x122] = 'G'; // Ģ
+ mc_Convert[0x123] = 'g'; // ģ
+ mc_Convert[0x124] = 'H'; // Ĥ
+ mc_Convert[0x125] = 'h'; // ĥ
+ mc_Convert[0x126] = 'H'; // Ħ
+ mc_Convert[0x127] = 'h'; // ħ
+ mc_Convert[0x128] = 'I'; // Ĩ
+ mc_Convert[0x129] = 'i'; // ĩ
+ mc_Convert[0x12A] = 'I'; // Ī
+ mc_Convert[0x12B] = 'i'; // ī
+ mc_Convert[0x12C] = 'I'; // Ĭ
+ mc_Convert[0x12D] = 'i'; // ĭ
+ mc_Convert[0x12E] = 'I'; // Į
+ mc_Convert[0x12F] = 'i'; // į
+ mc_Convert[0x130] = 'I'; // İ
+ mc_Convert[0x131] = 'i'; // ı
+ mc_Convert[0x134] = 'J'; // Ĵ
+ mc_Convert[0x135] = 'j'; // ĵ
+ mc_Convert[0x136] = 'K'; // Ķ
+ mc_Convert[0x137] = 'k'; // ķ
+ mc_Convert[0x138] = 'K'; // ĸ
+ mc_Convert[0x139] = 'L'; // Ĺ
+ mc_Convert[0x13A] = 'l'; // ĺ
+ mc_Convert[0x13B] = 'L'; // Ļ
+ mc_Convert[0x13C] = 'l'; // ļ
+ mc_Convert[0x13D] = 'L'; // Ľ
+ mc_Convert[0x13E] = 'l'; // ľ
+ mc_Convert[0x13F] = 'L'; // Ŀ
+ mc_Convert[0x140] = 'l'; // ŀ
+ mc_Convert[0x141] = 'L'; // Ł
+ mc_Convert[0x142] = 'l'; // ł
+ mc_Convert[0x143] = 'N'; // Ń
+ mc_Convert[0x144] = 'n'; // ń
+ mc_Convert[0x145] = 'N'; // Ņ
+ mc_Convert[0x146] = 'n'; // ņ
+ mc_Convert[0x147] = 'N'; // Ň
+ mc_Convert[0x148] = 'n'; // ň
+ mc_Convert[0x149] = 'n'; // ʼn
+ mc_Convert[0x14C] = 'O'; // Ō
+ mc_Convert[0x14D] = 'o'; // ō
+ mc_Convert[0x14E] = 'O'; // Ŏ
+ mc_Convert[0x14F] = 'o'; // ŏ
+ mc_Convert[0x150] = 'O'; // Ő
+ mc_Convert[0x151] = 'o'; // ő
+ mc_Convert[0x152] = 'O'; // Œ
+ mc_Convert[0x153] = 'o'; // œ
+ mc_Convert[0x154] = 'R'; // Ŕ
+ mc_Convert[0x155] = 'r'; // ŕ
+ mc_Convert[0x156] = 'R'; // Ŗ
+ mc_Convert[0x157] = 'r'; // ŗ
+ mc_Convert[0x158] = 'R'; // Ř
+ mc_Convert[0x159] = 'r'; // ř
+ mc_Convert[0x15A] = 'S'; // Ś
+ mc_Convert[0x15B] = 's'; // ś
+ mc_Convert[0x15C] = 'S'; // Ŝ
+ mc_Convert[0x15D] = 's'; // ŝ
+ mc_Convert[0x15E] = 'S'; // Ş
+ mc_Convert[0x15F] = 's'; // ş
+ mc_Convert[0x160] = 'S'; // Š
+ mc_Convert[0x161] = 's'; // š
+ mc_Convert[0x162] = 'T'; // Ţ
+ mc_Convert[0x163] = 't'; // ţ
+ mc_Convert[0x164] = 'T'; // Ť
+ mc_Convert[0x165] = 't'; // ť
+ mc_Convert[0x166] = 'T'; // Ŧ
+ mc_Convert[0x167] = 't'; // ŧ
+ mc_Convert[0x168] = 'U'; // Ũ
+ mc_Convert[0x169] = 'u'; // ũ
+ mc_Convert[0x16A] = 'U'; // Ū
+ mc_Convert[0x16B] = 'u'; // ū
+ mc_Convert[0x16C] = 'U'; // Ŭ
+ mc_Convert[0x16D] = 'u'; // ŭ
+ mc_Convert[0x16E] = 'U'; // Ů
+ mc_Convert[0x16F] = 'u'; // ů
+ mc_Convert[0x170] = 'U'; // Ű
+ mc_Convert[0x171] = 'u'; // ű
+ mc_Convert[0x172] = 'U'; // Ų
+ mc_Convert[0x173] = 'u'; // ų
+ mc_Convert[0x174] = 'W'; // Ŵ
+ mc_Convert[0x175] = 'w'; // ŵ
+ mc_Convert[0x176] = 'Y'; // Ŷ
+ mc_Convert[0x177] = 'y'; // ŷ
+ mc_Convert[0x178] = 'Y'; // Ÿ
+ mc_Convert[0x179] = 'Z'; // Ź
+ mc_Convert[0x17A] = 'z'; // ź
+ mc_Convert[0x17B] = 'Z'; // Ż
+ mc_Convert[0x17C] = 'z'; // ż
+ mc_Convert[0x17D] = 'Z'; // Ž
+ mc_Convert[0x17E] = 'z'; // ž
+ mc_Convert[0x180] = 'b'; // ƀ
+ mc_Convert[0x189] = 'D'; // Ɖ
+ mc_Convert[0x191] = 'F'; // Ƒ
+ mc_Convert[0x192] = 'f'; // ƒ
+ mc_Convert[0x193] = 'G'; // Ɠ
+ mc_Convert[0x197] = 'I'; // Ɨ
+ mc_Convert[0x198] = 'K'; // Ƙ
+ mc_Convert[0x199] = 'k'; // ƙ
+ mc_Convert[0x19A] = 'l'; // ƚ
+ mc_Convert[0x19F] = 'O'; // Ɵ
+ mc_Convert[0x1A0] = 'O'; // Ơ
+ mc_Convert[0x1A1] = 'o'; // ơ
+ mc_Convert[0x1AB] = 't'; // ƫ
+ mc_Convert[0x1AC] = 'T'; // Ƭ
+ mc_Convert[0x1AD] = 't'; // ƭ
+ mc_Convert[0x1AE] = 'T'; // Ʈ
+ mc_Convert[0x1AF] = 'U'; // Ư
+ mc_Convert[0x1B0] = 'u'; // ư
+ mc_Convert[0x1B6] = 'z'; // ƶ
+ mc_Convert[0x1CD] = 'A'; // Ǎ
+ mc_Convert[0x1CE] = 'a'; // ǎ
+ mc_Convert[0x1CF] = 'I'; // Ǐ
+ mc_Convert[0x1D0] = 'i'; // ǐ
+ mc_Convert[0x1D1] = 'O'; // Ǒ
+ mc_Convert[0x1D2] = 'o'; // ǒ
+ mc_Convert[0x1D3] = 'U'; // Ǔ
+ mc_Convert[0x1D4] = 'u'; // ǔ
+ mc_Convert[0x1D5] = 'U'; // Ǖ
+ mc_Convert[0x1D6] = 'u'; // ǖ
+ mc_Convert[0x1D7] = 'U'; // Ǘ
+ mc_Convert[0x1D8] = 'u'; // ǘ
+ mc_Convert[0x1D9] = 'U'; // Ǚ
+ mc_Convert[0x1DA] = 'u'; // ǚ
+ mc_Convert[0x1DB] = 'U'; // Ǜ
+ mc_Convert[0x1DC] = 'u'; // ǜ
+ mc_Convert[0x1DE] = 'A'; // Ǟ
+ mc_Convert[0x1DF] = 'a'; // ǟ
+ mc_Convert[0x1E0] = 'A'; // Ǡ
+ mc_Convert[0x1E1] = 'a'; // ǡ
+ mc_Convert[0x1E2] = 'A'; // Ǣ
+ mc_Convert[0x1E3] = 'a'; // ǣ
+ mc_Convert[0x1E4] = 'G'; // Ǥ
+ mc_Convert[0x1E5] = 'g'; // ǥ
+ mc_Convert[0x1E6] = 'G'; // Ǧ
+ mc_Convert[0x1E7] = 'g'; // ǧ
+ mc_Convert[0x1E8] = 'K'; // Ǩ
+ mc_Convert[0x1E9] = 'k'; // ǩ
+ mc_Convert[0x1EA] = 'O'; // Ǫ
+ mc_Convert[0x1EB] = 'o'; // ǫ
+ mc_Convert[0x1EC] = 'O'; // Ǭ
+ mc_Convert[0x1ED] = 'o'; // ǭ
+ mc_Convert[0x1F0] = 'j'; // ǰ
+ mc_Convert[0x1F4] = 'G'; // Ǵ
+ mc_Convert[0x1F5] = 'g'; // ǵ
+ mc_Convert[0x1F8] = 'N'; // Ǹ
+ mc_Convert[0x1F9] = 'n'; // ǹ
+ mc_Convert[0x1FA] = 'A'; // Ǻ
+ mc_Convert[0x1FB] = 'a'; // ǻ
+ mc_Convert[0x1FC] = 'A'; // Ǽ
+ mc_Convert[0x1FD] = 'a'; // ǽ
+ mc_Convert[0x1FE] = 'O'; // Ǿ
+ mc_Convert[0x1FF] = 'o'; // ǿ
+ mc_Convert[0x200] = 'A'; // Ȁ
+ mc_Convert[0x201] = 'a'; // ȁ
+ mc_Convert[0x202] = 'A'; // Ȃ
+ mc_Convert[0x203] = 'A'; // ȃ
+ mc_Convert[0x204] = 'E'; // Ȅ
+ mc_Convert[0x205] = 'e'; // ȅ
+ mc_Convert[0x206] = 'E'; // Ȇ
+ mc_Convert[0x207] = 'e'; // ȇ
+ mc_Convert[0x208] = 'I'; // Ȉ
+ mc_Convert[0x209] = 'i'; // ȉ
+ mc_Convert[0x20A] = 'I'; // Ȋ
+ mc_Convert[0x20B] = 'i'; // ȋ
+ mc_Convert[0x20C] = 'O'; // Ȍ
+ mc_Convert[0x20D] = 'o'; // ȍ
+ mc_Convert[0x20E] = 'O'; // Ȏ
+ mc_Convert[0x20F] = 'o'; // ȏ
+ mc_Convert[0x210] = 'R'; // Ȑ
+ mc_Convert[0x211] = 'r'; // ȑ
+ mc_Convert[0x212] = 'R'; // Ȓ
+ mc_Convert[0x213] = 'r'; // ȓ
+ mc_Convert[0x214] = 'U'; // Ȕ
+ mc_Convert[0x215] = 'u'; // ȕ
+ mc_Convert[0x216] = 'U'; // Ȗ
+ mc_Convert[0x217] = 'u'; // ȗ
+ mc_Convert[0x218] = 'S'; // Ș
+ mc_Convert[0x219] = 's'; // ș
+ mc_Convert[0x21A] = 'T'; // Ț
+ mc_Convert[0x21B] = 't'; // ț
+ mc_Convert[0x21E] = 'H'; // Ȟ
+ mc_Convert[0x21F] = 'h'; // ȟ
+ mc_Convert[0x224] = 'Z'; // Ȥ
+ mc_Convert[0x225] = 'z'; // ȥ
+ mc_Convert[0x226] = 'A'; // Ȧ
+ mc_Convert[0x227] = 'a'; // ȧ
+ mc_Convert[0x228] = 'E'; // Ȩ
+ mc_Convert[0x229] = 'e'; // ȩ
+ mc_Convert[0x22A] = 'O'; // Ȫ
+ mc_Convert[0x22B] = 'o'; // ȫ
+ mc_Convert[0x22C] = 'O'; // Ȭ
+ mc_Convert[0x22D] = 'o'; // ȭ
+ mc_Convert[0x22E] = 'O'; // Ȯ
+ mc_Convert[0x22F] = 'o'; // ȯ
+ mc_Convert[0x230] = 'O'; // Ȱ
+ mc_Convert[0x231] = 'o'; // ȱ
+ mc_Convert[0x232] = 'Y'; // Ȳ
+ mc_Convert[0x233] = 'y'; // ȳ
+ mc_Convert[0x234] = 'l'; // ȴ
+ mc_Convert[0x235] = 'n'; // ȵ
+ mc_Convert[0x23A] = 'A'; // Ⱥ
+ mc_Convert[0x23B] = 'C'; // Ȼ
+ mc_Convert[0x23C] = 'c'; // ȼ
+ mc_Convert[0x23D] = 'L'; // Ƚ
+ mc_Convert[0x23E] = 'T'; // Ⱦ
+ mc_Convert[0x23F] = 's'; // ȿ
+ mc_Convert[0x240] = 'z'; // ɀ
+ mc_Convert[0x243] = 'B'; // Ƀ
+ mc_Convert[0x244] = 'U'; // Ʉ
+ mc_Convert[0x246] = 'E'; // Ɇ
+ mc_Convert[0x247] = 'e'; // ɇ
+ mc_Convert[0x248] = 'J'; // Ɉ
+ mc_Convert[0x249] = 'j'; // ɉ
+ mc_Convert[0x24C] = 'R'; // Ɍ
+ mc_Convert[0x24D] = 'r'; // ɍ
+ mc_Convert[0x24E] = 'Y'; // Ɏ
+ mc_Convert[0x24F] = 'y'; // ɏ
+ mc_Convert[0x261] = 'g'; // ɡ
+
+ #endregion
+ }
+ }
+
+}
diff --git a/JRCookbookBusiness/clsWord.cs b/JRCookbookBusiness/clsWord.cs
new file mode 100644
index 0000000..6bb303a
--- /dev/null
+++ b/JRCookbookBusiness/clsWord.cs
@@ -0,0 +1,128 @@
+using Microsoft.Office.Interop.Word;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using static System.Net.Mime.MediaTypeNames;
+using System.Windows.Media.Animation;
+
+namespace JRCookbookBusiness
+{
+ internal static class clsWord
+ {
+ private static Microsoft.Office.Interop.Word.Application mobjWord;
+ private static bool mblnWordRunning = false;
+
+ internal const int WORD_CHAPTER_NAME_FONT_SIZE = 18;
+ internal const int WORD_RECIPE_NAME_FONT_SIZE = 18;
+ internal const int WORD_RECIPE_SECTION_HEADING_FONT_SIZE = 14;
+ internal const int WORD_NORMAL_FONT_SIZE = 10;
+ internal const int WORD_NUTRITION_FONT_SIZE = 8;
+
+ internal static Microsoft.Office.Interop.Word.Application WordApplication { get { return mobjWord; } }
+
+ internal static void AddHalfSpaceLineAtEndOfDocument()
+ {
+ mobjWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
+ mobjWord.Selection.TypeParagraph();
+ mobjWord.Selection.MoveUp(Microsoft.Office.Interop.Word.WdUnits.wdLine, 1);
+ mobjWord.Selection.ParagraphFormat.LineSpacingRule = WdLineSpacing.wdLineSpaceSingle;
+ mobjWord.Selection.ParagraphFormat.LineSpacing = 4F;
+ mobjWord.Selection.ParagraphFormat.SpaceAfter = 0F;
+ mobjWord.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory);
+ }
+
+ internal static void Insert_HeaderText(String headerText)
+ {
+ if (mobjWord.ActiveWindow.View.SplitSpecial != WdSpecialPane.wdPaneNone)
+ {
+ mobjWord.ActiveWindow.Panes[2].Close();
+ }
+
+ if (mobjWord.ActiveWindow.ActivePane.View.Type == WdViewType.wdNormalView || mobjWord.ActiveWindow.ActivePane.View.Type == WdViewType.wdOutlineView)
+ {
+ mobjWord.ActiveWindow.ActivePane.View.Type = WdViewType.wdPrintView;
+ }
+
+ mobjWord.Selection.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].LinkToPrevious = false;
+
+ mobjWord.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageHeader;
+ mobjWord.Selection.WholeStory();
+ mobjWord.Selection.Delete(Microsoft.Office.Interop.Word.WdUnits.wdCharacter, 1);
+
+ mobjWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
+
+ mobjWord.Selection.TypeText(headerText);
+
+ mobjWord.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekMainDocument;
+
+ }
+
+ internal static void Insert_PageNumberFooter(ref bool isFirstPageOfContent)
+ {
+ if (mobjWord.ActiveWindow.View.SplitSpecial != WdSpecialPane.wdPaneNone)
+ {
+ mobjWord.ActiveWindow.Panes[2].Close();
+ }
+
+ if (mobjWord.ActiveWindow.ActivePane.View.Type == WdViewType.wdNormalView || mobjWord.ActiveWindow.ActivePane.View.Type == WdViewType.wdOutlineView)
+ {
+ mobjWord.ActiveWindow.ActivePane.View.Type = WdViewType.wdPrintView;
+ }
+
+ mobjWord.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageFooter;
+
+ mobjWord.Selection.WholeStory();
+ mobjWord.Selection.Delete(Microsoft.Office.Interop.Word.WdUnits.wdCharacter, 1);
+
+ if (isFirstPageOfContent)
+ {
+ mobjWord.Selection.HeaderFooter.PageNumbers.RestartNumberingAtSection = true;
+ mobjWord.Selection.HeaderFooter.PageNumbers.StartingNumber = 1;
+
+ isFirstPageOfContent = false;
+ }
+ else
+ {
+ mobjWord.Selection.HeaderFooter.PageNumbers.RestartNumberingAtSection = false;
+ }
+
+ mobjWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
+
+ mobjWord.Selection.TypeText("Page ");
+ mobjWord.Selection.Fields.Add(mobjWord.Selection.Range, Microsoft.Office.Interop.Word.WdFieldType.wdFieldEmpty, "PAGE \\* Arabic ", 1);
+
+ mobjWord.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekMainDocument;
+
+ }
+
+
+ internal static void ResetWord()
+ {
+ if (mblnWordRunning)
+ {
+ ShutDownWord();
+ }
+
+ mobjWord = new Microsoft.Office.Interop.Word.Application();
+ mobjWord.Visible = false;
+ //mobjWord.Activate();
+ //mobjWord.WindowState = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateMinimize;
+
+ mblnWordRunning= true;
+ }
+
+ internal static void ShutDownWord()
+ {
+ if (mblnWordRunning)
+ {
+ mobjWord.Quit();
+ mobjWord = null;
+ mblnWordRunning = false;
+ }
+ }
+
+ }
+}
diff --git a/JRCookbookControls/Bar0.bmp b/JRCookbookControls/Bar0.bmp
new file mode 100644
index 0000000..a89f74f
Binary files /dev/null and b/JRCookbookControls/Bar0.bmp differ
diff --git a/JRCookbookControls/Bar1.bmp b/JRCookbookControls/Bar1.bmp
new file mode 100644
index 0000000..325a7ad
Binary files /dev/null and b/JRCookbookControls/Bar1.bmp differ
diff --git a/JRCookbookControls/Bar2.bmp b/JRCookbookControls/Bar2.bmp
new file mode 100644
index 0000000..81c57d3
Binary files /dev/null and b/JRCookbookControls/Bar2.bmp differ
diff --git a/JRCookbookControls/Bar3.bmp b/JRCookbookControls/Bar3.bmp
new file mode 100644
index 0000000..bbec9ea
Binary files /dev/null and b/JRCookbookControls/Bar3.bmp differ
diff --git a/JRCookbookControls/Bar4.bmp b/JRCookbookControls/Bar4.bmp
new file mode 100644
index 0000000..c5373fa
Binary files /dev/null and b/JRCookbookControls/Bar4.bmp differ
diff --git a/JRCookbookControls/Delete.bmp b/JRCookbookControls/Delete.bmp
new file mode 100644
index 0000000..8efa906
Binary files /dev/null and b/JRCookbookControls/Delete.bmp differ
diff --git a/JRCookbookControls/Handle.bmp b/JRCookbookControls/Handle.bmp
new file mode 100644
index 0000000..4ca03c6
Binary files /dev/null and b/JRCookbookControls/Handle.bmp differ
diff --git a/JRCookbookControls/Heading.bmp b/JRCookbookControls/Heading.bmp
new file mode 100644
index 0000000..13fc480
Binary files /dev/null and b/JRCookbookControls/Heading.bmp differ
diff --git a/JRCookbookControls/JRCookbookAutoVerticalGrowTextBox.cs b/JRCookbookControls/JRCookbookAutoVerticalGrowTextBox.cs
new file mode 100644
index 0000000..785a038
--- /dev/null
+++ b/JRCookbookControls/JRCookbookAutoVerticalGrowTextBox.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.ComponentModel;
+
+namespace JRCookbookControls
+{
+ [System.Serializable()]
+ public class JRCookbookAutoVerticalGrowTextBox : TextBox
+ {
+ private int _MinCharactersToMultiLine = 0;
+
+ public JRCookbookAutoVerticalGrowTextBox()
+ {
+ this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
+
+ this.TextChanged += JRCookbookAutoVerticalGrowTextBox_TextChanged;
+ this.MultilineChanged += JRCookbookAutoVerticalGrowTextBox_MultilineChanged;
+ this.Resize += JRCookbookAutoVerticalGrowTextBox_Resize;
+
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public int MinCharactersToMultiLine
+ {
+ get
+ {
+ return _MinCharactersToMultiLine;
+ }
+ set
+ {
+ _MinCharactersToMultiLine = value;
+ this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
+ }
+ }
+
+
+
+
+ private void JRCookbookAutoVerticalGrowTextBox_Resize(object sender, EventArgs e)
+ {
+ RecalculateTextBoxHeight();
+ }
+
+ private void JRCookbookAutoVerticalGrowTextBox_TextChanged(System.Object sender, System.EventArgs e)
+ {
+ this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
+ RecalculateTextBoxHeight();
+ }
+
+ private void JRCookbookAutoVerticalGrowTextBox_MultilineChanged(System.Object sender, System.EventArgs e)
+ {
+ //while we can't hide the multiline property, we can at least enforce its value.
+ this.Multiline = (this.Text.Length >= _MinCharactersToMultiLine);
+ }
+
+ private void RecalculateTextBoxHeight()
+ {
+ // amount of padding to add
+ const int padding = 3;
+ // get number of lines (first line is 0, so add 1)
+ int numLines = this.GetLineFromCharIndex(this.TextLength) + 1;
+ // get border thickness
+ int border = this.Height - this.ClientSize.Height;
+ // set height (height of one line * number of lines + spacing)
+ this.Height = this.Font.Height * numLines + padding + border;
+ }
+
+ }
+}
diff --git a/JRCookbookControls/JRCookbookControls.csproj b/JRCookbookControls/JRCookbookControls.csproj
new file mode 100644
index 0000000..bce0139
--- /dev/null
+++ b/JRCookbookControls/JRCookbookControls.csproj
@@ -0,0 +1,38 @@
+
+
+
+ net10.0-windows7.0
+ true
+ true
+ JRCookbookStrongNameKey.snk
+ false
+ x86
+ x86
+
+
+
+
+
+
+
+
+ UserControl
+
+
+ UserControl
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
diff --git a/JRCookbookControls/JRCookbookControlsEnums.cs b/JRCookbookControls/JRCookbookControlsEnums.cs
new file mode 100644
index 0000000..faf8359
--- /dev/null
+++ b/JRCookbookControls/JRCookbookControlsEnums.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookControls
+{
+ public enum InsertLocation
+ {
+ InsertNone,
+ InsertBefore,
+ InsertAfter
+ }
+
+}
diff --git a/JRCookbookControls/JRCookbookEditProcedure.Designer.cs b/JRCookbookControls/JRCookbookEditProcedure.Designer.cs
new file mode 100644
index 0000000..9fded4b
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditProcedure.Designer.cs
@@ -0,0 +1,100 @@
+
+namespace JRCookbookControls
+{
+ partial class JRCookbookEditProcedure
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ components = new System.ComponentModel.Container();
+ txtProcedureText = new JRCookbookAutoVerticalGrowTextBox();
+ btnHeading = new System.Windows.Forms.Button();
+ btnDelete = new System.Windows.Forms.Button();
+ toolTip1 = new System.Windows.Forms.ToolTip(components);
+ SuspendLayout();
+ //
+ // txtProcedureText
+ //
+ txtProcedureText.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
+ txtProcedureText.Location = new System.Drawing.Point(110, 3);
+ txtProcedureText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ txtProcedureText.MinCharactersToMultiLine = 0;
+ txtProcedureText.Multiline = true;
+ txtProcedureText.Name = "txtProcedureText";
+ txtProcedureText.Size = new System.Drawing.Size(1476, 47);
+ txtProcedureText.TabIndex = 0;
+ txtProcedureText.TextChanged += txtProcedureText_TextChanged;
+ //
+ // btnHeading
+ //
+ btnHeading.ImageKey = "(none)";
+ btnHeading.Location = new System.Drawing.Point(43, 3);
+ btnHeading.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ btnHeading.Name = "btnHeading";
+ btnHeading.Size = new System.Drawing.Size(56, 63);
+ btnHeading.TabIndex = 2;
+ toolTip1.SetToolTip(btnHeading, "Toggle Header");
+ btnHeading.UseVisualStyleBackColor = true;
+ btnHeading.Click += btnHeading_Click;
+ //
+ // btnDelete
+ //
+ btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
+ btnDelete.ImageKey = "(none)";
+ btnDelete.Location = new System.Drawing.Point(1591, 3);
+ btnDelete.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ btnDelete.Name = "btnDelete";
+ btnDelete.Size = new System.Drawing.Size(56, 63);
+ btnDelete.TabIndex = 1;
+ toolTip1.SetToolTip(btnDelete, "Delete");
+ btnDelete.UseVisualStyleBackColor = true;
+ btnDelete.Visible = false;
+ btnDelete.Click += btnDelete_Click;
+ //
+ // JRCookbookEditProcedure
+ //
+ AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
+ AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ AutoSize = true;
+ BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
+ Controls.Add(txtProcedureText);
+ Controls.Add(btnHeading);
+ Controls.Add(btnDelete);
+ Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ Name = "JRCookbookEditProcedure";
+ Size = new System.Drawing.Size(1647, 134);
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private JRCookbookAutoVerticalGrowTextBox txtProcedureText;
+ private System.Windows.Forms.Button btnHeading;
+ private System.Windows.Forms.Button btnDelete;
+ private System.Windows.Forms.ToolTip toolTip1;
+ }
+}
diff --git a/JRCookbookControls/JRCookbookEditProcedure.cs b/JRCookbookControls/JRCookbookEditProcedure.cs
new file mode 100644
index 0000000..cdcc030
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditProcedure.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using JRCookbookBusiness;
+
+namespace JRCookbookControls
+{
+ public partial class JRCookbookEditProcedure : UserControl
+ {
+ private RecipeProcedure _recipeProcedure;
+ private bool _DeleteAllowed = true;
+ private bool _IsEmptyValue = true;
+ public event EventHandler DeleteRequested;
+ public event EventHandler IsEmpty_Changed;
+
+ private static ImageList _allButtonImagesList = new ImageList();
+ private static ImageList _allHandleImagesList = new ImageList();
+ private static bool _ImagesAlreadyLoaded = false;
+
+ private static Point _HandleLocationPoint = new Point(0, 0);
+ private static bool _isHandleLocationSet = false;
+
+ private const string HEADING_IMAGE = "Heading.bmp";
+ private const string NOT_HEADING_IMAGE = "NotHeading.bmp";
+ private const string DELETE_IMAGE = "Delete.bmp";
+ private const string HANDLE_IMAGE = "Handle.bmp";
+
+ public JRCookbookEditProcedure()
+ {
+ InitializeComponent();
+ LoadImages();
+ }
+
+ public JRCookbookEditProcedure(RecipeProcedure procedureToEdit)
+ {
+ InitializeComponent();
+ LoadImages();
+ recipeProcedure = procedureToEdit;
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public RecipeProcedure recipeProcedure
+ {
+ get
+ {
+ return _recipeProcedure;
+ }
+ set
+ {
+ _recipeProcedure = value;
+ LoadControlFromObject();
+ }
+ }
+
+ public bool IsEmpty
+ {
+ get
+ {
+ return _IsEmptyValue;
+ }
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public bool DeleteAllowed
+ {
+ get
+ {
+ return _DeleteAllowed;
+ }
+ set
+ {
+ _DeleteAllowed = value;
+ btnDelete.Enabled = _DeleteAllowed;
+ }
+ }
+
+ private void btnDelete_Click(object sender, EventArgs e)
+ {
+ if (this.DeleteRequested != null)
+ this.DeleteRequested(this, new EventArgs());
+ }
+
+ private void LoadControlFromObject()
+ {
+ if (_recipeProcedure == null)
+ {
+ txtProcedureText.Text = string.Empty;
+ txtProcedureText.Font = new Font(txtProcedureText.Font, FontStyle.Regular);
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ }
+ else
+ {
+ txtProcedureText.Text = _recipeProcedure.procedureText;
+ if (_recipeProcedure.isHeading)
+ {
+ txtProcedureText.Font = new Font(txtProcedureText.Font, FontStyle.Bold);
+ btnHeading.ImageKey = HEADING_IMAGE;
+ }
+ else
+ {
+ txtProcedureText.Font = new Font(txtProcedureText.Font, FontStyle.Regular);
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ }
+ }
+ }
+
+ private void btnHeading_Click(object sender, EventArgs e)
+ {
+ if (_recipeProcedure != null)
+ {
+ _recipeProcedure.isHeading = !_recipeProcedure.isHeading;
+ }
+ LoadControlFromObject();
+ }
+
+ private void txtProcedureText_TextChanged(object sender, EventArgs e)
+ {
+ _recipeProcedure.procedureText = txtProcedureText.Text;
+ CheckForData();
+ }
+
+ private void CheckForData()
+ {
+ var blnNewIsEmpty = true;
+
+ if (txtProcedureText.Text.Trim() != String.Empty)
+ {
+ blnNewIsEmpty = false;
+ }
+
+ if (_recipeProcedure.isHeading)
+ {
+ btnHeading.ImageKey = HEADING_IMAGE;
+ }
+ else
+ {
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ }
+
+ if (blnNewIsEmpty != _IsEmptyValue)
+ {
+ _IsEmptyValue = blnNewIsEmpty;
+
+ if (blnNewIsEmpty)
+ {
+ btnDelete.Visible = false;
+ }
+ else
+ {
+ btnDelete.Visible = true;
+ }
+
+ if (this.IsEmpty_Changed != null)
+ this.IsEmpty_Changed(this, new EventArgs());
+ }
+ }
+
+ public void ShowInsertionBar(JRCookbookControls.InsertLocation insertLocation)
+ {
+ modSharedRoutines.ShowInsertionBar(this, insertLocation);
+ }
+
+ public void HideInsertionBar()
+ {
+ modSharedRoutines.HideInsertionBar(this);
+ }
+
+ public void DragStarted()
+ {
+ modSharedRoutines.DragStarted(this);
+ }
+
+ public void DragEnded()
+ {
+ modSharedRoutines.DragEnded(this);
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ // If there is an image and it has a location,
+ // paint it when the Form is repainted.
+ base.OnPaint(e);
+
+ Image myBackgroundImage = _allHandleImagesList.Images[HANDLE_IMAGE];
+
+ if (!_isHandleLocationSet)
+ {
+ _isHandleLocationSet = true;
+
+ int verticalMidpointImage = myBackgroundImage.Height / 2;
+ int verticalMidpointButton = btnHeading.Height / 2;
+ int newTop = verticalMidpointButton - verticalMidpointImage + btnHeading.Top;
+
+ _HandleLocationPoint = new Point(0, newTop);
+ }
+
+
+ e.Graphics.DrawImage(myBackgroundImage, _HandleLocationPoint.X, _HandleLocationPoint.Y, new Rectangle(0, 0, myBackgroundImage.Width, myBackgroundImage.Height), GraphicsUnit.Pixel);
+
+ }
+
+ private void LoadImages()
+ {
+ if (!_ImagesAlreadyLoaded)
+ {
+ _allButtonImagesList = new ImageList();
+ _allButtonImagesList.ImageSize = btnDelete.ClientSize;
+ _allButtonImagesList.Images.Clear();
+ _allButtonImagesList.Images.Add(Properties.Resources.Delete);
+ _allButtonImagesList.Images.Add(Properties.Resources.Heading);
+ _allButtonImagesList.Images.Add(Properties.Resources.NotHeading);
+ _allButtonImagesList.Images.SetKeyName(0, DELETE_IMAGE);
+ _allButtonImagesList.Images.SetKeyName(1, HEADING_IMAGE);
+ _allButtonImagesList.Images.SetKeyName(2, NOT_HEADING_IMAGE);
+
+ _allHandleImagesList = new ImageList();
+
+ double handleWidthToHeightRatio = (double)(Properties.Resources.Handle.Width) / (double)(Properties.Resources.Handle.Height);
+ int handleWidth = (int)((double)(btnHeading.Left) * 0.75);
+ int handleHeight = (int)((double)(handleWidth) / handleWidthToHeightRatio);
+ _allHandleImagesList.ImageSize = new Size(handleWidth, handleHeight);
+ _allHandleImagesList.Images.Clear();
+ _allHandleImagesList.Images.Add(Properties.Resources.Handle);
+ _allHandleImagesList.Images.SetKeyName(0, HANDLE_IMAGE);
+
+ _ImagesAlreadyLoaded = true;
+ }
+
+ this.btnDelete.ImageList = _allButtonImagesList;
+ this.btnDelete.ImageKey = DELETE_IMAGE;
+ this.btnHeading.ImageList = _allButtonImagesList;
+ this.btnHeading.ImageKey = NOT_HEADING_IMAGE;
+
+
+ }
+
+ }
+}
diff --git a/JRCookbookControls/JRCookbookEditProcedure.resx b/JRCookbookControls/JRCookbookEditProcedure.resx
new file mode 100644
index 0000000..b3502c9
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditProcedure.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 118, 17
+
+
\ No newline at end of file
diff --git a/JRCookbookControls/JRCookbookEditRecipeIngredient.Designer.cs b/JRCookbookControls/JRCookbookEditRecipeIngredient.Designer.cs
new file mode 100644
index 0000000..347b3e5
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditRecipeIngredient.Designer.cs
@@ -0,0 +1,151 @@
+
+namespace JRCookbookControls
+{
+ partial class JRCookbookEditRecipeIngredient
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ components = new System.ComponentModel.Container();
+ txtIngredientText = new JRCookbookAutoVerticalGrowTextBox();
+ btnHeading = new System.Windows.Forms.Button();
+ btnDelete = new System.Windows.Forms.Button();
+ btnIngredientLink = new System.Windows.Forms.Button();
+ txtUnitText = new JRCookbookAutoVerticalGrowTextBox();
+ txtQuantityText = new JRCookbookAutoVerticalGrowTextBox();
+ toolTip1 = new System.Windows.Forms.ToolTip(components);
+ SuspendLayout();
+ //
+ // txtIngredientText
+ //
+ txtIngredientText.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
+ txtIngredientText.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
+ txtIngredientText.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
+ txtIngredientText.Location = new System.Drawing.Point(487, 8);
+ txtIngredientText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ txtIngredientText.MinCharactersToMultiLine = 60;
+ txtIngredientText.Name = "txtIngredientText";
+ txtIngredientText.PlaceholderText = "Ingredient";
+ txtIngredientText.Size = new System.Drawing.Size(1025, 47);
+ txtIngredientText.TabIndex = 2;
+ txtIngredientText.TextChanged += txtIngredientText_TextChanged;
+ //
+ // btnHeading
+ //
+ btnHeading.ImageKey = "(none)";
+ btnHeading.Location = new System.Drawing.Point(43, 0);
+ btnHeading.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ btnHeading.Name = "btnHeading";
+ btnHeading.Size = new System.Drawing.Size(56, 63);
+ btnHeading.TabIndex = 5;
+ toolTip1.SetToolTip(btnHeading, "Toggle Header");
+ btnHeading.UseVisualStyleBackColor = true;
+ btnHeading.Click += btnHeading_Click;
+ //
+ // btnDelete
+ //
+ btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
+ btnDelete.ImageKey = "(none)";
+ btnDelete.Location = new System.Drawing.Point(1593, 3);
+ btnDelete.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ btnDelete.Name = "btnDelete";
+ btnDelete.Size = new System.Drawing.Size(56, 63);
+ btnDelete.TabIndex = 4;
+ toolTip1.SetToolTip(btnDelete, "Delete");
+ btnDelete.UseVisualStyleBackColor = true;
+ btnDelete.Visible = false;
+ btnDelete.Click += btnDelete_Click;
+ //
+ // btnIngredientLink
+ //
+ btnIngredientLink.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
+ btnIngredientLink.ImageKey = "(none)";
+ btnIngredientLink.Location = new System.Drawing.Point(1535, 3);
+ btnIngredientLink.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ btnIngredientLink.Name = "btnIngredientLink";
+ btnIngredientLink.Size = new System.Drawing.Size(56, 63);
+ btnIngredientLink.TabIndex = 3;
+ toolTip1.SetToolTip(btnIngredientLink, "Link Ingredient");
+ btnIngredientLink.UseVisualStyleBackColor = true;
+ btnIngredientLink.Visible = false;
+ btnIngredientLink.Click += btnIngredientLink_Click;
+ //
+ // txtUnitText
+ //
+ txtUnitText.AutoCompleteCustomSource.AddRange(new string[] { "10 oz", "11-oz", "15-oz", "8-ounce", "8-oz", "can", "can (11 oz)", "can (15 oz)", "can (6 oz)", "cans", "cup", "cups", "dash", "dashes", "gallon", "gallons", "lb", "lbs", "ounces", "oz", "pinch", "pinches", "pint", "pints", "quart", "quarts", "recipe", "slices", "small", "Tbs", "Tbsp", "teaspoon", "tsp" });
+ txtUnitText.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
+ txtUnitText.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
+ txtUnitText.Location = new System.Drawing.Point(278, 8);
+ txtUnitText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ txtUnitText.MinCharactersToMultiLine = 8;
+ txtUnitText.Name = "txtUnitText";
+ txtUnitText.PlaceholderText = "Unit";
+ txtUnitText.Size = new System.Drawing.Size(198, 47);
+ txtUnitText.TabIndex = 1;
+ txtUnitText.TextChanged += txtUnitText_TextChanged;
+ //
+ // txtQuantityText
+ //
+ txtQuantityText.Location = new System.Drawing.Point(116, 8);
+ txtQuantityText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ txtQuantityText.MinCharactersToMultiLine = 0;
+ txtQuantityText.Multiline = true;
+ txtQuantityText.Name = "txtQuantityText";
+ txtQuantityText.PlaceholderText = "Qty";
+ txtQuantityText.Size = new System.Drawing.Size(150, 47);
+ txtQuantityText.TabIndex = 0;
+ txtQuantityText.TextChanged += txtQuantityText_TextChanged;
+ //
+ // JRCookbookEditRecipeIngredient
+ //
+ AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
+ AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ AutoSize = true;
+ BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
+ Controls.Add(btnDelete);
+ Controls.Add(btnHeading);
+ Controls.Add(btnIngredientLink);
+ Controls.Add(txtIngredientText);
+ Controls.Add(txtUnitText);
+ Controls.Add(txtQuantityText);
+ Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ Name = "JRCookbookEditRecipeIngredient";
+ Size = new System.Drawing.Size(1647, 134);
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private JRCookbookAutoVerticalGrowTextBox txtIngredientText;
+ private System.Windows.Forms.Button btnHeading;
+ private System.Windows.Forms.Button btnDelete;
+ private System.Windows.Forms.Button btnIngredientLink;
+ private JRCookbookControls.JRCookbookAutoVerticalGrowTextBox txtUnitText;
+ private JRCookbookAutoVerticalGrowTextBox txtQuantityText;
+ private System.Windows.Forms.ToolTip toolTip1;
+ }
+}
diff --git a/JRCookbookControls/JRCookbookEditRecipeIngredient.cs b/JRCookbookControls/JRCookbookEditRecipeIngredient.cs
new file mode 100644
index 0000000..58102de
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditRecipeIngredient.cs
@@ -0,0 +1,2698 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using JRCookbookBusiness;
+
+namespace JRCookbookControls
+{
+ public partial class JRCookbookEditRecipeIngredient : UserControl
+ {
+ private RecipeIngredient _recipeIngredient;
+ private bool _DeleteAllowed = true;
+ private bool _IsEmptyValue = true;
+
+ private static ImageList _allButtonImagesList = new ImageList();
+ private static ImageList _allHandleImagesList = new ImageList();
+ private static bool _ImagesAlreadyLoaded = false;
+
+ private static Point _HandleLocationPoint = new Point(0, 0);
+ private static bool _isHandleLocationSet = false;
+
+ public event EventHandler DeleteRequested;
+ public event EventHandler IsEmpty_Changed;
+ public event EventHandler IngredientLinkRequested;
+
+ private const string INGREDIENT_LINK_IMAGE_BAR0 = "Bar0.bmp";
+ private const string INGREDIENT_LINK_IMAGE_BAR1 = "Bar1.bmp";
+ private const string INGREDIENT_LINK_IMAGE_BAR2 = "Bar2.bmp";
+ private const string INGREDIENT_LINK_IMAGE_BAR3 = "Bar3.bmp";
+ private const string INGREDIENT_LINK_IMAGE_BAR4 = "Bar4.bmp";
+ private const string NOT_HEADING_IMAGE = "NotHeading.bmp";
+ private const string HEADING_IMAGE = "Heading.bmp";
+ private const string DELETE_IMAGE = "Delete.bmp";
+ private const string HANDLE_IMAGE = "Handle.bmp";
+
+ public JRCookbookEditRecipeIngredient()
+ {
+ InitializeComponent();
+ LoadImages();
+ LoadControlAutoComplete();
+ CheckForData();
+ }
+
+ public JRCookbookEditRecipeIngredient(RecipeIngredient IngredientToEdit)
+ {
+ InitializeComponent();
+ LoadImages();
+ LoadControlAutoComplete();
+ recipeIngredient = IngredientToEdit;
+ CheckForData();
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public RecipeIngredient recipeIngredient
+ {
+ get
+ {
+ return _recipeIngredient;
+ }
+ set
+ {
+ _recipeIngredient = value;
+ LoadControlFromObject();
+ }
+ }
+
+ public bool IsEmpty
+ {
+ get
+ {
+ return _IsEmptyValue;
+ }
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public bool DeleteAllowed
+ {
+ get
+ {
+ return _DeleteAllowed;
+ }
+ set
+ {
+ _DeleteAllowed = value;
+ //btnDelete.Visible = _DeleteAllowed;
+ }
+ }
+
+ private void btnIngredientLink_Click(object sender, EventArgs e)
+ {
+ if (this.IngredientLinkRequested != null)
+ this.IngredientLinkRequested(this, new EventArgs());
+
+ this.LoadControlFromObject();
+ }
+
+ private void btnDelete_Click(object sender, EventArgs e)
+ {
+ if (this.DeleteRequested != null)
+ this.DeleteRequested(this, new EventArgs());
+ }
+
+ private void LoadControlFromObject()
+ {
+ if (_recipeIngredient == null)
+ {
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ txtQuantityText.Text = string.Empty;
+ txtUnitText.Text = string.Empty;
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR0;
+ txtIngredientText.Text = string.Empty;
+ txtIngredientText.Font = new Font(txtIngredientText.Font, FontStyle.Regular);
+ }
+ else
+ {
+ txtIngredientText.Text = _recipeIngredient.ingredientText;
+
+ if (_recipeIngredient.isHeading)
+ {
+ btnHeading.ImageKey = HEADING_IMAGE;
+ txtQuantityText.Text = string.Empty;
+ txtQuantityText.Visible = false;
+ txtUnitText.Text = string.Empty;
+ txtUnitText.Visible = false;
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR0;
+ btnIngredientLink.Visible = false;
+
+ txtIngredientText.Font = new Font(txtIngredientText.Font, FontStyle.Bold);
+ }
+ else
+ {
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ var recipeIngredientItem = (RecipeIngredientItem)_recipeIngredient;
+ txtQuantityText.Text = recipeIngredientItem.quantityText;
+ txtQuantityText.Visible = true;
+ txtUnitText.Text = recipeIngredientItem.unitText;
+ txtUnitText.Visible = true;
+
+ txtIngredientText.Font = new Font(txtIngredientText.Font, FontStyle.Regular);
+
+ btnIngredientLink.Visible = true;
+
+ if (recipeIngredientItem.ingredientID == null)
+ {
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR0;
+
+ }
+ else
+ {
+ switch (recipeIngredientItem.linkQuality)
+ {
+ case 0:
+ case 1:
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR1;
+ break;
+ case 2:
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR2;
+ break;
+ case 3:
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR3;
+ break;
+ case 4:
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR4;
+ break;
+ default:
+ btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR0;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ private void btnHeading_Click(object sender, EventArgs e)
+ {
+ if (_recipeIngredient != null)
+ {
+ if (_recipeIngredient.isHeading)
+ {
+ _recipeIngredient = _recipeIngredient.ConvertToItem();
+ }
+ else
+ {
+ _recipeIngredient = _recipeIngredient.ConvertToHeading();
+ }
+ }
+ LoadControlFromObject();
+ }
+
+ private void txtQuantityText_TextChanged(object sender, EventArgs e)
+ {
+ if (_recipeIngredient is RecipeIngredientItem)
+ {
+ ((RecipeIngredientItem)_recipeIngredient).quantityText = txtQuantityText.Text;
+ }
+ CheckForData();
+ }
+
+ private void txtUnitText_TextChanged(object sender, EventArgs e)
+ {
+ if (_recipeIngredient is RecipeIngredientItem)
+ {
+ ((RecipeIngredientItem)_recipeIngredient).unitText = txtUnitText.Text;
+ }
+ CheckForData();
+ }
+
+ private void txtIngredientText_TextChanged(object sender, EventArgs e)
+ {
+ _recipeIngredient.ingredientText = txtIngredientText.Text;
+ CheckForData();
+ }
+
+ private void CheckForData()
+ {
+ var blnNewIsEmpty = true;
+
+ if (txtQuantityText.Text.Trim() != String.Empty)
+ {
+ blnNewIsEmpty = false;
+ }
+
+ if (blnNewIsEmpty && txtUnitText.Text.Trim() != String.Empty)
+ {
+ blnNewIsEmpty = false;
+ }
+
+ if (blnNewIsEmpty && txtIngredientText.Text.Trim() != String.Empty)
+ {
+ blnNewIsEmpty = false;
+ }
+
+ if (_recipeIngredient.isHeading)
+ {
+ btnHeading.ImageKey = HEADING_IMAGE;
+ }
+ else
+ {
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ }
+
+ if (blnNewIsEmpty != _IsEmptyValue)
+ {
+ _IsEmptyValue = blnNewIsEmpty;
+
+ if (blnNewIsEmpty)
+ {
+ btnIngredientLink.Visible = false;
+ btnDelete.Visible = false;
+ }
+ else
+ {
+ btnDelete.Visible = true;
+ btnIngredientLink.Visible = !_recipeIngredient.isHeading;
+ }
+
+ if (this.IsEmpty_Changed != null)
+ this.IsEmpty_Changed(this, new EventArgs());
+ }
+ }
+
+ public void ShowInsertionBar(JRCookbookControls.InsertLocation insertLocation)
+ {
+ modSharedRoutines.ShowInsertionBar(this, insertLocation);
+ }
+
+ public void HideInsertionBar()
+ {
+ modSharedRoutines.HideInsertionBar(this);
+ }
+
+ public void DragStarted()
+ {
+ modSharedRoutines.DragStarted(this);
+ }
+
+ public void DragEnded()
+ {
+ modSharedRoutines.DragEnded(this);
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ // If there is an image and it has a location,
+ // paint it when the Form is repainted.
+ base.OnPaint(e);
+
+ Image myBackgroundImage = _allHandleImagesList.Images[HANDLE_IMAGE];
+
+ if (!_isHandleLocationSet)
+ {
+ _isHandleLocationSet = true;
+
+ int verticalMidpointImage = myBackgroundImage.Height / 2;
+ int verticalMidpointButton = btnHeading.Height / 2;
+ int newTop = verticalMidpointButton - verticalMidpointImage + btnHeading.Top;
+
+ _HandleLocationPoint = new Point(0, newTop);
+ }
+
+
+ e.Graphics.DrawImage(myBackgroundImage, _HandleLocationPoint.X, _HandleLocationPoint.Y, new Rectangle(0, 0, myBackgroundImage.Width, myBackgroundImage.Height), GraphicsUnit.Pixel);
+
+ }
+
+
+ private void LoadControlAutoComplete()
+ {
+ var ingredientAutoComplete = new AutoCompleteStringCollection();
+ ingredientAutoComplete.AddRange(new string[]
+ {
+ "1% lowfat milk",
+"1% milk",
+"100% berry juice",
+"100% bran cereal",
+"acorn squash",
+"active dry yeast",
+"alfalfa sprouts",
+"all purpose flour",
+"all purpose white flour",
+"all purpose-flour",
+"all-purpose baking mix",
+"all-purpose flour",
+"all-purpose flour, plus more for pan",
+"allspice",
+"almond extract",
+"almond or vegetable oil",
+"Ancho Chile, seeded and finely chopped",
+"Ancho powder",
+"anchovies, rinsed and patted dry",
+"angel hair pasta",
+"Angel Hair, uncooked",
+"Angostura bitters",
+"animal cracker cookies",
+"apple brandy",
+"apple butter",
+"apple cider",
+"apple cider vinegar",
+"apple juice",
+"Apple Layer",
+"apple pie spice",
+"apple, chopped",
+"apple, cored and chopped",
+"apple, peeled, cored and chopped",
+"apple, sliced paper-thin",
+"apples, peeled, cored and diced",
+"apples, peeled, sliced",
+"applesauce",
+"apricot jam",
+"apricot nectar",
+"apricot preserves",
+"Asian chili sauce",
+"asparagus spears, drained",
+"asparagus spears, large",
+"asparagus, cut diagonally into 2-inch lengths",
+"asparagus, cut in 1-inch pieces",
+"asparagus, trimmed and cut into 1-inch pieces",
+"assorted colors of paste food coloring",
+"Assorted fresh vegetables or chips",
+"assorted fruit, cut into small pieces",
+"Assorted fruits for dipping such as sliced apples and pears and strawberries",
+"Assorted sprinkles",
+"assorted vegetables, thinly sliced",
+"avocados, seeded, peeled and mashed",
+"baby carrot, peeled and julienned",
+"baby carrots",
+"baby yellow squash",
+"baby zucchini",
+"bacon",
+"bacon, chopped",
+"bacon, diced",
+"baking cocoa",
+"baking potatoes",
+"baking powder",
+"baking soda",
+"balsamic vinegar",
+"bamboo skewers",
+"banana",
+"banana, peeled and sliced",
+"bananas, sliced",
+"barbecue sauce",
+"barbeque sauce",
+"barley",
+"Basic Barbecue Sauce",
+"Basic Barbecue Sauce recipe follows",
+"Basic Tomato Sauce (see recipe below)",
+"basil",
+"basil leaves",
+"basil sprigs",
+"basil, chopped",
+"bay leaf",
+"bay leaf, broken",
+"bay leaves",
+"bay scallops or medium shrimp, peeled and deveined",
+"BBQ sauce",
+"bean sprouts",
+"beaten egg",
+"Bechemel sauce, hot",
+"beef bouillon cube",
+"beef bouillon cubes",
+"beef boullion cubes",
+"beef broth",
+"Beef Broth or Water",
+"beef round steak, 1/3-inch thick",
+"beef stew meat",
+"beef stock",
+"beef strips, sliced",
+"beef tips, cut into bite-size pieces",
+"beef-flavor instant bouillon",
+"beer",
+"bell pepper, chopped",
+"biscuit mix",
+"black olives",
+"black olives, sliced",
+"black pepper",
+"black pepper freshly ground",
+"black pepper freshly ground, to taste",
+"black pepper linguini cooked",
+"black pepper to taste",
+"blackberries, washed",
+"blanched slivered almonds, toasted",
+"blanched, sliced almonds",
+"bleu cheese",
+"blood orange juice or regular orange juice",
+"Blue corn chips",
+"blueberries",
+"Blueberry Orange Sauce",
+"blush wine",
+"boiling water",
+"boned and skinned chicken breasts",
+"boneless and skinless chicken breasts, cooked and cooled",
+"boneless beef round steak, cut into thin strips",
+"boneless chicken breast halves, cooked & cooled",
+"boneless pork tenderloin",
+"boneless rump roast",
+"boneless skinless chicken breast halves",
+"boneless skinless chicken breasts",
+"boneless skinless chicken breasts, halved",
+"boneless, skinless chicken breast halves",
+"boneless, skinless chicken breast halves, cubed",
+"boneless, skinless chicken breast halves, cut into strips",
+"boneless, skinless chicken breast, cut crosswise into 1/2-inch pieces",
+"boneless, skinless chicken breast, cut into 1 1/2-inch pieces",
+"boneless, skinless chicken breast, cut into 1/2-inch cubes",
+"boneless, skinless chicken breast, cut into 1-inch pieces",
+"boneless, skinless chicken breast, cut into bite-size pieces",
+"boneless, skinless chicken breast, cut into strips",
+"boneless, skinless chicken breast, trimmed of fat and cut into bite-size, thin strips",
+"boneless, skinless chicken breasts",
+"boneless, skinless chicken breasts, cut into 1/2-inch cubes",
+"boneless, skinless chicken breasts, cut into 1-inch cubes (about 3/4 cup)",
+"boneless, skinless chicken breasts, cut into julienne strips (1 1/2 x 1/4-inch)",
+"boneless, skinless chicken breasts, cut into small cubes",
+"boneless, skinless chicken breasts, diced",
+"bourbon",
+"bourbon or whiskey",
+"bourbon, rum, or orange juice",
+"bow tie pasta",
+"Bow Tie pasta, uncooked",
+"Bow Ties, Elbow Macaroni or other medium pasta shape, uncooked",
+"Bow Ties, Mostaccioli or other medium pasta shape, uncooked",
+"Bow Ties, Radiatore or other medium pasta shape, uncooked",
+"Bow Ties, Rigatoni or other medium pasta shape, uncooked",
+"Bow Ties, Wagon Wheels or other medium pasta shape, uncooked",
+"bow-tie pasta cooked according to package directions and drained",
+"bran",
+"bran flake cereal",
+"bran flakes",
+"brandy",
+"Bread",
+"bread crumbs",
+"bread flour",
+"breadcrumbs",
+"brisket or blade pot roast",
+"broccoli",
+"broccoli florets",
+"broccoli florets, cut into small pieces",
+"broccoli flowerettes",
+"broccoli, florets",
+"broiler-fryer chicken wings",
+"broken tortilla chips",
+"broken whole grain Melba toast",
+"Brown gravy",
+"brown sugar",
+"brown sugar substitute",
+"brown sugar, packed",
+"bulb garlic, unpeeled",
+"bulbs fennel, untrimmed",
+"bunch cilantro, leaves only chopped",
+"bunch green onion, whites and some greens, chopped",
+"bunch green onions, chopped",
+"bunch green onions, cut into 1-inch lengths, separate whites from tops",
+"bunch scallions, chopped",
+"bunch scallions, finely chopped",
+"bunch scallions, finely sliced",
+"bunch scallions, sliced",
+"bunch scallions, trimmed",
+"bunch scallions, trimmed and thinly sliced (green and white parts)",
+"bunches arugula, cleaned and torn into bite-sized pieces",
+"bunches scallions or spring onions, chopped",
+"bunches scallions, sliced",
+"bunches watercress, coarsely chopped",
+"Burgundy wine",
+"butter",
+"butter cut into small pieces",
+"butter melted",
+"butter or margarine",
+"butter or margarine melted",
+"butter or margarine, cut into pieces",
+"butter or margarine, melted",
+"butter or margarine, softened",
+"butter or margarine, softened or melted",
+"Butter, Margarine or Oil",
+"butter, melted",
+"butter, softened",
+"Butter/margarine",
+"Butter-flavored cooking spray, as needed",
+"butter-flavored vegetable cooking spray",
+"Butter-flavored, non-stick cooking spray",
+"Buttermilk",
+"buttermilk (or nonfat yogurt, if desired)",
+"buttermilk baking mix",
+"buttermilk baking mix, or more",
+"buttermilk or milk",
+"buttermilk or sour milk",
+"buttermilk, dairy sour cream, plain yogurt, or milk",
+"button mushrooms",
+"button mushrooms sliced thin",
+"Cabernet Sauvignon",
+"Cajun spice",
+"Cake",
+"cake flour",
+"cake flour (not self-rising)",
+"Calamata olives, sliced",
+"canned bouillon, soup stock or vegetable stock",
+"Canned consomme",
+"canned corn, drained",
+"canned diced green chiles",
+"canned diced tomatoes with juices",
+"canned fried onion rings crushed",
+"canned green beans, drained",
+"canned green chilies chopped",
+"canned Italian plum tomatoes, crushed",
+"canned low-sodium chicken broth",
+"canned mild jalapeno chile chopped",
+"canned or frozen tart cherries",
+"canned pumpkin",
+"canned sliced mushrooms drained well",
+"canned solid-pack pumpkin",
+"canned vegetable or low-sodium chicken broth",
+"canned white beans (cannellini), rinsed and drained",
+"canola oil",
+"canola oil (or other low saturated fat oil)",
+"canola oil or other vegetable oil",
+"capers",
+"capers drained",
+"caramel candies, cut small pieces",
+"caramel ice cream topping",
+"caraway seeds",
+"caraway seeds, lemon pepper, grated Parmesan cheese",
+"carbonated water",
+"cardamom",
+"caribbean jerk seasoning",
+"carrot, finely chopped",
+"carrot, shredded",
+"carrot, sliced",
+"Carrot; in chunks",
+"carrots peeled and diced",
+"carrots peeled and thinly sliced",
+"Carrots sliced into 1/4-inch rounds",
+"carrots, cut into 1-inch lengths",
+"carrots, diagonally sliced",
+"carrots, diced",
+"carrots, grated 1 can (8 oz.)",
+"carrots, julienned",
+"carrots, peeled and chopped",
+"carrots, peeled and cut into 1/2 inch slices",
+"Carrots, peeled and diced",
+"carrots, peeled and quartered",
+"carrots, peeled and thinly sliced",
+"carrots, peeled, sliced",
+"carrots, scraped and cut into 1/4-inch rounds",
+"carrots, scraped and sliced diagonally into 3/4-inch thick ovals",
+"carrots, scrubbed and sliced",
+"carrots, sliced",
+"carrots, sliced into 1/4-inch rounds",
+"carrots, thinly sliced",
+"carrots, thinly sliced diagonally",
+"catfish fillets",
+"catsup",
+"cauliflower florets",
+"cauliflower flowerettes",
+"cayenne",
+"cayenne pepper",
+"Cayenne pepper to taste",
+"cayenne pepper, or to taste",
+"celery chopped",
+"celery cut into 1/4-inch cubes",
+"celery finely chopped",
+"celery salt",
+"celery seed",
+"celery seeds",
+"celery stalk diced",
+"celery stalk, finely diced",
+"celery stalks, chopped",
+"celery stalks, finely diced",
+"Celery stalks, for garnish",
+"celery sticks",
+"celery, chopped",
+"celery, cut on the diagonal",
+"celery, diced",
+"Celery, sliced",
+"celery, trimmed and sliced",
+"Cheddar cheese grated",
+"cheddar cheese shredded",
+"cheddar cheese, grated",
+"cheese soup",
+"cherries, pitted, coarsely chopped, and drained",
+"cherry juice blend",
+"cherry juice blend, chilled",
+"cherry pie filling",
+"cherry preserves",
+"cherry tomatoes",
+"cherry tomatoes halved",
+"cherry tomatoes, cut in half",
+"cherry tomatoes, halved",
+"cherry tomatoes, quartered",
+"cherry tomatoes, rinsed and quartered",
+"chestnuts",
+"chicken",
+"chicken bouillon cube",
+"chicken bouillon cubes",
+"chicken bouillon granules",
+"chicken bouillon powder",
+"Chicken bouillon; instant",
+"chicken breast, diced 3/4-inch",
+"chicken breast, shredded",
+"chicken breasts",
+"Chicken breasts- boned; cut",
+"chicken breasts, bone-in",
+"chicken broth",
+"chicken broth or water",
+"chicken broth, homemade or canned",
+"chicken broth, skimmed of fat",
+"chicken drumsticks, skin-on or skinless",
+"chicken or vegetable bouillon cube",
+"chicken stock",
+"chicken stock or broth",
+"chicken stock or canned chicken broth",
+"chicken, cut in parts",
+"Chicken, cut into serving pieces",
+"chili pepper",
+"chili powder",
+"chili sauce",
+"chilies in adobo sauce",
+"chilled club soda",
+"chilled Honey-Mustard Chicken with Fettuccine",
+"Chinese parsley, chopped",
+"chives",
+"chocolate chips",
+"Chocolate Ganache",
+"chocolate or multicolored candy sprinkles",
+"Chocolate shavings",
+"chocolate syrup",
+"chopped almonds",
+"chopped basil or parsley",
+"chopped broccoli, blanched and drained",
+"chopped Canadian-style bacon or chopped, cooked turkey bacon",
+"chopped candied ginger",
+"chopped capers",
+"chopped carrot",
+"chopped carrots",
+"chopped celery",
+"chopped chives",
+"chopped chives or scallions",
+"chopped chutney",
+"Chopped cilantro",
+"chopped cooked chicken",
+"chopped cooked chicken meat",
+"chopped cooked turkey",
+"chopped crystallized ginger",
+"chopped dates",
+"chopped dried apples or raisins",
+"chopped dried apricots",
+"chopped dried fruit such as apricots, raisins, apples, or pears",
+"chopped dried tart cherries",
+"chopped extra-lean ham",
+"chopped fresh basil",
+"chopped fresh chives",
+"chopped fresh cilantro",
+"chopped fresh cilantro sprigs",
+"chopped fresh dill",
+"chopped fresh kale, stems removed",
+"chopped fresh marjoram",
+"chopped fresh mint",
+"chopped fresh mint or parsley",
+"chopped fresh parsley",
+"chopped fresh parsley leaves",
+"chopped fresh rosemary",
+"chopped fresh sage",
+"chopped fresh spinach",
+"chopped fresh thyme",
+"chopped fresh tomato",
+"chopped golden raisins",
+"chopped green bell papper",
+"chopped green bell pepper",
+"chopped green bell peppers",
+"chopped green olives",
+"chopped green onion tops",
+"chopped green onions",
+"chopped green or sweet red pepper",
+"chopped green pepper",
+"chopped green pepper, ribs and seeds removed",
+"chopped green sweet pepper",
+"chopped Italian or curly parsley",
+"chopped Italian parsley",
+"chopped jalapeno peppers, or to taste",
+"Chopped jalapeños",
+"chopped macadamia nuts or walnuts",
+"chopped mushrooms",
+"chopped nuts",
+"chopped nuts, if desired",
+"chopped onion",
+"chopped onions",
+"chopped parsley",
+"Chopped parsley for garnish",
+"chopped peanuts",
+"chopped pecans",
+"chopped pecans, lightly toasted",
+"chopped pecans, toasted",
+"chopped peeled onion",
+"chopped pimiento",
+"chopped pitted dates",
+"chopped pitted kalamata olives",
+"chopped pitted prunes",
+"chopped red bell pepper",
+"chopped red bell peppers",
+"chopped red onion",
+"chopped reduced-fat ham or Canadian bacon",
+"chopped rehydrated sun-dried tomatoes",
+"chopped ripe black olives",
+"chopped roasted red bell pepper, drained",
+"chopped scallions",
+"chopped seeded jalapeno chilies",
+"chopped sliced dried beef or fully cooked ham",
+"chopped sun-dried tomatoes",
+"chopped sweet onion",
+"chopped toasted nuts",
+"chopped toasted pecans",
+"chopped tomatoes",
+"chopped turkey ham",
+"chopped walnuts",
+"chopped walnuts toasted",
+"chopped walnuts, toasted",
+"chopped watermelon, seeds removed or seedless",
+"chopped yellow bell pepper",
+"chopped yellow onion",
+"chopped zucchini",
+"chopped, cooked chicken",
+"chunky salsa",
+"chutney",
+"Chutney Dressing",
+"cider vinegar",
+"cilantro",
+"Cilantro Pesto",
+"Cilantro sprigs",
+"cilantro sprigs for garnish",
+"cilantro, chopped",
+"cinnamon",
+"cinnamon stick",
+"cinnamon stick, broken into several pieces",
+"cinnamon sticks",
+"cinnamon sugar",
+"cinnamon-sugar",
+"Citrus Pecan Sauce",
+"clam juice",
+"Clarified butter",
+"Clove garlic crushed",
+"clove garlic minced",
+"clove garlic, chopped",
+"clove garlic, crushed",
+"clove garlic, finely chopped",
+"clove garlic, finely minced",
+"clove garlic, minced",
+"clove garlic, peeled",
+"clove garlic, peeled and chopped",
+"clove garlic, peeled and finely chopped",
+"clove garlic, pressed",
+"clove garlic, thinly sliced",
+"clove minced garlic",
+"cloves",
+"Cloves fresh garlic minced",
+"cloves garlic",
+"Cloves garlic freshly chopped",
+"cloves garlic freshly minced",
+"Cloves garlic minced",
+"Cloves garlic peeled and crushed",
+"cloves garlic, chopped",
+"cloves garlic, crushed",
+"cloves garlic, finely chopped",
+"cloves garlic, halved",
+"cloves garlic, minced",
+"cloves garlic, peeled",
+"cloves garlic, peeled and coarsely chopped",
+"cloves garlic, peeled and finely chopped",
+"cloves garlic, sliced very thinly",
+"Cloves minced garlic",
+"club soda",
+"coarse grain Dijon mustard",
+"coarse salt",
+"coarsely chopped cashews",
+"coarsely chopped dried tart cherries",
+"coarsely chopped fresh mint",
+"coarsely chopped green bell pepper",
+"coarsely chopped nuts",
+"coarsely chopped onion",
+"coarsely chopped pecans",
+"coarsely chopped plum tomatoes",
+"coarsely chopped roasted peanuts",
+"coarsely chopped walnuts",
+"coarsely crushed purchased apple chips",
+"coarsely ground black pepper",
+"coarsely ground black pepper to taste",
+"coarsely ground pepper",
+"coarsely shredded apple",
+"coarsely shredded carrot",
+"coarsely-chopped almonds",
+"coarsely-chopped cilantro",
+"coarsely-chopped sweet onion",
+"coarsley ground pepper",
+"cocoa",
+"cocoa powder",
+"coconut",
+"coconut milk",
+"coffee liqueur",
+"cold milk",
+"cold water",
+"collard greens, chopped and rinsed",
+"commercial barbecue sauce",
+"confectioners sugar",
+"confectioner's sugar",
+"confectioners' sugar",
+"cooked asparagus cut into small pieces",
+"cooked black beans",
+"cooked boneless, skinless chicken breast, julienned",
+"cooked broccoli florets",
+"cooked brown rice",
+"cooked capellini pasta",
+"cooked chicken breast, cut into chunks (about 1/2 pound)",
+"cooked diced chicken",
+"Cooked ham; dice",
+"cooked potatoes",
+"cooked rice",
+"cooked shrimp, coarsely chopped or",
+"cooked smoked sausage links, cut into 3/4-inch pieces",
+"cooked spaghetti, hot",
+"cooked turkey breast cut into 1x2x1-inch cubes",
+"cooked turkey chopped",
+"cooked turkey cut in 1/2 inch cubes",
+"cooked turkey cut into 1/2 inch cubes",
+"cooked turkey cut into 1/2-inch cubes",
+"cooked turkey diced",
+"cooked turkey ham, diced into 1/4-inch cubes",
+"cooked turkey, chopped",
+"cooked turkey, cut into strips",
+"cooked turkey, shredded",
+"cooked white rice, held warm",
+"cooked wild rice or long grain rice",
+"cooked, crumbled bacon",
+"cooked, peeled medium shrimp",
+"cooked, skinless, boneless chicken breast, shredded",
+"cooking oil",
+"cooking sherry",
+"Cooking spray",
+"Cooking spray, as needed",
+"coriander",
+"corn chips",
+"corn flakes",
+"corn muffins",
+"corn oil",
+"corn oil for frying",
+"corn oil, plus",
+"corn tortillas",
+"cornbread crumbled",
+"cornflake cereal",
+"Cornish game hens, split",
+"Cornish Hens",
+"Cornmeal",
+"cornstarch",
+"cornstarch dissolved in 2 tablespoons water",
+"Cornstarch for dusting",
+"cornstarch or arrowroot powder",
+"cottage cheese",
+"country-style turkey sausage, casing removed, broken into pieces",
+"crab meat",
+"crab meat, drained",
+"cracked black pepper",
+"cracked or crushed ice cubes",
+"cracked pepper",
+"Cracked peppercorns, to taste",
+"cranberries",
+"cranberries, whole",
+"cranberry liqueur or port wine",
+"cream",
+"cream cheese",
+"cream cheese (light or fat-free)",
+"cream cheese, softened",
+"cream of mushroom soup",
+"cream of tartar",
+"cream-style corn",
+"cream-style horseradish",
+"creamy or chunky peanut butter",
+"creamy peanut butter",
+"Creole seasoning",
+"Crepes",
+"crisp, red apples, cored and sliced",
+"crispy rice cereal",
+"croutons",
+"Crumb Topping",
+"crumbled blue cheese",
+"crumbled feta cheese",
+"crumbled goat cheese, for garnish",
+"crunchy cereal nuggets",
+"crused ice",
+"crushed corn chips",
+"crushed corn flakes",
+"crushed cumin seed",
+"crushed dried basil",
+"crushed dried marjoram",
+"crushed dried oregano",
+"crushed dried parsley",
+"crushed dried rosemary",
+"crushed dried tarragon",
+"crushed dried thyme",
+"crushed fruit or berries",
+"crushed herb seasoned stuffing",
+"crushed ice",
+"crushed Italian Seasonings",
+"crushed Maraschino cherries with stems, for garnish",
+"crushed mint leaves, packed",
+"crushed oregano",
+"crushed pineapple drained thoroughly",
+"crushed pineapple in own juice, drained",
+"crushed pineapple, drained",
+"crushed potato chips",
+"crushed potato or tortilla chips",
+"Crushed red chili peppers",
+"crushed red pepper",
+"crushed red pepper flakes",
+"crushed tortilla chips",
+"Crust and Topping",
+"cubed American Cheese",
+"cubed cantaloupe",
+"cubed cooked ham",
+"cubed cooked turkey",
+"cubed day-old bread",
+"cubed feta cheese",
+"cubed honeydew melon",
+"cubed potatoes cooked",
+"cubed watermelon",
+"cubed, cooked chicken",
+"cubed, cooked chicken breast",
+"cucumber",
+"cucumber peeled, seeded and cut into 1/4-inch cubes",
+"Cucumber, thinly sliced",
+"Cucumbers scored and cut into 1/4-inch slices",
+"cumin",
+"cumin seeds",
+"Cupcakes",
+"cups cake flour",
+"cups refrigerated Alfredo Sauce",
+"currant jelly",
+"currants or raisins",
+"curry powder",
+"dairy non-fat sour cream",
+"dairy sour cream",
+"d'Anjou pears, peeled, cored, and cut in half",
+"dark beer",
+"dark brown sugar",
+"dark brown sugar, packed",
+"dark corn syrup",
+"dark Karo syrup",
+"dark or light corn syrup",
+"dark raisins",
+"dark red kidney beans rinsed and drained well",
+"dark rum",
+"dark rum or orange juice",
+"dates",
+"dates, chopped",
+"dates, pitted",
+"dates, sliced",
+"dehydrated onion",
+"Diced apples",
+"diced avocado",
+"diced black olives",
+"diced cantaloupe",
+"diced celery",
+"diced cooked chicken",
+"diced cooked chicken breast",
+"diced cooked potatoes",
+"diced cucumber",
+"diced dried pears",
+"diced fresh California nectarines",
+"diced fresh California peaches and plums",
+"diced fresh tomatoes",
+"diced green bell pepper",
+"diced onion",
+"diced peeled onion",
+"diced peeled tomatoes",
+"diced potato",
+"diced red bell pepper",
+"diced Red d'Anjou pears",
+"diced red onion",
+"diced red sweet peppers",
+"diced roasted red peppers",
+"diced sun-dried tomatoes",
+"diced tomato",
+"diced TURKEY HAM",
+"diced yellow pepper",
+"diced zucchini",
+"diced, boneless, skinless, cooked turkey",
+"diced, cooked chicken",
+"diced, cooked turkey",
+"diced, cooked turkey or chicken",
+"Dijon mustard",
+"Dijon mustard with seeds",
+"Dijon-style mustard",
+"dill pickle relish drained",
+"dill pickle spears",
+"dill pickle, finely chopped",
+"Dill sauce",
+"dill seeds",
+"dill weed",
+"distilled white vinegar",
+"Dough",
+"dozen large eggs",
+"drained black olives, pitted and sliced",
+"drained cocktail onions",
+"drained whole canned tomatoes",
+"Dressing",
+"dried apricot",
+"dried apricots",
+"dried apricots diced",
+"dried basil",
+"dried basil leaves",
+"dried basil, crushed",
+"dried black turtle beans",
+"dried bread crumbs",
+"dried bread crumbs buttered",
+"dried chili flakes",
+"dried chives",
+"dried cilantro",
+"dried cranberries",
+"dried crushed red pepper",
+"dried currants",
+"dried dill",
+"dried dill weed",
+"dried dillweed",
+"dried Italian herbs",
+"dried Italian seasoning",
+"dried marjoram",
+"dried marjoram, crushed",
+"dried minced onion",
+"dried minced onion minced",
+"dried navy beans",
+"dried onion",
+"dried oregano",
+"dried oregano flakes",
+"dried oregano leaves",
+"dried oregano, crumbled",
+"dried oregano, crushed",
+"dried parsley",
+"dried parsley flakes",
+"dried rosemary",
+"dried rosemary, crushed",
+"dried sage",
+"dried savory",
+"dried savory, finely crumbled",
+"dried tarragon",
+"dried tarragon, crushed",
+"dried tart cherries",
+"dried thyme",
+"dried thyme leaves",
+"dried thyme leaves, crushed",
+"dried thyme, crushed",
+"dried thyme, finely crumbled",
+"dried white raisins",
+"dry breadcrumbs",
+"dry ground mustard",
+"dry lentils, rinsed",
+"dry marsala wine",
+"dry mustard",
+"dry red wine",
+"dry roasted peanuts, unsalted",
+"dry rotini pasta",
+"dry sherry",
+"dry white beans",
+"dry white wine",
+"dry yeast",
+"dry-roasted peanuts",
+"egg",
+"Egg beaten",
+"Egg Noodles, uncooked",
+"egg slightly beaten",
+"egg substitute",
+"egg substitute, slightly beaten",
+"egg white",
+"egg white, slightly beaten",
+"egg whites",
+"egg whites, lightly beaten",
+"egg yolk",
+"Egg yolks",
+"egg yolks lightly beaten",
+"egg yolks slightly wisked",
+"egg, beaten",
+"egg, lightly beaten",
+"egg, slightly beaten",
+"eggplant",
+"eggs",
+"eggs beaten",
+"eggs slightly beaten",
+"eggs, beaten",
+"eggs, lightly beaten",
+"eggs, separated",
+"eggs, slightly beaten",
+"eggs, well beaten",
+"Elbow Macaroni, uncooked",
+"English muffins, split in half",
+"envelope dry onion soup mix",
+"envelope onion soup mix",
+"envelope unflavored gelatin",
+"espresso coffee, hot",
+"evaporated fat-free milk",
+"evaporated skim milk",
+"evaporated skimmed milk",
+"extra lean ground beef",
+"extra virgin olive oil",
+"extra-lean ground beef",
+"extra-virgin olive oil",
+"fat from poultry drippings",
+"fat-free (skim) milk",
+"fat-free cream cheese",
+"fat-free Italian dressing",
+"fat-free Italian salad dressing",
+"fat-free mayonnaise",
+"fat-free sour cream",
+"fat-trimmed loin roast, rolled and tied with bone",
+"fennel",
+"fennel bulb, cut in half lengthwise",
+"fennel bulbs",
+"fennel seed, crushed",
+"fennel seeds",
+"fennel seeds, crushed",
+"Feta cheese",
+"Feta cheese crumbled",
+"feta cheese, crumbled",
+"Fettuccine",
+"Fettuccine, uncooked",
+"Fettuccine, uncooked, broken in half",
+"Fettuccini",
+"Filling",
+"fine bread crumbs, dry",
+"fine dry bread crumbs",
+"fine fresh bread crumbs",
+"finely chipped candied ginger",
+"finely chopped dates",
+"finely chopped dill pickle spears",
+"finely chopped fresh cilantro",
+"finely chopped fresh garlic",
+"finely chopped fresh mint",
+"finely chopped fresh parsley",
+"finely chopped garlic",
+"finely chopped green onion",
+"finely chopped green pepper",
+"finely chopped hazelnuts",
+"finely chopped onion",
+"finely chopped parsley",
+"finely chopped peeled onion",
+"finely chopped red onion",
+"finely chopped shallots or scallions",
+"finely chopped walnuts",
+"finely chopped, cooked ham",
+"finely chopped, toasted pecans",
+"finely diced green bell pepper",
+"finely diced red bell pepper",
+"finely diced red onion",
+"finely grated lemon peel",
+"finely grated orange peel",
+"finely minced flatleaf parsley",
+"finely minced fresh cilantro",
+"finely minced fresh oregano leaves",
+"finely minced garlic",
+"finely minced ginger",
+"finely shredded fresh basil",
+"finely shredded lemon peel",
+"finely shredded lime peel",
+"finely shredded orange peel",
+"finely shredded Swiss cheese",
+"finely-chopped bell pepper",
+"finely-chopped canned chipotle",
+"finely-chopped celery",
+"finely-chopped cooked chicken",
+"finely-chopped onion",
+"finely-diced plums",
+"firm butter or margarine",
+"firmly packed brown sugar",
+"firmly-packed brown sugar",
+"firm-ripe California avocado",
+"flaked or shredded coconut",
+"flat beer",
+"flat-bottom ice cream cones",
+"flat-leaf parsley",
+"flour",
+"Flour tortillas",
+"fontina",
+"French bread cubes",
+"fresh apple, grated",
+"fresh asparagus spears, cooked",
+"fresh baby carrots",
+"fresh basil",
+"fresh basil chopped",
+"fresh basil leaves",
+"fresh basil leaves, chopped",
+"Fresh Basil Leaves, thinly sliced",
+"fresh basil, coarsely chopped",
+"fresh basil, stems removed",
+"fresh blueberries",
+"fresh boneless, skinless chicken breasts",
+"fresh boneless, skinless chicken breasts, cut into 1/2-inch dice",
+"fresh boneless, skinless chicken breasts, sliced",
+"fresh boneless, skinless chicken breasts, sliced thinly",
+"fresh boneless, skinless chicken breasts, thickly sliced",
+"fresh boneless, skinless chicken thigh cutlets",
+"fresh bratwurst",
+"fresh bread crumbs",
+"fresh California nectarines",
+"fresh California peaches, halved and pitted, coarsely chopped",
+"fresh California plums",
+"fresh chicken drumsticks",
+"fresh chicken thighs",
+"fresh chopped cilantro",
+"fresh chopped oregano",
+"fresh chopped thyme",
+"fresh cilantro chopped",
+"fresh cilantro coarsely chopped",
+"Fresh Cilantro diced",
+"fresh cilantro, minced",
+"fresh cranberries",
+"fresh diced rhubarb",
+"Fresh dill sprigs",
+"fresh flat-leaf parsley, coarsely chopped",
+"fresh garlic minced",
+"fresh ginger minced",
+"fresh ginger peeled and minced",
+"fresh ginger root, minced",
+"fresh ginger, grated",
+"fresh grated ginger",
+"fresh green beans",
+"Fresh ground pepper to taste",
+"fresh jalapeno peppers, seeded and minced",
+"fresh jalapeño, seeded and chopped",
+"fresh lemon juice",
+"fresh lemon peels, grated",
+"fresh lime juice",
+"fresh linguine",
+"Fresh Mushrooms",
+"fresh mushrooms, quartered",
+"Fresh mushrooms, rinsed",
+"fresh mushrooms, sliced",
+"fresh mushrooms, whole",
+"fresh orange juice",
+"fresh oregano",
+"fresh oregano, finely chopped",
+"fresh parsley",
+"fresh parsley sprigs, chopped",
+"fresh parsley tightly packed",
+"fresh parsley, chopped",
+"fresh plum tomatoes, cut into small cubes",
+"fresh raspberries",
+"fresh rosemary finely chopped",
+"fresh rosemary, minced",
+"fresh sage",
+"Fresh Shiitake Mushrooms, sliced",
+"fresh snow peas",
+"fresh snow peas, trimmed",
+"Fresh spinach leaves",
+"fresh spinach leaves, cleaned and stems discarded",
+"fresh spinach leaves, trimmed and torn",
+"fresh spinach washed, dried and torn",
+"fresh spinach, washed, hard stems removed",
+"fresh squeezed Texas Red Grapefruit juice",
+"fresh strawberries, washed, hulled and finely chopped",
+"fresh thyme",
+"fresh thyme leaves",
+"fresh tuna",
+"fresh tuna steak, cooked",
+"fresh white mushrooms",
+"fresh white mushrooms or mushroom stems, wiped clean and finely chopped",
+"Fresh White Mushrooms, quartered",
+"Fresh White Mushrooms, sliced",
+"fresh whole chicken",
+"Fresh-ground black pepper",
+"freshly chopped parsley",
+"freshly chopped tomato",
+"Freshly cracked black pepper to taste",
+"freshly grated lemon peel",
+"freshly grated nutmeg",
+"freshly grated Parmesan",
+"freshly grated Parmesan cheese",
+"freshly grated Parmigiano-Reggiano cheese",
+"freshly ground black pepper",
+"Freshly ground black pepper, to taste",
+"Freshly ground pepper, to taste",
+"freshly ground pure horseradish",
+"freshly ground white pepper",
+"freshly ground white pepper to taste",
+"freshly squeezed lemon juice",
+"freshly squeezed lime juice",
+"freshly squeezed Texas Orange juice",
+"freshly-ground black pepper",
+"Freshly-ground black pepper, to taste",
+"Freshly-ground white pepper, to taste",
+"fried or baked chicken wings",
+"frozen apple juice concentrate, thawed",
+"frozen baby peas",
+"frozen biscuits",
+"Frozen concentrate orange juice",
+"frozen corn",
+"frozen corn, thawed",
+"frozen corn, thawed and drained",
+"frozen green beans, thawed",
+"frozen green peas",
+"frozen green peas thawed",
+"frozen green peas, thawed and well drained",
+"frozen hash brown potatoes",
+"frozen hash brown potatoes defrosted and patted dry",
+"Frozen Italian green beans",
+"frozen mango chunks",
+"frozen medium shrimp, thawed",
+"frozen mixed vegetables",
+"frozen mixed vegetables, thawed and drained",
+"frozen orange juice concentrate",
+"frozen orange juice concentrate, thawed",
+"frozen peaches",
+"frozen peas",
+"frozen peas and carrots",
+"frozen peas, defrosted",
+"frozen peas, thawed",
+"frozen peas, thawed and drained",
+"frozen pineapple juice concentrate",
+"Frozen Shrimp, peeled & deveined",
+"frozen small shrimp, thawed",
+"frozen Southwestern seasoned chicken strips",
+"frozen tart cherries",
+"frozen tart cherries, coarsely chopped",
+"frozen tart or sweet cherries",
+"frozen unsweetened tart cherries",
+"frozen unsweetened tart cherries, thawed",
+"frozen unsweetened tart cherries, thawed and well drained",
+"frozen waffles, toasted",
+"frozen whole kernel corn",
+"frozen whole onions",
+"fructose",
+"fully cooked diced chicken or turkey",
+"fully cooked smoked sausage links, quartered lengthwise and sliced",
+"fully-cooked ham",
+"fully-cooked oven roasted turkey breast sliced",
+"fusilli pasta cooked and drained",
+"garlic",
+"garlic clove, chopped",
+"garlic clove, crushed",
+"garlic clove, minced",
+"garlic clove, peeled and quartered",
+"garlic clove, peeled and smashed",
+"garlic cloves, chopped",
+"garlic cloves, crushed",
+"garlic cloves, finely chopped",
+"garlic cloves, mashed",
+"garlic cloves, minced",
+"garlic cloves, unpeeled",
+"garlic minced",
+"garlic powder",
+"garlic salt",
+"garlic, chopped",
+"Garlic, finely minced",
+"garlic, minced",
+"Generous dash of cayenne pepper",
+"ginger",
+"ginger, freshly grated",
+"Ginger-root; fresh; minced",
+"goat cheese",
+"gold tequila",
+"golden raisins",
+"Gorgonzola cheese crumbled",
+"graham cracker crumbs",
+"grainy mustard",
+"Granny Smith apple diced",
+"Granny Smith apple, halved, cored and thinly sliced",
+"Granny Smith apples, peeled, cored, thinly sliced",
+"granulated fructose",
+"granulated garlic",
+"granulated instant coffee",
+"granulated sugar",
+"grape",
+"grapefruit juice",
+"grated asiago",
+"grated Asiago cheese",
+"grated carrot",
+"grated carrots",
+"grated Cheddar cheese",
+"grated Edam cheese",
+"grated fresh ginger",
+"grated fresh ginger root",
+"grated Gruyere cheese",
+"grated lemon peel",
+"grated lemon rind",
+"grated lemon zest",
+"grated lime peel",
+"grated low-fat Cheddar cheese",
+"grated low-fat Swiss cheese",
+"grated low-sodium Parmesan cheese",
+"grated mozzarella cheese",
+"grated onion",
+"grated orange or lemon peel",
+"grated orange peel",
+"grated orange zest",
+"grated Parmesan",
+"grated Parmesan cheese",
+"grated part-skim mozzarella cheese",
+"grated provolone cheese",
+"grated reduced-fat Cheddar cheese",
+"grated reduced-fat Swiss cheese",
+"grated Romano cheese",
+"grated smoked gouda cheese",
+"grated zucchini",
+"Greek olives pitted",
+"green beans, blanched and refreshed in cold water",
+"green beans, cooked, drained",
+"green beans, julienne, blanched",
+"green beans, trimmed and cut in half",
+"green bell pepper, chopped",
+"green bell pepper, cut into chunks",
+"green bell pepper, ribs and seeds removed, chopped",
+"green bell pepper, ribs and seeds removed, diced",
+"green bell pepper, seeded and chopped",
+"green bell pepper, seeded and cut into thin strips",
+"green bell pepper, seeded and sliced",
+"green bell pepper, seeded, ribs removed, and julienned",
+"green bell pepper, seeds and ribs removed, julienned",
+"green bell pepper, thinly sliced",
+"green chili peppers, chopped",
+"green olives",
+"green olives, sliced",
+"green onion chopped",
+"green onion finely chopped",
+"green onion minced",
+"green onion, finely chopped",
+"green onion, sliced",
+"green onions chopped",
+"green onions finely chopped",
+"Green onions sliced",
+"green onions thinly sliced",
+"green onions, chopped",
+"green onions, julienned",
+"green onions, minced",
+"green onions, sliced",
+"green onions, whites and tops, chopped",
+"green onions, whites and tops, thinly sliced",
+"green or red bell pepper, coarsly chopped",
+"green pepper chopped",
+"green pepper cut into 1/2-inch cubes",
+"green pepper seeded and cut into 1/4 inch cubes",
+"green pepper seeded and thinly sliced",
+"Green Pepper Strips",
+"green pepper, chopped",
+"green pepper, finely diced",
+"Green pepper; cubed",
+"green split peas, rinsed",
+"grilled chicken, diced",
+"ground allspice",
+"ground beef",
+"ground beef, cooked and drained",
+"ground beef, pork or turkey",
+"ground black pepper",
+"Ground black pepper, to taste",
+"ground cinnamon",
+"ground cloves",
+"ground coriander",
+"ground cumin",
+"ground ginger",
+"ground lean beef",
+"ground mace",
+"ground nutmeg",
+"ground oats",
+"ground pepper",
+"ground pork",
+"ground pork sausage",
+"Ground Red Chiles",
+"ground red pepper",
+"ground round",
+"ground sage",
+"ground sausage",
+"ground thyme",
+"ground turkey",
+"ground turmeric",
+"ground white pepper",
+"ground, roasted, skinned hazelnuts",
+"Guacamole",
+"half and half",
+"Half and Half cream",
+"half-and-half",
+"hamburger buns",
+"Hamburger buns toasted",
+"hard-boiled eggs, chopped",
+"head Boston lettuce, well washed, and drained",
+"head cabbage, cut into wedges",
+"head garlic, peeled and seperated",
+"head of lettuce",
+"head romaine lettuce, torn in pieces",
+"head romaine lettuce, torn into bite-size pieces",
+"heaping tablespoons of cottage cheese",
+"heavy (whipping) cream",
+"heavy cream",
+"heavy whipping cream",
+"Herb sprigs",
+"herbed stuffing mix",
+"herb-seasoned stuffing mix crushed",
+"hickory-smoked barbecue sauce",
+"hoisin sauce",
+"homemade-type white bread, crusts removed",
+"honey",
+"Honey Glaze",
+"honey mustard",
+"honey roasted peanuts",
+"horseradish",
+"hot buttered noodles",
+"hot coffee",
+"hot cooked rice",
+"hot espresso-style coffee",
+"hot fudge topping",
+"hot Italian sausage",
+"hot pepper sauce",
+"Hot pepper sauce, to taste",
+"hot red pepper flakes",
+"hot red pepper sauce",
+"hot sauce",
+"hot water",
+"Ice cream",
+"ice cubes",
+"Ice ring",
+"ice water",
+"Idaho potatoes",
+"Indian curry powder",
+"Ingredients",
+"instant chicken bouillon granules",
+"instant coffee",
+"instant coffee granules",
+"instant minced onion",
+"instant potato flakes",
+"instant white or brown rice",
+"Iow-sodium chicken broth",
+"Italian dressing",
+"Italian parsley, coarsely chopped",
+"Italian salad dressing",
+"Italian seasoned dry bread crumbs",
+"Italian seasoning",
+"Italian seasonings",
+"Italian turkey sausage",
+"Italian turkey sausage casing removed, cooked & crumbled",
+"Italian turkey sausage, casing removed, cooked & crumbled",
+"Italian-style bread crumbs",
+"Italian-style turkey sausage",
+"jalapeno chiles, stemmed, seeded and finely diced",
+"jalapeno chiles, stemmed, seeded if desired and minced",
+"jalapeno jelly",
+"jalapeno pepper minced",
+"Jalapeno pepper seeded and finely chopped",
+"jalapeno pepper, minced",
+"jalapeño pepper, minced",
+"jalapeño pepper, seeded and diced",
+"jalapeno pepper, seeded and minced",
+"jalapeño pepper, stemmed, seeded and thinly sliced",
+"Jalapeno peppers seeded and chopped",
+"jalapeno peppers seeded and minced",
+"jalapeño, cored and thinly sliced",
+"jalapeño, seeded and minced",
+"jalapenos coarsely chopped, with seeds",
+"jumbo prawns",
+"jumbo shells",
+"Jumbo Shells, uncooked",
+"Kalamata olives, pitted and sliced",
+"ketchup",
+"kielbasa sausage",
+"kiwi",
+"kiwi fruits, peeled, diced",
+"kiwifruit, peeled and sliced",
+"kiwis, peeled",
+"kosher salt",
+"kosher salt to taste",
+"lager",
+"lamb chops",
+"lamb shanks",
+"lamb stew meat",
+"lasagna noodles",
+"lasagna noodles, uncooked",
+"lean beef cut into 1-inch cubes",
+"lean beef stew meat, cut into 1-inch chunks",
+"lean boneless top round steak",
+"lean bulk pork sausage",
+"lean ground beef",
+"lean ground beef, browned and drained",
+"Lean Loin of Pork",
+"lean pork spareribs",
+"lean, boneless pork loin, cut into 3/4-inch cubes",
+"leaves fresh mint, julienned",
+"leek, white only, chopped",
+"leeks thinly sliced",
+"leeks, chopped",
+"lemon extract",
+"lemon juice",
+"lemon juice, freshly squeezed",
+"lemon peel",
+"lemon peel, freshly grated",
+"lemon pepper",
+"Lemon pepper seasoning",
+"Lemon slices",
+"lemon zest",
+"lemon, thinly sliced",
+"lemons",
+"lentils, rinsed",
+"lettuce leaves",
+"Lettuce leaves washed and dried",
+"lettuce, shredded",
+"light brown sugar",
+"light corn syrup",
+"light cream",
+"light cream cheese",
+"light cream cheese, softened",
+"light cream or table cream",
+"light dairy sour cream",
+"light or dark brown sugar",
+"light rum, optional",
+"light soy sauce",
+"lightly beaten egg",
+"lightly packed fresh basil leaves, chopped",
+"lightly salted peanuts",
+"lightly toasted pine nuts",
+"lime juice",
+"Lime wedges",
+"lime, juiced",
+"Linguine, uncooked",
+"liquid hot pepper sauce",
+"liquid smoke",
+"liquid smoke flavoring",
+"liquid sugar substitute",
+"lite coconut milk",
+"lite soy sauce",
+"Loin lamb chops",
+"long-grain rice",
+"loosely packed cilantro leaves",
+"loosely packed fresh basil",
+"loose-pack frozen peas",
+"loose-pack frozen whole kernel corn",
+"Louisiana-style hot sauce",
+"low fat milk",
+"low fat yogurt",
+"low sodium chicken broth, warm",
+"low-calorie margarine",
+"low-fat (1%) buttermilk",
+"low-fat buttermilk",
+"low-fat Caesar or Italian salad dressing",
+"low-fat cheddar cheese",
+"low-fat Cheddar cheese, grated",
+"low-fat cheddar cheese, shredded",
+"lowfat cottage cheese",
+"low-fat cottage cheese",
+"low-fat granola",
+"Low-fat grated Cheddar cheese",
+"low-fat low-sodium beef broth",
+"low-fat low-sodium chicken broth",
+"low-fat low-sodium chicken broth, boiling",
+"lowfat milk",
+"low-fat milk",
+"low-fat or non-fat mayonnaise",
+"low-fat peanut butter",
+"lowfat ricotta cheese",
+"low-fat ricotta cheese",
+"low-fat sour cream",
+"low-fat yogurt",
+"low-fat, chunky vegetable spaghetti sauce",
+"low-fat, part-skim ricotta cheese",
+"low-fat, plain yogurt",
+"low-sodium beef broth",
+"low-sodium canned tomato sauce",
+"low-sodium chicken broth",
+"low-sodium chicken broth or water",
+"low-sodium chicken broth, boiling",
+"low-sodium chicken broth, skimmed of fat",
+"low-sodium shredded mozzarella cheese",
+"low-sodium soy sauce",
+"low-sodium spaghetti sauce",
+"low-sodium tomato sauce",
+"macaroni, cooked according to directions, drained",
+"mango",
+"mango, peeled, seeded and chopped",
+"Manicotti Shells, uncooked",
+"Manicotti, uncooked",
+"maple syrup",
+"maple-flavored syrup",
+"maraschino cherries",
+"maraschino cherries, drained, rinsed",
+"maraschino cherry juice",
+"margarine",
+"margarine melted",
+"margarine or butter",
+"margarine or butter melted",
+"margarine or butter, melted",
+"margarine, cut into pieces",
+"margarine, melted",
+"margarine, softened",
+"marinara sauce",
+"marjoram",
+"marjoram leaves",
+"marshmallow creme",
+"masa flour",
+"mascarpone",
+"mashed ripe bananas",
+"matzo meal",
+"mayonnaise",
+"Meatballs",
+"meatless tomato or spaghetti sauce",
+"Meatloves",
+"Medium Egg Noodles",
+"Medium Egg Noodles, uncooked",
+"melted butter",
+"melted butter or margarine",
+"melted butter or oil",
+"melted margarine",
+"melted shortening",
+"mesclun",
+"mild enchilada sauce",
+"mild italian turkey sausage",
+"mild salsa",
+"mild sausage",
+"mild white vinegar",
+"milk",
+"milled black pepper",
+"millet",
+"minced celery",
+"minced dill",
+"minced flat-leaf parsley",
+"minced fresh basil",
+"minced fresh chives",
+"minced fresh cilantro",
+"minced fresh ginger",
+"minced fresh ginger root",
+"minced fresh gingerroot",
+"minced fresh mint",
+"minced fresh oregano",
+"minced fresh parsley",
+"minced fresh rosemary",
+"minced fresh thyme",
+"minced garlic",
+"minced ginger",
+"minced ginger root",
+"minced golden raisins",
+"minced green bell pepper",
+"minced green onions",
+"minced green parsley",
+"minced Italian flat-leaf parsley",
+"minced jalapeno",
+"minced jalapeño pepper",
+"minced jalapeño peppers",
+"minced mint",
+"minced onion",
+"minced oregano",
+"minced parsley",
+"minced scallions",
+"minced, seeded jalapeño pepper",
+"miniature marshmallows",
+"miniature semisweet chocolate chips",
+"miniature semisweet chocolate pieces",
+"mint sprigs",
+"mixed fresh herbs, chopped",
+"mixed whole pickling spice",
+"molasses",
+"Monterey Jack cheese",
+"Monterey Jack cheese shredded",
+"Monterey Jack cheese, grated",
+"Monterey Jack or Cheddar cheese",
+"mozzarella cheese coarsely shredded",
+"Mozzarella Cheese, shredded",
+"Muffins",
+"Mushroom Sauce",
+"mushrooms",
+"mushrooms, chopped",
+"mushrooms, halved",
+"mushrooms, quartered",
+"mushrooms, sliced",
+"mushrooms, thinly sliced",
+"mustard",
+"natural peanut butter",
+"naval oranges, peeled, sliced and quartered",
+"navel oranges, peeled and sliced",
+"nectarine, coarsely chopped",
+"nectarines, pitted and coarsely chopped",
+"new red potatoes",
+"no cholesterol reduced-calorie mayonnaise",
+"no-cholesterol reduced-calorie mayonnaise",
+"non-fat buttermilk",
+"Nonfat cooking spray, as needed",
+"nonfat cottage cheese",
+"non-fat cream cheese",
+"nonfat dry milk powder",
+"nonfat granola",
+"non-fat Italian salad dressing",
+"non-fat mayonnaise",
+"nonfat milk",
+"non-fat milk",
+"nonfat plain yogurt",
+"non-fat plain yogurt",
+"nonfat powdered milk",
+"nonfat sour cream",
+"non-fat sour cream",
+"nonfat whipped topping",
+"nonfat yogurt",
+"non-fat, plain yogurt",
+"nonstick cooking spray",
+"Non-stick cooking spray",
+"Nonstick cooking spray, as needed",
+"Noodles Thai Shrimp Sauce",
+"noodles, cooked in salted water, drained",
+"no-salt corn chips crushed",
+"no-salt-added tortilla chips",
+"nutmeg",
+"Nutmeg to taste",
+"oat bran",
+"oatmeal",
+"oil",
+"Oil for frying",
+"oil for sautéing",
+"oil or melted butter",
+"oil-packed sun-dried tomatoes, chopped",
+"old-fashioned oats",
+"old-fashioned or quick-cooking oats, uncooked",
+"old-fashioned rolled oats",
+"olive oil",
+"Olive oil flavored cooking spray",
+"olive oil or cooking oil",
+"olive oil or vegetable oil",
+"olive or vegetable oil",
+"onion chopped",
+"onion coarsely chopped",
+"onion finely chopped",
+"onion flakes",
+"onion grated",
+"onion powder",
+"onion sliced",
+"onion thinly sliced",
+"onion, chopped",
+"onion, diced",
+"onion, finely diced",
+"onion, minced",
+"onion, peeled and chopped",
+"onion, sliced",
+"onion; chop fine",
+"Onions, chopped",
+"onions, coarsely chopped",
+"onions, diced",
+"onions, peeled and chopped",
+"orange",
+"orange extract",
+"orange juice",
+"orange juice concentrate",
+"orange liqueur",
+"orange marmalade",
+"orange rind grated",
+"orange slice halves",
+"orange zest",
+"oranges",
+"oregano",
+"oregano leaves",
+"Oregano Leaves, crushed",
+"oregano, chopped",
+"oriental sesame oil",
+"Orzo",
+"orzo macaroni",
+"oven roasted turkey breast finely chopped",
+"oven-toasted cereal squares",
+"Oyster Mushrooms, roughly chopped",
+"Oyster Sauce",
+"Pace thick & chunky salsa",
+"packed brown sugar",
+"packed cilantro leaves",
+"packed dark brown sugar",
+"packed fresh basil",
+"packed light brown sugar",
+"pancetta",
+"papaya, halved, seeded, peeled and sliced",
+"paprika",
+"Paprika, to taste",
+"Parmesan",
+"Parmesan cheese",
+"Parmesan cheese freshly grated",
+"Parmesan cheese grated",
+"Parmesan cheese, grated",
+"Parmesano-Reggiano",
+"Parmigiano-Reggiano cheese, grated",
+"parsley",
+"parsley flakes",
+"parsley leaves (tightly packed)",
+"parsley minced",
+"parsley, chopped",
+"parsley, finely chopped",
+"parsley, minced",
+"parsnips",
+"parsnips, peeled and quartered",
+"part skim ricotta cheese",
+"part-skim mozzarella cheese",
+"part-skim mozzarella cheese, grated",
+"part-skim ricotta cheese",
+"pasta",
+"pasta shells",
+"Pastry",
+"peach low-fat yogurt",
+"peach preserves",
+"peach sorbet",
+"peach yogurt",
+"peaches, peeled, pitted and coarsely chopped",
+"peaches, pitted and chopped",
+"peaches, pitted and thinly sliced",
+"peanut butter",
+"peanut oil",
+"peanuts",
+"pear, cored and finely chopped",
+"pear, peeled, cored, and sliced",
+"pearl onions",
+"pears",
+"peas",
+"pecan pieces, toasted",
+"pecans, chopped",
+"pecans, finely chopped",
+"peel from one lemon",
+"peeled clove garlic, chopped",
+"peeled, diced eggplant",
+"peeled, seeded and chopped cucumber",
+"penne pasta",
+"pepper",
+"pepper, to taste",
+"peppercorns",
+"pepperoni",
+"picante sauce",
+"pimientos, chopped",
+"pine nuts",
+"pine nuts, toasted",
+"pineapple",
+"pineapple chunks, drained",
+"Pineapple chunks; canned",
+"pineapple juice",
+"pineapple sherbet",
+"pineapple slices canned in own juice",
+"pinenuts",
+"pita bread halves",
+"pitted and chopped black olives, such as Kalamata",
+"pitted dried red cherries, coarsely chopped",
+"pitted prunes",
+"Pizza Sauce",
+"plain bread crumbs",
+"plain Fettuccine, uncooked",
+"plain lowfat yogurt",
+"plain low-fat yogurt",
+"plain nonfat yogurt, strained",
+"Plain or vanilla yogurt",
+"plain yogurt",
+"plain, low-fat yogurt",
+"plain, non-fat yogurt",
+"plum tomato, diced",
+"plum tomatoes, cored, seeded and cut in halves",
+"plum tomatoes, diced",
+"plum tomatoes, quartered",
+"plum tomatoes, seeded and finely chopped",
+"plums, any variety, pitted and sliced",
+"plums, pitted and coarsely chopped",
+"plums, seeds removed, and cut into thin slices",
+"poached chicken, cut into chunks",
+"poblano chiles",
+"poppy seeds",
+"porcini mushrooms",
+"pork chops, 3/4-inch thick",
+"pork loin, fat trimmed, and cut into 1/2-inch pieces",
+"pork loin, trimmed of fat, cut into 1/2-inch pieces",
+"pork sirloin cutlets, tenderized, about 1/4-inch thick",
+"pork spareribs",
+"pork tenderloin",
+"pork tenderloin, cut in 2-inch pieces",
+"pork tenderloin, cut in thin strips",
+"pork tenderloin, trimmed of fat",
+"pork, boneless cubed",
+"port wine",
+"portabella mushrooms, sliced 1/2-inch thick, gills removed",
+"portobello mushrooms, sliced",
+"Potato",
+"potato peeled and diced",
+"potato starch",
+"Potatoes baked",
+"potatoes diced",
+"potatoes peeled and cut into 1/2-inch cubes",
+"potatoes, baked and split in half",
+"potatoes, diced",
+"potatoes, dried flakes, mashed",
+"potatoes, peeled and cubed",
+"potatoes, peeled and sliced",
+"potatoes, scrubbed and diced",
+"poultry seasoning",
+"powdered chicken bouillon mix",
+"powdered garlic",
+"powdered ginger",
+"powdered milk",
+"powdered pectin",
+"powdered sugar",
+"powdered sugar, sifted",
+"prepared 9-inch pastry pie crust",
+"prepared barbecue sauce",
+"prepared chili sauce",
+"prepared chunky vegetable spaghetti sauce",
+"prepared horseradish",
+"prepared marinara sauce",
+"prepared mustard",
+"prepared pesto sauce",
+"Prepared pie dough for two single-crust 9-inch pies",
+"prepared pizza sauce",
+"prepared reduced-fat graham cracker crumb crust - (6 oz)",
+"prepared sourdough starter",
+"prepared yellow mustard",
+"preserved ginger pieces",
+"preserved ginger syrup",
+"prosciutto",
+"provolone cheese",
+"provolone cheese, grated",
+"pumpkin pie spice",
+"pumpkin seeds",
+"pure red chile powder",
+"pure vanilla extract",
+"quartered cherry tomatoes",
+"quick cooking oats",
+"quick cooking rolled oats",
+"quick or old-fashioned oats",
+"quick-cooking oats",
+"quick-cooking rice",
+"quick-cooking rice, uncooked",
+"raisins",
+"raspberries",
+"raspberry jam",
+"raspberry juice",
+"raspberry preserves",
+"raspberry sorbet",
+"raspberry vinegar",
+"ready-to-eat ham",
+"ready-to-use 9-inch graham cracker pie crust (6 ounces)",
+"real maple or maple-flavored syrup",
+"real maple syrup",
+"red and yellow bell pepper, peeled and julienned",
+"red apple, diced",
+"red bell pepper cut into 1/4-inch cubes",
+"red bell pepper seeded & cut into 1/4-inch cubes",
+"red bell pepper seeded and chopped",
+"red bell pepper seeded and diced",
+"red bell pepper seeded and sliced",
+"red bell pepper, cut into chunks",
+"red bell pepper, halved and sliced",
+"red bell pepper, julienned",
+"red bell pepper, ribs and seeds removed, diced",
+"red bell pepper, ribs and seeds removed, julienned",
+"red bell pepper, ribs removed and cut into strips",
+"red bell pepper, seeded and cut into thin strips",
+"red bell pepper, seeded, ribs removed, and julienned",
+"red bell pepper, seeds and ribs removed, chopped",
+"red bell pepper, seeds and ribs removed, cut into strips",
+"red bell pepper, sliced",
+"red bell pepper, thinly sliced",
+"red bell peppers",
+"red bell peppers, diced",
+"red bell peppers, ribs and seeds removed, diced",
+"red bell peppers, seeded and diced",
+"red bell peppers, seeds and stems removed, cut into bite-size, thin strips",
+"red currant jelly",
+"red food coloring",
+"red onion, minced",
+"red onion, pared, thinly sliced",
+"red onion, quartered",
+"red onion, thinly sliced",
+"red onions, halved",
+"red or green bell pepper, diced",
+"red or white seedless grapes, cut in half",
+"red or white wine vinegar",
+"red or yellow bell pepper, cut into short, thin strips",
+"red or yellow bell pepper, ribs and seeds removed, cut into small strips",
+"red pepper",
+"red pepper flakes",
+"Red pepper flakes to taste",
+"red pepper sauce",
+"red pepper, cut into strips",
+"red pepper, minced",
+"red peppers, diced",
+"red raspberries",
+"red skinned potatoes, peeled and diced",
+"red vinegar",
+"red wine",
+"red wine vinegar",
+"reduced fat all purpose baking mix",
+"reduced-calorie Creamy Italian dressing",
+"reduced-calorie mayonnaise",
+"reduced-calorie stick margarine, melted",
+"reduced-calorie tub margarine, softened",
+"reduced-fat Cheddar cheese",
+"reduced-fat Cheddar cheese grated",
+"reduced-fat Cheddar cheese shredded",
+"reduced-fat cream cheese",
+"reduced-fat creamy peanut butter",
+"reduced-fat margarine",
+"reduced-fat mayonnaise",
+"reduced-fat Monterey Jack cheese grated",
+"reduced-fat Monterey Jack cheese shredded",
+"reduced-fat Monterey Jack cheese, grated",
+"reduced-fat shredded Cheddar cheese",
+"reduced-fat sour cream",
+"reduced-fat vanilla yogurt",
+"reduced-fat whipped topping",
+"reduced-sodium chicken bouillon",
+"reduced-sodium reduced-fat chicken broth",
+"reduced-sodium soy sauce",
+"regular or low-fat sour cream",
+"rehydrated cranberries, drained",
+"rice vinegar",
+"rice wine vinegar",
+"rice, cooked",
+"Rice; hot cooked",
+"ricotta cheese",
+"ricotta or whipped cream cheese",
+"ricotta salata",
+"ricotta salata cheese",
+"Rigatoni",
+"rinsed canned black beans, drained",
+"ripe banana",
+"ripe banana, peeled",
+"ripe bananas, mashed",
+"ripe Haas avocado, coarsely chopped",
+"ripe medium bananas",
+"ripe olives",
+"ripe tomatoes, cored",
+"ripe tomatoes, sliced",
+"roast beef, chopped",
+"Roasted red peppers",
+"roasted, salted peanuts",
+"rolled oats",
+"Roquefort Cheese",
+"rosemary",
+"Rotini",
+"round steak",
+"Rum",
+"russet potatoes",
+"russet potatoes, peeled and diced",
+"rye flour",
+"safflower oil",
+"saffron",
+"sage leaves",
+"sage seasoning mixture",
+"Salad",
+"salad greens, torn",
+"salad oil",
+"Salad or Olive Oil",
+"salmon steaks",
+"Salsa",
+"Salsa Cruda",
+"salsa prima roasted garlic",
+"salt",
+"Salt and black pepper to taste",
+"salt and freshly ground black pepper",
+"Salt and freshly ground black pepper, to taste",
+"salt and freshly ground pepper",
+"Salt and freshly ground pepper, to taste",
+"Salt and pepper, to taste",
+"salt pork fat melted or other fat",
+"Salt, as needed",
+"Salt, to taste",
+"salted black beans, rinsed and lightly crushed",
+"salted peanuts",
+"salted, roasted whole almonds",
+"Sauce",
+"Sauce:",
+"scallions, sliced",
+"scallions, sliced thin crosswise",
+"scallions, thinly sliced",
+"scallions, trimmed and sliced thin",
+"scallions, trimmed and thinly sliced",
+"scallops",
+"sea salt",
+"sea scallops",
+"seafood seasoning",
+"seasoned bread crumbs",
+"seasoned croutons",
+"seasoned dry bread crumbs",
+"seasoned dry breadcrumbs",
+"seasoned Italian bread crumbs",
+"seasoned pepper",
+"seasoned rice vinegar",
+"seasoned salt",
+"seasoned tomato sauce",
+"seedless green grapes",
+"seedless green grapes, cut into halves",
+"seedless raspberry jam",
+"seedless raspberry preserves",
+"seedless red grapes, cut into halves",
+"self-rising flour",
+"semisweet chocolate chips",
+"semi-sweet chocolate chips",
+"semisweet chocolate morsels",
+"sesame oil",
+"sesame or vegetable oil",
+"sesame seed bagel, halved, toasted",
+"sesame seeds",
+"sesame sticks, optional",
+"shallots, coarsly chopped",
+"sharp cheddar cheese, grated",
+"sharp cheddar cheese, shredded",
+"sharp Cheddar cheese, sliced",
+"shaved deli turkey ham",
+"shelled, salted sunflower seeds",
+"sherry",
+"sherry or dry white wine",
+"sherry vinegar",
+"Shiitake mushrooms, quartered",
+"shiitake, morel or chanterelle mushrooms",
+"short grain brown rice",
+"short ribs",
+"shortening",
+"shredded cabbage",
+"shredded carrot",
+"shredded carrots",
+"shredded Cheddar cheese",
+"shredded coconut",
+"shredded colby-jack cheese",
+"shredded cooked chicken",
+"shredded green cabbage",
+"shredded grilled chicken",
+"shredded lettuce",
+"shredded low-fat Cheddar cheese",
+"shredded low-fat mozzarella cheese",
+"shredded low-fat sharp cheddar cheese",
+"shredded low-sodium Cheddar cheese",
+"shredded Mexican-style cheese blend",
+"shredded Monterey Jack cheese",
+"shredded mozzarella",
+"shredded non-fat Cheddar cheese",
+"shredded onion",
+"shredded part-skim mozzarella cheese",
+"shredded reduced-fat Cheddar cheese",
+"shredded romaine lettuce",
+"Shredded Romano cheese",
+"shredded Swiss cheese",
+"shredded unsweetened coconut",
+"shredded, pared apple",
+"shredded, part-skim mozzarella cheese",
+"shredded, reduced-fat Cheddar cheese",
+"shredded, reduced-fat Monterey Jack cheese",
+"shrimp, peeled and deveined",
+"shucked oysters, drained",
+"sifted cake and pastry flour",
+"sifted confectioners' sugar",
+"Sifted fruit sugar",
+"sifted powdered sugar",
+"skim milk",
+"skim milk, room temperature",
+"skim or lowfat milk",
+"skim-milk ricotta cheese",
+"skinless, boneless chicken breast, cooked",
+"skinless, boneless chicken breasts, cut into bite-sized pieces",
+"skinless, boneless chicken breasts, cut into slivers",
+"skinless, boneless chicken breasts, diced",
+"skinless, boneless chicken breasts, sliced in half crosswise",
+"salmon, drained and flaked",
+"slice finely chopped onion",
+"sliced almonds",
+"sliced almonds, coarsely chopped",
+"sliced almonds, toasted",
+"sliced bananas",
+"sliced carrots",
+"sliced celery",
+"sliced fresh California nectarines",
+"sliced fresh California peaches",
+"sliced fresh mushrooms",
+"sliced fresh strawberries",
+"sliced green onion",
+"sliced green onions",
+"sliced green onions or red onion",
+"sliced green onions with tops",
+"sliced mushrooms",
+"sliced onion",
+"sliced onions",
+"sliced peaches",
+"sliced pepperoni",
+"sliced pimentos",
+"sliced plum tomatoes",
+"sliced purple onion",
+"sliced red onion",
+"sliced red onions",
+"sliced ripe olives",
+"sliced scallions",
+"sliced scallions, white and green parts",
+"sliced shallots or chopped sweet onion",
+"sliced shiitake mushrooms",
+"sliced spring onions",
+"sliced strawberries",
+"slices bacon, chopped",
+"Slices dried bread cubed",
+"slices fat-free American cheese",
+"slices mozzarella cheese",
+"slices prosciutto",
+"slices reduced-fat whole-wheat bread",
+"slices sandwich bread",
+"Slices turkey bacon cooked and crumbled",
+"Slices turkey bacon cooked and diced",
+"slices turkey bacon crisply cooked and crumbled",
+"slices white bread",
+"slices white bread, lightly toasted",
+"slices white or wheat bread",
+"Slices whole wheat bread lightly toasted",
+"slices whole-wheat bread, finely crumbled",
+"slivered almonds",
+"slivered almonds, lightly toasted",
+"slivered almonds, toasted",
+"slivered blanched almonds, lightly toasted",
+"small-curd cottage cheese",
+"smoked chicken, shredded",
+"smoked paprika",
+"smoked pork",
+"smoked salmon, cut into thin strips",
+"smoked sausage",
+"smoked turkey breast, shredded",
+"smooth peanut butter",
+"Snipped chives",
+"snipped crystallized ginger",
+"snipped dates",
+"snipped dried apricots",
+"snipped fresh basil",
+"snipped fresh chives",
+"snipped fresh mint",
+"snipped parsley",
+"snow peas",
+"snow peas, cut in half diagonally",
+"snow peas, stems removed",
+"soda",
+"soft bread crumbs",
+"soft whole wheat bread crumbs",
+"softened butter",
+"soup stock",
+"sour cream",
+"sour milk",
+"soy sauce",
+"spaghetti cooked according to package directions",
+"spaghetti cooked according to package instructions, drained",
+"spaghetti pasta",
+"spaghetti sauce",
+"Spaghetti, cooked",
+"Spaghetti, Fusilli or Linguine, uncooked",
+"Spaghetti, Linguine or any other long pasta shape, uncooked",
+"Spaghetti, Linguine or Thin Spaghetti, uncooked",
+"Spaghetti, Thin Spaghetti or Linguine, uncooked",
+"Spaghetti, uncooked",
+"spaghetti, uncooked, broken in half",
+"Spanish onion, finely chopped",
+"spinach Fettuccine, uncooked",
+"spinach leaves, stems removed and sliced into strips",
+"Spinach, cooked & chopped",
+"split bagels",
+"Sprig parsley",
+"sprigs fresh Italian parsley, coarsely chopped",
+"sprigs parsley",
+"sprigs rosemary",
+"sprigs thyme",
+"Stalk celery with leaves coarsely chopped",
+"stalk celery, trimmed and chopped",
+"Stalks celery chopped",
+"stalks celery, chopped",
+"stalks celery, diced",
+"stalks celery, julienned",
+"stalks chopped celery",
+"steamed milk",
+"stew beef chunks",
+"stewed tomatoes",
+"stick cinnamon",
+"strained poaching liquid",
+"strawberries",
+"strawberries, sliced",
+"strawberries, washed and stemmed",
+"strawberry jam",
+"strawberry puree",
+"strawberry-banana yogurt",
+"stuffing mix",
+"stuffing mix, crushed",
+"sugar",
+"sugar snap peas, trimmed",
+"sugar to taste",
+"Sun Dried Tomatoes, softened and minced",
+"sun-dried tomatoes in oil; drained, oil reserved, chopped",
+"sun-dried tomatoes, drained and cut into strips",
+"Sweet and hot mustard",
+"sweet basil",
+"sweet corn kernels",
+"sweet Italian sausage, casing removed",
+"sweet onion finely chopped",
+"Sweet Pepper Flakes",
+"sweet pickle relish",
+"sweet potato",
+"sweet potato, peeled and cubed",
+"sweet potatoes, boiled, peeled and mashed",
+"Sweet Red Bell Pepper, thinly sliced",
+"sweet red peppers, coarsely chopped",
+"sweetened flaked coconut",
+"Sweetened whipped cream",
+"Swiss cheese",
+"Swiss cheese grated",
+"Swiss cheese, shredded",
+"Tabasco sauce",
+"Tabasco, to taste",
+"taco sauce",
+"Taco shells",
+"Tapioca; quick-cooking",
+"tarragon",
+"tarragon leaves",
+"tarragon leaves, crushed",
+"tea bags",
+"tea bags (green or black)",
+"tea bags herbal or black",
+"teaspoons milk",
+"teriyaki marinade",
+"teriyaki sauce",
+"Texas Oranges",
+"Texas Red Grapefruit",
+"Texas Red Grapefruit sections",
+"Texas Red Grapefruit, halved",
+"Texas Red Grapefruit, peeled, sectioned and chopped",
+"Texas Red Grapefruit, sectioned",
+"thyme",
+"thyme leaves",
+"thyme, bunch",
+"thyme, crushed",
+"toasted almond slivers",
+"toasted chopped pistachio nuts",
+"toasted cumin seeds",
+"toasted oat cereal",
+"Toasted pecan pieces",
+"toasted pinenuts",
+"toasted sesame seeds",
+"toasted walnuts, chopped",
+"toasted, sliced almonds",
+"tomato juice",
+"tomato ketchup",
+"tomato paste",
+"tomato peeled and cut into chunks",
+"tomato sauce",
+"Tomato slices",
+"tomato, diced",
+"tomatoes peeled, seeded and diced",
+"tomatoes, cut into wedges",
+"tomatoes, diced",
+"tomatoes, peeled, seeded and diced",
+"Topping",
+"Toppings",
+"Toppings:",
+"torn green leaf lettuce",
+"torn spinach leaves",
+"torn spinach, washed and drained",
+"tortilla chips",
+"Tortilla Chips, crushed",
+"truffle juice",
+"Truffle Vinaigrette",
+"turkey bacon, finely chopped",
+"turkey breakfast sausage cooked",
+"turkey breast cubed",
+"turkey breast, cut thin strips",
+"turkey broth",
+"turkey broth and defatted pan juices",
+"turkey drumsticks",
+"turkey ham diced",
+"turkey ham finely chopped",
+"turkey liver",
+"turkey sausage, casings removed",
+"turkey stock",
+"turkey tenderloins",
+"turkey thighs boneless, skinless, quartered",
+"turkey thighs skin removed",
+"turkey thighs skinned & boned; cut into 1-inch cubes",
+"turkey thighs skinned and boned",
+"turkey thighs skinned, boned",
+"turkey wings",
+"turmeric",
+"unbaked 9-inch (4 cup volume) deep-dish pie shell",
+"unbaked 9-inch (4-cup volume) pie shell",
+"unbleached all-purpose flour",
+"unbleached flour",
+"unbleached white flour",
+"uncooked boneless chicken breast, sliced into thin strips",
+"uncooked elbow macaroni",
+"uncooked linguine",
+"uncooked rice",
+"undiluted frozen 100% juice berry concentrate",
+"undiluted frozen orange juice concentrate",
+"unflavored gelatin",
+"unprocessed uncooked wheat bran",
+"unsalted butter",
+"unsalted butter melted",
+"unsalted butter or herbed garlic butter",
+"unsalted butter or margarine",
+"unsalted butter, cut into small pieces",
+"unsalted butter, melted",
+"unsalted margarine",
+"unsalted peanuts",
+"unseasoned bread crumbs",
+"unsulfured molasses",
+"unsweetened apple juice",
+"unsweetened apple juice concentrate",
+"unsweetened applesauce",
+"unsweetened chocolate",
+"unsweetened chocolate, melted and cooled",
+"unsweetened cocoa",
+"unsweetened cocoa powder",
+"unsweetened orange juice",
+"vanilla",
+"vanilla bean, split",
+"vanilla extract",
+"vanilla ice cream",
+"Vanilla ice cream, softened",
+"vanilla lowfat yogurt",
+"vanilla yogurt",
+"Veal or lamb shanks",
+"vegetable base",
+"vegetable cooking spray",
+"vegetable oil",
+"Vegetable oil cooking spray",
+"Vegetable oil for sautéing",
+"vegetable or olive oil",
+"vegetable or peanut oil",
+"vegetable or tomato juice",
+"vegetable shortening",
+"vegetable spray",
+"very dry sherry",
+"very lean pork, trimmed",
+"very ripe banana, peeled",
+"Vinaigrette",
+"vinegar",
+"vinegar (distilled)",
+"vinegar, plain or flavored",
+"vodka",
+"Wagon Wheel Pasta, uncooked",
+"walnut halves",
+"walnut pieces",
+"Walnuts",
+"walnuts, finely chopped",
+"walnuts, roughly chopped",
+"walnuts, toasted",
+"warm water",
+"water",
+"water chestnuts, sliced",
+"water or milk",
+"Watercress leaves for garnish",
+"watermelon",
+"wheat germ",
+"wheat, rice or corn squares cereal",
+"whipped cream",
+"whipped honey",
+"Whipped topping",
+"whipping cream",
+"white balsamic vinegar",
+"White corn",
+"white corn syrup",
+"white crabmeat",
+"white mushrooms, quartered",
+"white mushrooms, well cleaned, and thinly sliced",
+"white onion",
+"white or yellow sharp cheddar, grated",
+"white pepper",
+"White pepper to taste",
+"white raisins",
+"white rice uncooked",
+"white sugar",
+"white vinegar",
+"white vinegar, plus",
+"white whole-wheat flour or all-purpose flour",
+"white wine",
+"white wine vinegar",
+"White Wine, dry",
+"whole allspice",
+"whole bay leaves",
+"whole berries for garnish",
+"whole black peppercorns",
+"whole blanched almonds",
+"whole boneless skinless chicken breasts",
+"Whole cloves",
+"whole cranberry sauce",
+"whole kernel corn",
+"whole leaf spinach washed and dried",
+"whole milk",
+"whole natural almonds",
+"whole nutmeg",
+"whole shallot, finely chopped",
+"whole turkey ham",
+"whole turkey, neck and giblets removed",
+"whole turkey, neck and giblets reserved",
+"whole wheat flour",
+"whole, pitted dates",
+"whole-grain mustard",
+"whole-wheat flour",
+"whole-wheat or rye flour",
+"Wide Egg Noodles",
+"Wide Egg Noodles, uncooked",
+"wieners",
+"wild mushrooms",
+"wild rice",
+"wine",
+"wine vinegar",
+"won ton wrappers",
+"Worcestershire sauce",
+"Worcestershire sauce, to taste",
+"Worchestershire sauce",
+"yams, peeled and sliced",
+"yellow bell pepper chopped",
+"yellow bell pepper diced",
+"yellow bell pepper seeded and cut into long, thin strips",
+"yellow bell pepper, ribs and seeds removed, julienned",
+"yellow bell pepper, seeded, ribs removed and chopped",
+"yellow corn meal",
+"yellow cornmeal",
+"yellow mustard",
+"yellow onion, peeled and chopped",
+"yellow raisins",
+"yogurt",
+"Yukon Gold potatoes",
+"zucchini"
+
+ });
+ txtIngredientText.AutoCompleteCustomSource = ingredientAutoComplete;
+ }
+
+ private void LoadImages()
+ {
+ if (!_ImagesAlreadyLoaded)
+ {
+ _allButtonImagesList = new ImageList();
+ _allButtonImagesList.ImageSize = btnDelete.ClientSize;
+ _allButtonImagesList.Images.Clear();
+ _allButtonImagesList.Images.Add(Properties.Resources.Bar0);
+ _allButtonImagesList.Images.Add(Properties.Resources.Bar1);
+ _allButtonImagesList.Images.Add(Properties.Resources.Bar2);
+ _allButtonImagesList.Images.Add(Properties.Resources.Bar3);
+ _allButtonImagesList.Images.Add(Properties.Resources.Bar4);
+ _allButtonImagesList.Images.Add(Properties.Resources.Delete);
+ _allButtonImagesList.Images.Add(Properties.Resources.Heading);
+ _allButtonImagesList.Images.Add(Properties.Resources.NotHeading);
+ _allButtonImagesList.Images.SetKeyName(0, INGREDIENT_LINK_IMAGE_BAR0);
+ _allButtonImagesList.Images.SetKeyName(1, INGREDIENT_LINK_IMAGE_BAR1);
+ _allButtonImagesList.Images.SetKeyName(2, INGREDIENT_LINK_IMAGE_BAR2);
+ _allButtonImagesList.Images.SetKeyName(3, INGREDIENT_LINK_IMAGE_BAR3);
+ _allButtonImagesList.Images.SetKeyName(4, INGREDIENT_LINK_IMAGE_BAR4);
+ _allButtonImagesList.Images.SetKeyName(5, DELETE_IMAGE);
+ _allButtonImagesList.Images.SetKeyName(6, HEADING_IMAGE);
+ _allButtonImagesList.Images.SetKeyName(7, NOT_HEADING_IMAGE);
+
+ _allHandleImagesList = new ImageList();
+
+ double handleWidthToHeightRatio = (double)(Properties.Resources.Handle.Width) / (double)(Properties.Resources.Handle.Height);
+ int handleWidth = (int)((double)(btnHeading.Left) * 0.75);
+ int handleHeight = (int)((double)(handleWidth) / handleWidthToHeightRatio);
+ _allHandleImagesList.ImageSize = new Size(handleWidth, handleHeight);
+ _allHandleImagesList.Images.Clear();
+ //_allHandleImagesList.Images.Add(imgImageHandleList.Images[0]);
+ _allHandleImagesList.Images.Add(Properties.Resources.Handle);
+ _allHandleImagesList.Images.SetKeyName(0, HANDLE_IMAGE);
+
+ _ImagesAlreadyLoaded = true;
+ }
+
+ this.btnDelete.ImageList = _allButtonImagesList;
+ this.btnDelete.ImageKey = DELETE_IMAGE;
+ this.btnHeading.ImageList = _allButtonImagesList;
+ this.btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ this.btnIngredientLink.ImageList = _allButtonImagesList;
+ this.btnIngredientLink.ImageKey = INGREDIENT_LINK_IMAGE_BAR0;
+
+
+ }
+ }
+}
diff --git a/JRCookbookControls/JRCookbookEditRecipeIngredient.resx b/JRCookbookControls/JRCookbookEditRecipeIngredient.resx
new file mode 100644
index 0000000..56cd609
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditRecipeIngredient.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 118, 17
+
+
+ 118, 17
+
+
\ No newline at end of file
diff --git a/JRCookbookControls/JRCookbookEditTip.Designer.cs b/JRCookbookControls/JRCookbookEditTip.Designer.cs
new file mode 100644
index 0000000..454391b
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditTip.Designer.cs
@@ -0,0 +1,100 @@
+
+namespace JRCookbookControls
+{
+ partial class JRCookbookEditTip
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ components = new System.ComponentModel.Container();
+ txtTipText = new JRCookbookAutoVerticalGrowTextBox();
+ btnHeading = new System.Windows.Forms.Button();
+ btnDelete = new System.Windows.Forms.Button();
+ toolTip1 = new System.Windows.Forms.ToolTip(components);
+ SuspendLayout();
+ //
+ // txtTipText
+ //
+ txtTipText.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
+ txtTipText.Location = new System.Drawing.Point(112, 3);
+ txtTipText.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ txtTipText.MinCharactersToMultiLine = 0;
+ txtTipText.Multiline = true;
+ txtTipText.Name = "txtTipText";
+ txtTipText.Size = new System.Drawing.Size(1461, 47);
+ txtTipText.TabIndex = 0;
+ txtTipText.TextChanged += txtTipText_TextChanged;
+ //
+ // btnHeading
+ //
+ btnHeading.ImageKey = "(none)";
+ btnHeading.Location = new System.Drawing.Point(43, 3);
+ btnHeading.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ btnHeading.Name = "btnHeading";
+ btnHeading.Size = new System.Drawing.Size(56, 63);
+ btnHeading.TabIndex = 2;
+ toolTip1.SetToolTip(btnHeading, "Toggle Header");
+ btnHeading.UseVisualStyleBackColor = true;
+ btnHeading.Click += btnHeading_Click;
+ //
+ // btnDelete
+ //
+ btnDelete.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
+ btnDelete.ImageKey = "(none)";
+ btnDelete.Location = new System.Drawing.Point(1591, 3);
+ btnDelete.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ btnDelete.Name = "btnDelete";
+ btnDelete.Size = new System.Drawing.Size(56, 63);
+ btnDelete.TabIndex = 1;
+ toolTip1.SetToolTip(btnDelete, "Delete");
+ btnDelete.UseVisualStyleBackColor = true;
+ btnDelete.Visible = false;
+ btnDelete.Click += btnDelete_Click;
+ //
+ // JRCookbookEditTip
+ //
+ AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
+ AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ AutoSize = true;
+ BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
+ Controls.Add(txtTipText);
+ Controls.Add(btnHeading);
+ Controls.Add(btnDelete);
+ Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ Name = "JRCookbookEditTip";
+ Size = new System.Drawing.Size(1647, 134);
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ #endregion
+
+ private JRCookbookAutoVerticalGrowTextBox txtTipText;
+ private System.Windows.Forms.Button btnHeading;
+ private System.Windows.Forms.Button btnDelete;
+ private System.Windows.Forms.ToolTip toolTip1;
+ }
+}
diff --git a/JRCookbookControls/JRCookbookEditTip.cs b/JRCookbookControls/JRCookbookEditTip.cs
new file mode 100644
index 0000000..db4bae6
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditTip.cs
@@ -0,0 +1,247 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using JRCookbookBusiness;
+
+namespace JRCookbookControls
+{
+ public partial class JRCookbookEditTip : UserControl
+ {
+ private RecipeTip _recipeTip;
+ private bool _DeleteAllowed = true;
+ private bool _IsEmptyValue = true;
+ public event EventHandler DeleteRequested;
+ public event EventHandler IsEmpty_Changed;
+
+ private static ImageList _allButtonImagesList = new ImageList();
+ private static ImageList _allHandleImagesList = new ImageList();
+ private static bool _ImagesAlreadyLoaded = false;
+
+ private static Point _HandleLocationPoint = new Point(0, 0);
+ private static bool _isHandleLocationSet = false;
+
+ private const string HEADING_IMAGE = "Heading.bmp";
+ private const string NOT_HEADING_IMAGE = "NotHeading.bmp";
+ private const string DELETE_IMAGE = "Delete.bmp";
+ private const string HANDLE_IMAGE = "Handle.bmp";
+
+ public JRCookbookEditTip()
+ {
+ InitializeComponent();
+ LoadImages();
+ }
+
+ public JRCookbookEditTip(RecipeTip TipToEdit)
+ {
+ InitializeComponent();
+ LoadImages();
+ recipeTip = TipToEdit;
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public RecipeTip recipeTip
+ {
+ get
+ {
+ return _recipeTip;
+ }
+ set
+ {
+ _recipeTip = value;
+ LoadControlFromObject();
+ }
+ }
+
+ public bool IsEmpty
+ {
+ get
+ {
+ return _IsEmptyValue;
+ }
+ }
+
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public bool DeleteAllowed
+ {
+ get
+ {
+ return _DeleteAllowed;
+ }
+ set
+ {
+ _DeleteAllowed = value;
+ btnDelete.Enabled = _DeleteAllowed;
+ }
+ }
+
+ private void btnDelete_Click(object sender, EventArgs e)
+ {
+ if (this.DeleteRequested != null)
+ this.DeleteRequested(this, new EventArgs());
+ }
+
+ private void LoadControlFromObject()
+ {
+ if (_recipeTip == null)
+ {
+ txtTipText.Text = string.Empty;
+ txtTipText.Font = new Font(txtTipText.Font, FontStyle.Regular);
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ }
+ else
+ {
+ txtTipText.Text = _recipeTip.tipText;
+ if (_recipeTip.isHeading)
+ {
+ txtTipText.Font = new Font(txtTipText.Font, FontStyle.Bold);
+ btnHeading.ImageKey = HEADING_IMAGE;
+ }
+ else
+ {
+ txtTipText.Font = new Font(txtTipText.Font, FontStyle.Regular);
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ }
+ }
+ }
+
+ private void btnHeading_Click(object sender, EventArgs e)
+ {
+ if(_recipeTip != null)
+ {
+ _recipeTip.isHeading = !_recipeTip.isHeading;
+ }
+ LoadControlFromObject();
+ }
+
+ private void txtTipText_TextChanged(object sender, EventArgs e)
+ {
+ _recipeTip.tipText = txtTipText.Text;
+ CheckForData();
+ }
+
+ private void CheckForData()
+ {
+ var blnNewIsEmpty = true;
+
+ if (txtTipText.Text.Trim() != String.Empty)
+ {
+ blnNewIsEmpty = false;
+ }
+
+ if (_recipeTip.isHeading)
+ {
+ btnHeading.ImageKey = HEADING_IMAGE;
+ }
+ else
+ {
+ btnHeading.ImageKey = NOT_HEADING_IMAGE;
+ }
+
+
+ if (blnNewIsEmpty != _IsEmptyValue)
+ {
+ _IsEmptyValue = blnNewIsEmpty;
+
+ if (blnNewIsEmpty)
+ {
+ btnDelete.Visible = false;
+ }
+ else
+ {
+ btnDelete.Visible = true;
+ }
+
+ if (this.IsEmpty_Changed != null)
+ this.IsEmpty_Changed(this, new EventArgs());
+ }
+ }
+
+
+ public void ShowInsertionBar(JRCookbookControls.InsertLocation insertLocation)
+ {
+ modSharedRoutines.ShowInsertionBar(this, insertLocation);
+ }
+
+ public void HideInsertionBar()
+ {
+ modSharedRoutines.HideInsertionBar(this);
+ }
+
+ public void DragStarted()
+ {
+ modSharedRoutines.DragStarted(this);
+ }
+
+ public void DragEnded()
+ {
+ modSharedRoutines.DragEnded(this);
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ // If there is an image and it has a location,
+ // paint it when the Form is repainted.
+ base.OnPaint(e);
+
+ Image myBackgroundImage = _allHandleImagesList.Images[HANDLE_IMAGE];
+
+ if (!_isHandleLocationSet)
+ {
+ _isHandleLocationSet = true;
+
+ int verticalMidpointImage = myBackgroundImage.Height / 2;
+ int verticalMidpointButton = btnHeading.Height / 2;
+ int newTop = verticalMidpointButton - verticalMidpointImage + btnHeading.Top;
+
+ _HandleLocationPoint = new Point(0, newTop);
+ }
+
+
+ e.Graphics.DrawImage(myBackgroundImage, _HandleLocationPoint.X, _HandleLocationPoint.Y, new Rectangle(0, 0, myBackgroundImage.Width, myBackgroundImage.Height), GraphicsUnit.Pixel);
+
+ }
+
+ private void LoadImages()
+ {
+ if (!_ImagesAlreadyLoaded)
+ {
+ _allButtonImagesList = new ImageList();
+ _allButtonImagesList.ImageSize = btnDelete.ClientSize;
+ _allButtonImagesList.Images.Clear();
+ _allButtonImagesList.Images.Add(Properties.Resources.Delete);
+ _allButtonImagesList.Images.Add(Properties.Resources.Heading);
+ _allButtonImagesList.Images.Add(Properties.Resources.NotHeading);
+ _allButtonImagesList.Images.SetKeyName(0, DELETE_IMAGE);
+ _allButtonImagesList.Images.SetKeyName(1, HEADING_IMAGE);
+ _allButtonImagesList.Images.SetKeyName(2, NOT_HEADING_IMAGE);
+
+ _allHandleImagesList = new ImageList();
+
+ double handleWidthToHeightRatio = (double)(Properties.Resources.Handle.Width) / (double)(Properties.Resources.Handle.Height);
+ int handleWidth = (int)((double)(btnHeading.Left) * 0.75);
+ int handleHeight = (int)((double)(handleWidth) / handleWidthToHeightRatio);
+ _allHandleImagesList.ImageSize = new Size(handleWidth, handleHeight);
+ _allHandleImagesList.Images.Clear();
+ _allHandleImagesList.Images.Add(Properties.Resources.Handle);
+ _allHandleImagesList.Images.SetKeyName(0, HANDLE_IMAGE);
+
+ _ImagesAlreadyLoaded = true;
+ }
+
+ this.btnDelete.ImageList = _allButtonImagesList;
+ this.btnDelete.ImageKey = DELETE_IMAGE;
+ this.btnHeading.ImageList = _allButtonImagesList;
+ this.btnHeading.ImageKey = NOT_HEADING_IMAGE;
+
+
+ }
+
+ }
+}
diff --git a/JRCookbookControls/JRCookbookEditTip.resx b/JRCookbookControls/JRCookbookEditTip.resx
new file mode 100644
index 0000000..b3502c9
--- /dev/null
+++ b/JRCookbookControls/JRCookbookEditTip.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 118, 17
+
+
\ No newline at end of file
diff --git a/JRCookbookControls/JRCookbookMaskedTextBox.cs b/JRCookbookControls/JRCookbookMaskedTextBox.cs
new file mode 100644
index 0000000..8892ba1
--- /dev/null
+++ b/JRCookbookControls/JRCookbookMaskedTextBox.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace JRCookbookControls
+{
+ public class JRCookbookMaskedTextBox: System.Windows.Forms.MaskedTextBox
+ {
+ private bool _blnMaskFullOnEnter = false;
+ private bool _blnAutoTab = false;
+
+ public JRCookbookMaskedTextBox()
+ {
+ this.Enter += new System.EventHandler(this.MaskedTextBox_Enter);
+ this.TextChanged += new System.EventHandler(this.MaskedTextBox_TextChanged);
+
+
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public bool AutoTab
+ {
+ get
+ {
+ return _blnAutoTab;
+ }
+ set
+ {
+ _blnAutoTab = value;
+ }
+ }
+
+ private void MaskedTextBox_Enter(System.Object sender, System.EventArgs eventArgs)
+ {
+ _blnMaskFullOnEnter = this.MaskFull;
+ }
+
+ private void MaskedTextBox_TextChanged(System.Object sender, System.EventArgs eventArgs)
+ {
+ //Auto-tab if the mask is full
+ if (AutoTab)
+ {
+ if (_blnMaskFullOnEnter == false)
+ {
+ if (this.Focused)
+ {
+ if (this.MaskFull)
+ {
+ this.Parent.SelectNextControl(this, true, true, true, true);
+ }
+ }
+ }
+ }
+ }
+
+ }
+}
diff --git a/JRCookbookControls/JRCookbookNumericTextBox.cs b/JRCookbookControls/JRCookbookNumericTextBox.cs
new file mode 100644
index 0000000..cf5a221
--- /dev/null
+++ b/JRCookbookControls/JRCookbookNumericTextBox.cs
@@ -0,0 +1,158 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace JRCookbookControls
+{
+ [System.Serializable()]
+ public class JRCookbookNumericTextBox: TextBox
+ {
+ private String _strLastValue = String.Empty;
+ private bool _blnAllowNegative = true;
+ private bool _blnAllowDecimal = true;
+ private bool _blnAllowEmpty = true;
+
+ public JRCookbookNumericTextBox()
+ {
+ this.TextChanged += new System.EventHandler(this.NumericTextBox_TextChanged);
+ this.Validating += new System.ComponentModel.CancelEventHandler(this.NumericTextBox_Validating);
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public bool AllowDecimal
+ {
+ get
+ {
+ return _blnAllowDecimal;
+ }
+ set
+ {
+ _blnAllowDecimal = value;
+ }
+
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public bool AllowNegative
+ {
+ get
+ {
+ return _blnAllowNegative;
+ }
+ set
+ {
+ _blnAllowNegative = value;
+ }
+
+ }
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public bool AllowEmpty
+ {
+ get
+ {
+ return _blnAllowEmpty;
+ }
+ set
+ {
+ _blnAllowEmpty = value;
+ }
+
+ }
+
+ private void NumericTextBox_TextChanged(System.Object sender, System.EventArgs e)
+ {
+ bool blnValueIsOK = true;
+ Int32 intPosition = 0;
+ bool blnAlreadySeenDecimal = false;
+
+ //Allow digits, one decimal point, and minus sign (if first character only)
+ foreach (char chrCharacter in this.Text)
+ {
+ switch (chrCharacter)
+ {
+ case char x when (x >= '0' && x <= '9'):
+ //OK
+ break;
+ case '-':
+ if (intPosition > 0 || AllowNegative == false)
+ {
+ blnValueIsOK = false;
+ }
+ break;
+ case '.':
+ if (blnAlreadySeenDecimal)
+ {
+ blnValueIsOK = false;
+ }
+ else
+ {
+ blnAlreadySeenDecimal = true;
+ }
+ break;
+ default:
+ blnValueIsOK = false;
+ break;
+ }
+
+ intPosition += 1;
+
+ if (!blnValueIsOK)
+ {
+ break;
+ }
+
+ }
+
+ if (blnValueIsOK)
+ {
+ _strLastValue = this.Text;
+ }
+ else
+ {
+ Int32 oldSelectionStart = this.SelectionStart - 1;
+ this.Text = _strLastValue;
+ if (oldSelectionStart >= 0 && oldSelectionStart <= this.Text.Length)
+ {
+ this.SelectionStart = oldSelectionStart;
+ }
+ }
+
+ }
+
+ private void NumericTextBox_Validating(System.Object sender, System.ComponentModel.CancelEventArgs e)
+ {
+ if (this.Text == String.Empty)
+ {
+ if (AllowEmpty)
+ {
+ return;
+ }
+ else
+ {
+ e.Cancel = true;
+ }
+ }
+
+ //Now that we know it's not empty, make sure we have a digit
+ foreach (char chrCharacter in this.Text)
+ {
+ switch (chrCharacter)
+ {
+ case char x when (x >= '0' && x <= '9'):
+ //OK
+ return;
+ }
+ }
+
+ //If we got here, we have hyphen or period, but no digits
+ e.Cancel = true;
+ }
+
+ }
+
+}
diff --git a/JRCookbookControls/JRCookbookStrongNameKey.snk b/JRCookbookControls/JRCookbookStrongNameKey.snk
new file mode 100644
index 0000000..4ae9cf8
Binary files /dev/null and b/JRCookbookControls/JRCookbookStrongNameKey.snk differ
diff --git a/JRCookbookControls/NotHeading.bmp b/JRCookbookControls/NotHeading.bmp
new file mode 100644
index 0000000..6ddf02f
Binary files /dev/null and b/JRCookbookControls/NotHeading.bmp differ
diff --git a/JRCookbookControls/Properties/Resources.Designer.cs b/JRCookbookControls/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..e8d4b40
--- /dev/null
+++ b/JRCookbookControls/Properties/Resources.Designer.cs
@@ -0,0 +1,153 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace JRCookbookControls.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JRCookbookControls.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Bar0 {
+ get {
+ object obj = ResourceManager.GetObject("Bar0", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Bar1 {
+ get {
+ object obj = ResourceManager.GetObject("Bar1", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Bar2 {
+ get {
+ object obj = ResourceManager.GetObject("Bar2", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Bar3 {
+ get {
+ object obj = ResourceManager.GetObject("Bar3", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Bar4 {
+ get {
+ object obj = ResourceManager.GetObject("Bar4", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Delete {
+ get {
+ object obj = ResourceManager.GetObject("Delete", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Handle {
+ get {
+ object obj = ResourceManager.GetObject("Handle", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Heading {
+ get {
+ object obj = ResourceManager.GetObject("Heading", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap NotHeading {
+ get {
+ object obj = ResourceManager.GetObject("NotHeading", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/JRCookbookControls/Properties/Resources.resx b/JRCookbookControls/Properties/Resources.resx
new file mode 100644
index 0000000..64c16bf
--- /dev/null
+++ b/JRCookbookControls/Properties/Resources.resx
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Bar0.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Bar1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Bar2.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Bar3.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Bar4.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Delete.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Handle.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Heading.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\NotHeading.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/JRCookbookControls/Search.BMP b/JRCookbookControls/Search.BMP
new file mode 100644
index 0000000..18c8408
Binary files /dev/null and b/JRCookbookControls/Search.BMP differ
diff --git a/JRCookbookControls/modSharedRoutines.cs b/JRCookbookControls/modSharedRoutines.cs
new file mode 100644
index 0000000..0b4c345
--- /dev/null
+++ b/JRCookbookControls/modSharedRoutines.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace JRCookbookControls
+{
+
+ internal static class modSharedRoutines
+ {
+ internal static void ShowInsertionBar(Control control, JRCookbookControls.InsertLocation insertLocation)
+ {
+ if (insertLocation == InsertLocation.InsertBefore)
+ {
+ DrawLine(control, 0, 0, control.Width - 1, 0, System.Drawing.SystemColors.MenuHighlight);
+ }
+ else if (insertLocation == InsertLocation.InsertAfter)
+ {
+ DrawLine(control, 0, control.Height - 1, control.Width - 1, control.Height - 1, System.Drawing.SystemColors.MenuHighlight);
+ }
+ }
+
+ internal static void HideInsertionBar(Control control)
+ {
+ DrawLine(control, 0, 0, control.Width - 1, 0, System.Drawing.SystemColors.Control);
+ DrawLine(control, 0, control.Height - 1, control.Width - 1, control.Height - 1, System.Drawing.SystemColors.Control);
+ }
+
+ internal static void DragStarted(Control control)
+ {
+ control.BackColor = System.Drawing.SystemColors.MenuHighlight;
+ }
+
+ internal static void DragEnded(Control control)
+ {
+ control.BackColor = System.Drawing.SystemColors.Control;
+ }
+
+ private static void DrawLine(Control control, int x1, int y1, int x2, int y2, Color color)
+ {
+ System.Drawing.Pen myPen;
+ myPen = new System.Drawing.Pen(color, 1);
+ System.Drawing.Graphics line = control.CreateGraphics();
+ line.DrawLine(myPen, x1, y1, x2, y2);
+
+ //control.Refresh();
+
+ myPen.Dispose();
+ line.Dispose();
+ }
+
+ }
+}
|