Browse Source

Commit

master
ocsnetworks 2 years ago
commit
aa934ac9d5
  1. 24
      Gourmet Recipe Book.sln
  2. BIN
      Gourmet Recipe Book.suo
  3. 426
      Gourmet Recipe Book/AddRecipe.Designer.cs
  4. 68
      Gourmet Recipe Book/AddRecipe.cs
  5. 3498
      Gourmet Recipe Book/AddRecipe.resx
  6. 129
      Gourmet Recipe Book/BackupandRestore.Designer.cs
  7. 85
      Gourmet Recipe Book/BackupandRestore.cs
  8. 3495
      Gourmet Recipe Book/BackupandRestore.resx
  9. 449
      Gourmet Recipe Book/EditRecipe.Designer.cs
  10. 114
      Gourmet Recipe Book/EditRecipe.cs
  11. 123
      Gourmet Recipe Book/EditRecipe.resx
  12. 152
      Gourmet Recipe Book/Gourmet Recipe Book.csproj
  13. 187
      Gourmet Recipe Book/Help.Designer.cs
  14. 19
      Gourmet Recipe Book/Help.cs
  15. 3511
      Gourmet Recipe Book/Help.resx
  16. 320
      Gourmet Recipe Book/MainMenu.Designer.cs
  17. 314
      Gourmet Recipe Book/MainMenu.cs
  18. 3614
      Gourmet Recipe Book/MainMenu.resx
  19. 21
      Gourmet Recipe Book/Program.cs
  20. 36
      Gourmet Recipe Book/Properties/AssemblyInfo.cs
  21. 63
      Gourmet Recipe Book/Properties/Resources.Designer.cs
  22. 117
      Gourmet Recipe Book/Properties/Resources.resx
  23. 26
      Gourmet Recipe Book/Properties/Settings.Designer.cs
  24. 7
      Gourmet Recipe Book/Properties/Settings.settings
  25. 420
      Gourmet Recipe Book/RecipeCard.Designer.cs
  26. 325
      Gourmet Recipe Book/RecipeCard.cs
  27. 4242
      Gourmet Recipe Book/RecipeCard.resx
  28. 98
      Gourmet Recipe Book/Splash.Designer.cs
  29. 39
      Gourmet Recipe Book/Splash.cs
  30. 3783
      Gourmet Recipe Book/Splash.resx
  31. BIN
      Gourmet Recipe Book/Thumbs.db
  32. 3
      Gourmet Recipe Book/app.config
  33. BIN
      Gourmet Recipe Book/bin/Debug/Gourmet Recipe Book.exe
  34. 3
      Gourmet Recipe Book/bin/Debug/Gourmet Recipe Book.exe.config
  35. BIN
      Gourmet Recipe Book/bin/Debug/Gourmet Recipe Book.pdb
  36. BIN
      Gourmet Recipe Book/bin/Debug/Gourmet Recipe Book.vshost.exe
  37. 3
      Gourmet Recipe Book/bin/Debug/Gourmet Recipe Book.vshost.exe.config
  38. 11
      Gourmet Recipe Book/bin/Debug/Gourmet Recipe Book.vshost.exe.manifest
  39. BIN
      Gourmet Recipe Book/bin/Debug/MetroFramework.dll
  40. BIN
      Gourmet Recipe Book/bin/Debug/System.Data.SQLite.DLL
  41. BIN
      Gourmet Recipe Book/bin/Debug/recipedb.db
  42. BIN
      Gourmet Recipe Book/bin/Release/Gourmet Recipe Book.exe
  43. 3
      Gourmet Recipe Book/bin/Release/Gourmet Recipe Book.exe.config
  44. BIN
      Gourmet Recipe Book/bin/Release/Gourmet Recipe Book.pdb
  45. BIN
      Gourmet Recipe Book/bin/Release/Gourmet Recipe Book.vshost.exe
  46. BIN
      Gourmet Recipe Book/bin/Release/MetroFramework.dll
  47. BIN
      Gourmet Recipe Book/bin/Release/System.Data.SQLite.DLL
  48. BIN
      Gourmet Recipe Book/bin/Release/recipedb.db
  49. BIN
      Gourmet Recipe Book/help.ico
  50. BIN
      Gourmet Recipe Book/icon - Copy.ico
  51. BIN
      Gourmet Recipe Book/icon.ico
  52. BIN
      Gourmet Recipe Book/icon.png
  53. BIN
      Gourmet Recipe Book/libs/Metro/MetroFramework.Design.dll
  54. BIN
      Gourmet Recipe Book/libs/Metro/MetroFramework.Fonts.dll
  55. BIN
      Gourmet Recipe Book/libs/Metro/MetroFramework.dll
  56. BIN
      Gourmet Recipe Book/libs/System.Data.SQLite.DLL
  57. BIN
      Gourmet Recipe Book/libs/soundrecorder1.png
  58. BIN
      Gourmet Recipe Book/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
  59. BIN
      Gourmet Recipe Book/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  60. 16
      Gourmet Recipe Book/obj/x86/Debug/Gourmet Recipe Book.csproj.FileListAbsolute.txt
  61. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet Recipe Book.csproj.GenerateResource.Cache
  62. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet Recipe Book.exe
  63. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet Recipe Book.pdb
  64. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.AddRecipe.resources
  65. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.BackupandRestore.resources
  66. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.EditRecipe.resources
  67. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.Help.resources
  68. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.MainMenu.resources
  69. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.Properties.Resources.resources
  70. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.RecipeCard.resources
  71. BIN
      Gourmet Recipe Book/obj/x86/Debug/Gourmet_Recipe_Book.Splash.resources
  72. BIN
      Gourmet Recipe Book/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll
  73. BIN
      Gourmet Recipe Book/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache
  74. 16
      Gourmet Recipe Book/obj/x86/Release/Gourmet Recipe Book.csproj.FileListAbsolute.txt
  75. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet Recipe Book.csproj.GenerateResource.Cache
  76. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet Recipe Book.exe
  77. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet Recipe Book.pdb
  78. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.AddRecipe.resources
  79. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.BackupandRestore.resources
  80. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.EditRecipe.resources
  81. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.Help.resources
  82. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.MainMenu.resources
  83. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.Properties.Resources.resources
  84. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.RecipeCard.resources
  85. BIN
      Gourmet Recipe Book/obj/x86/Release/Gourmet_Recipe_Book.Splash.resources
  86. BIN
      Gourmet Recipe Book/obj/x86/Release/TempPE/Properties.Resources.Designer.cs.dll
  87. BIN
      Gourmet Recipe Book/print.ico
  88. 851
      GourmetRecipeBookInstaller/GourmetRecipeBookInstaller.vdproj
  89. BIN
      GourmetRecipeBookInstaller/Release/GourmetRecipeBookInstaller.msi
  90. BIN
      GourmetRecipeBookInstaller/Release/setup.exe

