protected void Page_Load(object sender, EventArgs e) { //Instantiate object Utility Util = new Utility(); //Instantiate database field RecipeDetails Recipe = new RecipeDetails(); Recipe.WhatPageID = constant.intRecipeDetails; //1 = we are dealing with print.aspx use the same as recipedetails. Recipe.ID = (int)Util.Val(Request.QueryString["id"]); //Fill up database fields Recipe.fillup(); lblingredientsdis.Text = "Ingredients:"; lblinstructionsdis.Text = "Instructions:"; lblname.Text = Recipe.RecipeName; lblIngredients.Text = Util.FormatText(Recipe.Ingredients); lblInstructions.Text = Util.FormatText(Recipe.Instructions); strRName = "Printing" + Recipe.RecipeName + " Recipe"; //Release allocated memory Util = null; Recipe = null; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Validate admin session username and password by comparing them to the admin user database record. UserNameVal.ValidateAdminUserNameandPass(); //Instantiate database field RecipeDetails Recipe = new RecipeDetails(); Recipe.ID = (int)Util.Val(Request.QueryString["id"]); strRecipeImage = GetRecipeImage.GetImage(Recipe.ID); Recipe.WhatPageID = constant.intRecipeAdminViewing; //Parameter 2 = we are pulling database field for Admin/viewing.aspx //Fill up database fields Recipe.fillup(); if (Recipe.HitDate.ToString() == "1/1/0001 12:00:00 AM") { lblastviewed.Text = "This Recipe Has not been view by anyone"; } else { lblastviewed.Text = Recipe.HitDate.ToString(); } lblname.Text = Recipe.RecipeName; lblauthor.Text = Recipe.Author; lbldate.Text = Recipe.Date.ToShortDateString(); lblCatName.Text = Recipe.Category; Ingredients.Text = Recipe.Ingredients; Instructions.Text = Recipe.Instructions; if (Recipe.Approved == 1) { approvebutton.Visible = false; lblapprovalstatus.Text = "Viewing Recipe"; } else { lblapprovalstatus.Text = "Unapprove - This recipe is waiting for approval"; } if (Recipe.Hits == 0) { lblhits.Text = "0"; } else { lblhits.Text = string.Format("{0:#,###}", Recipe.Hits); } strRecipename = Recipe.RecipeName; //Release allocated memory. Util = null; Recipe = null; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Validate admin session username and password by comparing them to the admin user database record. UserNameVal.ValidateAdminUserNameandPass(); GetDropdownCategoryID(); lblusername.Text = "Welcome Admin: " + UserNameVal.AdminUsername; //Instantiate database field RecipeDetails Recipe = new RecipeDetails(); Recipe.ID = (int)Util.Val(Request.QueryString["id"]); strRecipeImage = GetRecipeImage.GetImage(Recipe.ID); Recipe.WhatPageID = constant.intRecipeAdminEditing; //Parameter 3 = we are pulling database field for Admin/editing.aspx //Fill up database fields Recipe.fillup(); Name.Text = Recipe.RecipeName; Author.Text = Recipe.Author; Hits.Text = Recipe.Hits.ToString(); Ingredients.Text = Recipe.Ingredients; Instructions.Text = Recipe.Instructions; //Release allocated memory Recipe = null; myBL = null; } }