Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Recipes.DAL.Recipe.RecipeMaster recipeMaster = new RecipeMaster();
            var recipes = recipeMaster.GetRecipes();

            if (recipes != null)
            {
                Response.Write("<table>");
                Response.Write("<tr><th>Recipe Name</th><th>Recipe Description</th></tr>");
                foreach (var r in recipes)
                {
                    Response.Write(string.Format("<tr><td>{0}</td><td>{1}</td></tr>", r.Name, r.Description));
                }
                Response.Write("</table>");
            }
        }
Пример #2
0
 protected void AddRecipeBtn_Click(object sender, EventArgs e)
 {
     var recipe = new RecipeMaster();
     recipe.AddRecipes(RecipeNameTxt.Text, RecipeDescriptionTxt.Text);
     Response.Redirect(@"~\Views\AllRecipes.aspx");
 }