24
Gourmet Recipe Book.sln

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gourmet Recipe Book", "Gourmet Recipe Book\Gourmet Recipe Book.csproj", "{7A2E9150-56B4-4284-8571-EE38FD40431A}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "GourmetRecipeBookInstaller", "GourmetRecipeBookInstaller\GourmetRecipeBookInstaller.vdproj", "{DB6786C9-8408-477D-842E-462D4D12C86C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A2E9150-56B4-4284-8571-EE38FD40431A}.Debug|x86.ActiveCfg = Debug|x86
{7A2E9150-56B4-4284-8571-EE38FD40431A}.Debug|x86.Build.0 = Debug|x86
{7A2E9150-56B4-4284-8571-EE38FD40431A}.Release|x86.ActiveCfg = Release|x86
{7A2E9150-56B4-4284-8571-EE38FD40431A}.Release|x86.Build.0 = Release|x86
{DB6786C9-8408-477D-842E-462D4D12C86C}.Debug|x86.ActiveCfg = Debug
{DB6786C9-8408-477D-842E-462D4D12C86C}.Release|x86.ActiveCfg = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

BIN
Gourmet Recipe Book.suo

Binary file not shown.

426
Gourmet Recipe Book/AddRecipe.Designer.cs generated

@ -0,0 +1,426 @@ @@ -0,0 +1,426 @@
namespace Gourmet_Recipe_Book
{
partial class AddRecipe
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddRecipe));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.label2 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.recipename = new System.Windows.Forms.TextBox();
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
this.ingredients = new System.Windows.Forms.TextBox();
this.splitContainer6 = new System.Windows.Forms.SplitContainer();
this.directions = new System.Windows.Forms.TextBox();
this.splitContainer7 = new System.Windows.Forms.SplitContainer();
this.splitContainer8 = new System.Windows.Forms.SplitContainer();
this.recipeimageloc = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.category = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.splitContainer4.Panel1.SuspendLayout();
this.splitContainer4.Panel2.SuspendLayout();
this.splitContainer4.SuspendLayout();
this.splitContainer5.Panel1.SuspendLayout();
this.splitContainer5.Panel2.SuspendLayout();
this.splitContainer5.SuspendLayout();
this.splitContainer6.Panel1.SuspendLayout();
this.splitContainer6.Panel2.SuspendLayout();
this.splitContainer6.SuspendLayout();
this.splitContainer7.Panel1.SuspendLayout();
this.splitContainer7.Panel2.SuspendLayout();
this.splitContainer7.SuspendLayout();
this.splitContainer8.Panel1.SuspendLayout();
this.splitContainer8.Panel2.SuspendLayout();
this.splitContainer8.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.IsSplitterFixed = true;
this.splitContainer1.Location = new System.Drawing.Point(20, 60);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer4);
this.splitContainer1.Size = new System.Drawing.Size(666, 519);
this.splitContainer1.SplitterDistance = 150;
this.splitContainer1.TabIndex = 0;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.IsSplitterFixed = true;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.label1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(150, 519);
this.splitContainer2.SplitterDistance = 27;
this.splitContainer2.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(17, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(121, 27);
this.label1.TabIndex = 11;
this.label1.Text = "Recipe Name";
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.label2);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.label4);
this.splitContainer3.Panel2.Controls.Add(this.label3);
this.splitContainer3.Size = new System.Drawing.Size(150, 488);
this.splitContainer3.SplitterDistance = 217;
this.splitContainer3.TabIndex = 0;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(25, 8);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(103, 27);
this.label2.TabIndex = 14;
this.label2.Text = "Ingredients";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.Location = new System.Drawing.Point(33, 218);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(85, 27);
this.label4.TabIndex = 16;
this.label4.Text = "Category";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(30, 15);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(98, 27);
this.label3.TabIndex = 15;
this.label3.Text = "Directions";
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.IsSplitterFixed = true;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
this.splitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.recipename);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.splitContainer5);
this.splitContainer4.Size = new System.Drawing.Size(512, 519);
this.splitContainer4.SplitterDistance = 25;
this.splitContainer4.TabIndex = 0;
//
// recipename
//
this.recipename.Dock = System.Windows.Forms.DockStyle.Fill;
this.recipename.Location = new System.Drawing.Point(0, 0);
this.recipename.Name = "recipename";
this.recipename.Size = new System.Drawing.Size(512, 20);
this.recipename.TabIndex = 0;
//
// splitContainer5
//
this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer5.IsSplitterFixed = true;
this.splitContainer5.Location = new System.Drawing.Point(0, 0);
this.splitContainer5.Name = "splitContainer5";
this.splitContainer5.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer5.Panel1
//
this.splitContainer5.Panel1.Controls.Add(this.ingredients);
//
// splitContainer5.Panel2
//
this.splitContainer5.Panel2.Controls.Add(this.splitContainer6);
this.splitContainer5.Size = new System.Drawing.Size(512, 490);
this.splitContainer5.SplitterDistance = 218;
this.splitContainer5.TabIndex = 0;
//
// ingredients
//
this.ingredients.Dock = System.Windows.Forms.DockStyle.Fill;
this.ingredients.Location = new System.Drawing.Point(0, 0);
this.ingredients.Multiline = true;
this.ingredients.Name = "ingredients";
this.ingredients.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.ingredients.Size = new System.Drawing.Size(512, 218);
this.ingredients.TabIndex = 12;
//
// splitContainer6
//
this.splitContainer6.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer6.IsSplitterFixed = true;
this.splitContainer6.Location = new System.Drawing.Point(0, 0);
this.splitContainer6.Name = "splitContainer6";
this.splitContainer6.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer6.Panel1
//
this.splitContainer6.Panel1.Controls.Add(this.directions);
//
// splitContainer6.Panel2
//
this.splitContainer6.Panel2.Controls.Add(this.splitContainer7);
this.splitContainer6.Size = new System.Drawing.Size(512, 268);
this.splitContainer6.SplitterDistance = 174;
this.splitContainer6.TabIndex = 0;
//
// directions
//
this.directions.Dock = System.Windows.Forms.DockStyle.Fill;
this.directions.Location = new System.Drawing.Point(0, 0);
this.directions.Multiline = true;
this.directions.Name = "directions";
this.directions.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.directions.Size = new System.Drawing.Size(512, 174);
this.directions.TabIndex = 13;
//
// splitContainer7
//
this.splitContainer7.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer7.IsSplitterFixed = true;
this.splitContainer7.Location = new System.Drawing.Point(0, 0);
this.splitContainer7.Name = "splitContainer7";
this.splitContainer7.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer7.Panel1
//
this.splitContainer7.Panel1.Controls.Add(this.splitContainer8);
//
// splitContainer7.Panel2
//
this.splitContainer7.Panel2.Controls.Add(this.category);
this.splitContainer7.Panel2.Controls.Add(this.button1);
this.splitContainer7.Size = new System.Drawing.Size(512, 90);
this.splitContainer7.SplitterDistance = 25;
this.splitContainer7.TabIndex = 0;
//
// splitContainer8
//
this.splitContainer8.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer8.IsSplitterFixed = true;
this.splitContainer8.Location = new System.Drawing.Point(0, 0);
this.splitContainer8.Name = "splitContainer8";
//
// splitContainer8.Panel1
//
this.splitContainer8.Panel1.Controls.Add(this.recipeimageloc);
//
// splitContainer8.Panel2
//
this.splitContainer8.Panel2.Controls.Add(this.button2);
this.splitContainer8.Size = new System.Drawing.Size(512, 25);
this.splitContainer8.SplitterDistance = 345;
this.splitContainer8.TabIndex = 0;
//
// recipeimageloc
//
this.recipeimageloc.Dock = System.Windows.Forms.DockStyle.Fill;
this.recipeimageloc.Location = new System.Drawing.Point(0, 0);
this.recipeimageloc.Name = "recipeimageloc";
this.recipeimageloc.ReadOnly = true;
this.recipeimageloc.Size = new System.Drawing.Size(345, 20);
this.recipeimageloc.TabIndex = 16;
//
// button2
//
this.button2.Location = new System.Drawing.Point(2, 0);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(113, 23);
this.button2.TabIndex = 17;
this.button2.Text = "Browse Images";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// category
//
this.category.FormattingEnabled = true;
this.category.Items.AddRange(new object[] {
"Appetizers",
"Breads",
"Breakfast",
"Desserts",
"Dips",
"Drinks",
"Holiday Cooking",
"Italian",
"Meat/Poultry",
"Misc",
"Pastas",
"Salads",
"Seafood",
"Soups",
"Vegetables",
"Vegetarian"});
this.category.Location = new System.Drawing.Point(38, 22);
this.category.Name = "category";
this.category.Size = new System.Drawing.Size(200, 21);
this.category.TabIndex = 9;
//
// button1
//
this.button1.Location = new System.Drawing.Point(291, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(98, 38);
this.button1.TabIndex = 10;
this.button1.Text = "Add Recipe";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// openFileDialog
//
this.openFileDialog.FileName = "openFileDialog";
//
// AddRecipe
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(706, 599);
this.Controls.Add(this.splitContainer1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "AddRecipe";
this.Style = MetroFramework.MetroColorStyle.Red;
this.Text = "Add Recipe";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel1.PerformLayout();
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel1.PerformLayout();
this.splitContainer3.Panel2.ResumeLayout(false);
this.splitContainer3.Panel2.PerformLayout();
this.splitContainer3.ResumeLayout(false);
this.splitContainer4.Panel1.ResumeLayout(false);
this.splitContainer4.Panel1.PerformLayout();
this.splitContainer4.Panel2.ResumeLayout(false);
this.splitContainer4.ResumeLayout(false);
this.splitContainer5.Panel1.ResumeLayout(false);
this.splitContainer5.Panel1.PerformLayout();
this.splitContainer5.Panel2.ResumeLayout(false);
this.splitContainer5.ResumeLayout(false);
this.splitContainer6.Panel1.ResumeLayout(false);
this.splitContainer6.Panel1.PerformLayout();
this.splitContainer6.Panel2.ResumeLayout(false);
this.splitContainer6.ResumeLayout(false);
this.splitContainer7.Panel1.ResumeLayout(false);
this.splitContainer7.Panel2.ResumeLayout(false);
this.splitContainer7.ResumeLayout(false);
this.splitContainer8.Panel1.ResumeLayout(false);
this.splitContainer8.Panel1.PerformLayout();
this.splitContainer8.Panel2.ResumeLayout(false);
this.splitContainer8.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.SplitContainer splitContainer4;
private System.Windows.Forms.TextBox recipename;
private System.Windows.Forms.SplitContainer splitContainer5;
private System.Windows.Forms.TextBox ingredients;
private System.Windows.Forms.SplitContainer splitContainer6;
private System.Windows.Forms.TextBox directions;
private System.Windows.Forms.SplitContainer splitContainer7;
private System.Windows.Forms.SplitContainer splitContainer8;
private System.Windows.Forms.TextBox recipeimageloc;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.OpenFileDialog openFileDialog;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox category;
}
}

68
Gourmet Recipe Book/AddRecipe.cs

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MetroFramework.Forms;
using System.Data.SQLite;
using System.IO;
namespace Gourmet_Recipe_Book
{
public partial class AddRecipe : MetroForm
{
private Byte[] data;
public AddRecipe()
{
InitializeComponent();
recipename.Select();
recipename.Focus();
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "All Picture Types|*.bmp;*.jpg;*.jpeg;*.png;*.gif";
dialog.InitialDirectory = @"";
dialog.Title = "Select an image for this recipe.";
if (dialog.ShowDialog() == DialogResult.OK)
{
recipeimageloc.Text = dialog.FileName;
using (FileStream stream = File.Open(dialog.FileName, FileMode.Open))
{
BinaryReader br = new BinaryReader(stream);
data = br.ReadBytes(2097152);
}
}
}
private void button1_Click(object sender, EventArgs e)
{
using (var conn = new SQLiteConnection(@"Data Source=" + Application.StartupPath + @"\recipedb.db"))
using (var cmd = conn.CreateCommand())
{
conn.Open();
cmd.CommandText = "INSERT INTO recipes (id, recipename, ingredients, directions, category, image) VALUES (null, @recipename, @ingredients, @directions, @category, @image)";
cmd.Parameters.AddWithValue("@recipename", recipename.Text);
cmd.Parameters.AddWithValue("@ingredients", ingredients.Text);
cmd.Parameters.AddWithValue("@directions", directions.Text);
//cmd.Parameters.AddWithValue("@category", category.SelectedItem.ToString());
cmd.Parameters.AddWithValue("@category", category.Text);
SQLiteParameter parameter = new SQLiteParameter("@image", System.Data.DbType.Binary);
parameter.Value = data;
cmd.Parameters.Add(parameter);
cmd.ExecuteNonQuery();
Close();
}
}
}
}

3498
Gourmet Recipe Book/AddRecipe.resx

File diff suppressed because it is too large Load Diff

129
Gourmet Recipe Book/BackupandRestore.Designer.cs generated

@ -0,0 +1,129 @@ @@ -0,0 +1,129 @@
namespace Gourmet_Recipe_Book
{
partial class BackupandRestore
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BackupandRestore));
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(35, 116);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(118, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Backup Database";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(32, 91);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(235, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Backup your Recipe Database for safe keeping.";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(32, 161);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(225, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Restore your Recipe Database from a Backup";
//
// button2
//
this.button2.Location = new System.Drawing.Point(35, 186);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(118, 23);
this.button2.TabIndex = 2;
this.button2.Text = "Restore Database";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(32, 233);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(154, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Delete All Recipes in Database";
//
// button3
//
this.button3.Location = new System.Drawing.Point(35, 258);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(118, 23);
this.button3.TabIndex = 4;
this.button3.Text = "Delete All Recipes";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// BackupandRestore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(451, 319);
this.Controls.Add(this.label3);
this.Controls.Add(this.button3);
this.Controls.Add(this.label2);
this.Controls.Add(this.button2);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "BackupandRestore";
this.Resizable = false;
this.Style = MetroFramework.MetroColorStyle.Red;
this.Text = "Backup && Restore";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button3;
}
}

85
Gourmet Recipe Book/BackupandRestore.cs

@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MetroFramework.Forms;
using System.IO;
using System.Data.SQLite;
namespace Gourmet_Recipe_Book
{
public partial class BackupandRestore : MetroForm
{
public BackupandRestore()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialogBrowse1 = new SaveFileDialog();
saveFileDialogBrowse1.Filter = "RecipeDatabase|*.ocsrdb";
saveFileDialogBrowse1.Title = "Recipe Database Backup";
saveFileDialogBrowse1.ValidateNames = false;
saveFileDialogBrowse1.ShowDialog();
if (saveFileDialogBrowse1.FileName != "")
{
string FileName = saveFileDialogBrowse1.FileName;
//essageBox.Show(FileName);
File.Copy(Application.StartupPath + @"\recipedb.db", @FileName);
MessageBox.Show("Recipe Database Backed Up.");
}
}
private void button3_Click(object sender, EventArgs e)
{
DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete ALL RECIPES?", "Delete ALL Recipe?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
using (var conn = new SQLiteConnection(@"Data Source=" + Application.StartupPath + @"\recipedb.db"))
using (var cmd = conn.CreateCommand())
{
conn.Open();
cmd.CommandText = "DELETE FROM recipes WHERE id != ''";
cmd.ExecuteNonQuery();
}
MessageBox.Show("ALL RECIPES DELETED!");
}
else if (dialogResult == DialogResult.No)
{
}
}
private void button2_Click(object sender, EventArgs e)
{
DialogResult dialogResult = MessageBox.Show("By Restoring a Previous Recipe Database, you will overwrite the current database.", "Overwrite Database?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "RecipeDatabase|*.ocsrdb";
dialog.InitialDirectory = @"";
dialog.Title = "Recipe Database Restore.";
if (dialog.ShowDialog() == DialogResult.OK)
{
string FileName = dialog.FileName;
File.Copy(@FileName, Application.StartupPath + @"\recipedb.db", true);
MessageBox.Show("Recipe Database Restored.");
}
}
else if (dialogResult == DialogResult.No)
{
}
}
}
}

3495
Gourmet Recipe Book/BackupandRestore.resx

File diff suppressed because it is too large Load Diff

449
Gourmet Recipe Book/EditRecipe.Designer.cs generated

@ -0,0 +1,449 @@ @@ -0,0 +1,449 @@
namespace Gourmet_Recipe_Book
{
partial class EditRecipe
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.category = new System.Windows.Forms.ComboBox();
this.button2 = new System.Windows.Forms.Button();
this.recipeimageloc = new System.Windows.Forms.TextBox();
this.splitContainer8 = new System.Windows.Forms.SplitContainer();
this.splitContainer7 = new System.Windows.Forms.SplitContainer();
this.button1 = new System.Windows.Forms.Button();
this.directions = new System.Windows.Forms.TextBox();
this.splitContainer6 = new System.Windows.Forms.SplitContainer();
this.ingredients = new System.Windows.Forms.TextBox();
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
this.recipename = new System.Windows.Forms.TextBox();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.label5 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer8.Panel1.SuspendLayout();
this.splitContainer8.Panel2.SuspendLayout();
this.splitContainer8.SuspendLayout();
this.splitContainer7.Panel1.SuspendLayout();
this.splitContainer7.Panel2.SuspendLayout();
this.splitContainer7.SuspendLayout();
this.splitContainer6.Panel1.SuspendLayout();
this.splitContainer6.Panel2.SuspendLayout();
this.splitContainer6.SuspendLayout();
this.splitContainer5.Panel1.SuspendLayout();
this.splitContainer5.Panel2.SuspendLayout();
this.splitContainer5.SuspendLayout();
this.splitContainer4.Panel1.SuspendLayout();
this.splitContainer4.Panel2.SuspendLayout();
this.splitContainer4.SuspendLayout();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// openFileDialog
//
this.openFileDialog.FileName = "openFileDialog";
//
// category
//
this.category.FormattingEnabled = true;
this.category.Items.AddRange(new object[] {
"Appetizers",
"Breads",
"Breakfast",
"Desserts",
"Dips",
"Drinks",
"Holiday Cooking",
"Italian",
"Meat/Poultry",
"Misc",
"Pastas",
"Salads",
"Seafood",
"Soups",
"Vegetables",
"Vegetarian"});
this.category.Location = new System.Drawing.Point(38, 22);
this.category.Name = "category";
this.category.Size = new System.Drawing.Size(200, 21);
this.category.TabIndex = 9;
//
// button2
//
this.button2.Location = new System.Drawing.Point(2, 0);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(113, 23);
this.button2.TabIndex = 17;
this.button2.Text = "Browse Images";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// recipeimageloc
//
this.recipeimageloc.Dock = System.Windows.Forms.DockStyle.Fill;
this.recipeimageloc.Location = new System.Drawing.Point(0, 0);
this.recipeimageloc.Name = "recipeimageloc";
this.recipeimageloc.ReadOnly = true;
this.recipeimageloc.Size = new System.Drawing.Size(345, 20);
this.recipeimageloc.TabIndex = 16;
//
// splitContainer8
//
this.splitContainer8.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer8.IsSplitterFixed = true;
this.splitContainer8.Location = new System.Drawing.Point(0, 0);
this.splitContainer8.Name = "splitContainer8";
//
// splitContainer8.Panel1
//
this.splitContainer8.Panel1.Controls.Add(this.recipeimageloc);
//
// splitContainer8.Panel2
//
this.splitContainer8.Panel2.Controls.Add(this.button2);
this.splitContainer8.Size = new System.Drawing.Size(512, 25);
this.splitContainer8.SplitterDistance = 345;
this.splitContainer8.TabIndex = 0;
//
// splitContainer7
//
this.splitContainer7.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer7.IsSplitterFixed = true;
this.splitContainer7.Location = new System.Drawing.Point(0, 0);
this.splitContainer7.Name = "splitContainer7";
this.splitContainer7.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer7.Panel1
//
this.splitContainer7.Panel1.Controls.Add(this.splitContainer8);
//
// splitContainer7.Panel2
//
this.splitContainer7.Panel2.Controls.Add(this.button1);
this.splitContainer7.Panel2.Controls.Add(this.category);
this.splitContainer7.Size = new System.Drawing.Size(512, 90);
this.splitContainer7.SplitterDistance = 25;
this.splitContainer7.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(291, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(98, 38);
this.button1.TabIndex = 10;
this.button1.Text = "Update Recipe";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// directions
//
this.directions.Dock = System.Windows.Forms.DockStyle.Fill;
this.directions.Location = new System.Drawing.Point(0, 0);
this.directions.Multiline = true;
this.directions.Name = "directions";
this.directions.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.directions.Size = new System.Drawing.Size(512, 174);
this.directions.TabIndex = 13;
//
// splitContainer6
//
this.splitContainer6.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer6.IsSplitterFixed = true;
this.splitContainer6.Location = new System.Drawing.Point(0, 0);
this.splitContainer6.Name = "splitContainer6";
this.splitContainer6.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer6.Panel1
//
this.splitContainer6.Panel1.Controls.Add(this.directions);
//
// splitContainer6.Panel2
//
this.splitContainer6.Panel2.Controls.Add(this.splitContainer7);
this.splitContainer6.Size = new System.Drawing.Size(512, 268);
this.splitContainer6.SplitterDistance = 174;
this.splitContainer6.TabIndex = 0;
//
// ingredients
//
this.ingredients.Dock = System.Windows.Forms.DockStyle.Fill;
this.ingredients.Location = new System.Drawing.Point(0, 0);
this.ingredients.Multiline = true;
this.ingredients.Name = "ingredients";
this.ingredients.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.ingredients.Size = new System.Drawing.Size(512, 218);
this.ingredients.TabIndex = 12;
//
// splitContainer5
//
this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer5.IsSplitterFixed = true;
this.splitContainer5.Location = new System.Drawing.Point(0, 0);
this.splitContainer5.Name = "splitContainer5";
this.splitContainer5.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer5.Panel1
//
this.splitContainer5.Panel1.Controls.Add(this.ingredients);
//
// splitContainer5.Panel2
//
this.splitContainer5.Panel2.Controls.Add(this.splitContainer6);
this.splitContainer5.Size = new System.Drawing.Size(512, 490);
this.splitContainer5.SplitterDistance = 218;
this.splitContainer5.TabIndex = 0;
//
// recipename
//
this.recipename.Dock = System.Windows.Forms.DockStyle.Fill;
this.recipename.Location = new System.Drawing.Point(0, 0);
this.recipename.Name = "recipename";
this.recipename.Size = new System.Drawing.Size(512, 20);
this.recipename.TabIndex = 10;
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.IsSplitterFixed = true;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
this.splitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.recipename);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.splitContainer5);
this.splitContainer4.Size = new System.Drawing.Size(512, 519);
this.splitContainer4.SplitterDistance = 25;
this.splitContainer4.TabIndex = 0;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.Location = new System.Drawing.Point(33, 218);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(85, 27);
this.label4.TabIndex = 16;
this.label4.Text = "Category";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(30, 15);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(98, 27);
this.label3.TabIndex = 15;
this.label3.Text = "Directions";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(25, 8);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(103, 27);
this.label2.TabIndex = 14;
this.label2.Text = "Ingredients";
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.label2);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.label5);
this.splitContainer3.Panel2.Controls.Add(this.pictureBox1);
this.splitContainer3.Panel2.Controls.Add(this.label4);
this.splitContainer3.Panel2.Controls.Add(this.label3);
this.splitContainer3.Size = new System.Drawing.Size(150, 487);
this.splitContainer3.SplitterDistance = 216;
this.splitContainer3.TabIndex = 0;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(41, 69);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(73, 13);
this.label5.TabIndex = 18;
this.label5.Text = "Current Image";
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(20, 89);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(116, 122);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 17;
this.pictureBox1.TabStop = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe Script", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(17, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(121, 27);
this.label1.TabIndex = 11;
this.label1.Text = "Recipe Name";
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.IsSplitterFixed = true;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.label1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(150, 519);
this.splitContainer2.SplitterDistance = 28;
this.splitContainer2.TabIndex = 0;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.IsSplitterFixed = true;
this.splitContainer1.Location = new System.Drawing.Point(20, 60);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer4);
this.splitContainer1.Size = new System.Drawing.Size(666, 519);
this.splitContainer1.SplitterDistance = 150;
this.splitContainer1.TabIndex = 1;
//
// EditRecipe
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(706, 599);
this.Controls.Add(this.splitContainer1);
this.Name = "EditRecipe";
this.Style = MetroFramework.MetroColorStyle.Red;
this.Text = "Edit Recipe";
this.splitContainer8.Panel1.ResumeLayout(false);
this.splitContainer8.Panel1.PerformLayout();
this.splitContainer8.Panel2.ResumeLayout(false);
this.splitContainer8.ResumeLayout(false);
this.splitContainer7.Panel1.ResumeLayout(false);
this.splitContainer7.Panel2.ResumeLayout(false);
this.splitContainer7.ResumeLayout(false);
this.splitContainer6.Panel1.ResumeLayout(false);
this.splitContainer6.Panel1.PerformLayout();
this.splitContainer6.Panel2.ResumeLayout(false);
this.splitContainer6.ResumeLayout(false);
this.splitContainer5.Panel1.ResumeLayout(false);
this.splitContainer5.Panel1.PerformLayout();
this.splitContainer5.Panel2.ResumeLayout(false);
this.splitContainer5.ResumeLayout(false);
this.splitContainer4.Panel1.ResumeLayout(false);
this.splitContainer4.Panel1.PerformLayout();
this.splitContainer4.Panel2.ResumeLayout(false);
this.splitContainer4.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel1.PerformLayout();
this.splitContainer3.Panel2.ResumeLayout(false);
this.splitContainer3.Panel2.PerformLayout();
this.splitContainer3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel1.PerformLayout();
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.OpenFileDialog openFileDialog;
private System.Windows.Forms.ComboBox category;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox recipeimageloc;
private System.Windows.Forms.SplitContainer splitContainer8;
private System.Windows.Forms.SplitContainer splitContainer7;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox directions;
private System.Windows.Forms.SplitContainer splitContainer6;
private System.Windows.Forms.TextBox ingredients;
private System.Windows.Forms.SplitContainer splitContainer5;
private System.Windows.Forms.TextBox recipename;
private System.Windows.Forms.SplitContainer splitContainer4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.PictureBox pictureBox1;
}
}

114
Gourmet Recipe Book/EditRecipe.cs

@ -0,0 +1,114 @@ @@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MetroFramework.Forms;
using System.Data.SQLite;
using System.IO;
namespace Gourmet_Recipe_Book
{
public partial class EditRecipe : MetroForm
{
private Byte[] data;
private String recipeid;
public EditRecipe(string id)
{
InitializeComponent();
recipename.Select();
recipename.Focus();
recipeid = id;
using (var conn = new SQLiteConnection(@"Data Source=" + Application.StartupPath + @"\recipedb.db"))
using (var cmd = conn.CreateCommand())
{
conn.Open();
cmd.CommandText = "SELECT * FROM recipes WHERE id=" + recipeid + "";
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
recipename.Text = reader["recipename"].ToString();
ingredients.Text = reader["ingredients"].ToString();
directions.Text = reader["directions"].ToString();
category.Text = reader["category"].ToString();
if (reader["image"].ToString() != "")
{
byte[] imageBytes = (System.Byte[])reader["image"];
MemoryStream ms = new MemoryStream(imageBytes);
pictureBox1.Image = Image.FromStream(ms, true);
}
}
}
}
}
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "All Picture Types|*.bmp;*.jpg;*.jpeg;*.png;*.gif";
dialog.InitialDirectory = @"";
dialog.Title = "Select an image for this recipe.";
if (dialog.ShowDialog() == DialogResult.OK)
{
recipeimageloc.Text = dialog.FileName;
using (FileStream stream = File.Open(dialog.FileName, FileMode.Open))
{
BinaryReader br = new BinaryReader(stream);
data = br.ReadBytes(2097152);
}
}
}
private void button1_Click(object sender, EventArgs e)
{
using (var conn = new SQLiteConnection(@"Data Source=" + Application.StartupPath + @"\recipedb.db"))
using (var cmd = conn.CreateCommand())
{
conn.Open();
if (recipeimageloc.Text == "")
{
cmd.CommandText = "UPDATE recipes SET recipename=@recipename, ingredients=@ingredients, directions=@directions, category=@category where id=@recipeid";
cmd.Parameters.AddWithValue("@recipename", recipename.Text);
cmd.Parameters.AddWithValue("@ingredients", ingredients.Text);
cmd.Parameters.AddWithValue("@directions", directions.Text);
cmd.Parameters.AddWithValue("@category", category.Text);
cmd.Parameters.AddWithValue("@recipeid", recipeid);
}
else
{
cmd.CommandText = "UPDATE recipes SET recipename=@recipename, ingredients=@ingredients, directions=@directions, category=@category, image=@image where id=@recipeid";
cmd.Parameters.AddWithValue("@recipename", recipename.Text);
cmd.Parameters.AddWithValue("@ingredients", ingredients.Text);
cmd.Parameters.AddWithValue("@directions", directions.Text);
cmd.Parameters.AddWithValue("@category", category.Text);
cmd.Parameters.AddWithValue("@recipeid", recipeid);
SQLiteParameter parameter = new SQLiteParameter("@image", System.Data.DbType.Binary);
parameter.Value = data;
cmd.Parameters.Add(parameter);
}
cmd.ExecuteNonQuery();
Close();
}
}
}
}

123
Gourmet Recipe Book/EditRecipe.resx

@ -0,0 +1,123 @@ @@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>