protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Instantiate sql params object
            Blogic myBL = new Blogic();

            //Validate admin session username and password by comparing them to the admin user database record.
            UserNameVal.ValidateAdminUserNameandPass();

            //Get admin username from the sessioan variable and place it in the label.
            lblusername.Text = "Welcome Admin: " + UserNameVal.AdminUsername;

            lbCountRecipe.Text = "There are " + string.Format("{0:#,###}", myBL.GetHomepageTotalRecipeCount) + " Approved Recipe";

            lbCountCat.Text = "Total Category: " + myBL.GetHomepageTotalCategoryCount;

            //Hide comment editing form
            Panel1.Visible         = false;
            catmanagerlink.Enabled = false;

            BindData();

            myBL = null;
        }
        else
        {
            //Show comment editing form
            Panel1.Visible         = true;
            catmanagerlink.Enabled = true;
        }
    }
Beispiel #2
0
    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;
        }
    }
    protected void Page_Load(object Sender, EventArgs E)
    {
        //Validate admin session username and password by comparing them to the admin user database record.
        UserNameVal.ValidateAdminUserNameandPass();

        //Get total article count
        ArticleCount = FetchData.ArticleCountAll;

        //Assign selected value to lastviewed dropdown menu
        int lv = (int)Util.Val(Request.QueryString["lv"]);

        GetLastViewedSelectedValue(lv);

        if (!IsPostBack)
        {
            //Populate year in the dropdwonlist - starting from 2000 to the current year.
            int tempDT = DateTime.Now.Year;
            for (int i = tempDT; (tempDT - i) < 9; i--)
            {
                ddlyear.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }

            MonthSearch();
            GetLastViewedDDLSelectedIndex();
            GetShowHideCommentDDLSelectedIndex();
            GetEmailandSMTPInfo();

            //Populate dropdown category list
            GetDropdownCategoryList();

            //Display A-Z alhpabet letter recipe name
            lblalphaletter.Text = Utility.DisplayAZAlphabetLink(constant.AdminBackEnd);

            //Get admin username from the sessioan variable and place it in the label.
            lblusername.Text = "Welcome Admin:&nbsp;" + UserNameVal.AdminUsername + "<br>Login session will expire in " + Session.Timeout + " mins.";

            lblletterlegend.Text          = "Recipe A-Z:";
            lblunapproved2.Visible        = false;
            lblmangermainpage.Text        = "Default View";
            lblmangermainpagelink.ToolTip = "Back to Default View";
            lbCountRecipe.Text            = "Total Approved Recipes:&nbsp;" + string.Format("{0:#,###}", FetchData.GetHomepageTotalRecipeCount);
            lbCountCat.Text             = "Total Category:&nbsp;" + FetchData.GetHomepageTotalCategoryCount;
            lbCountComments.Text        = "Total Comments: " + FetchData.AdminRecipeManagerGetTotalComments;
            lblunapproved.Text          = "Waiting For Approval:&nbsp;" + FetchData.AdminRecipeManagerGetWaitingforApprovalCount;
            lblrecordperpage.Text       = "Default 40 records per page";
            lblrecordperpageFooter.Text = "Showing default 40 records per page";
            lblrecordperpageTop.Text    = "- 40 records per page";
            approvallink.ToolTip        = "There are (" + FetchData.AdminRecipeManagerGetWaitingforApprovalCount + ") recipes waiting for your approval. Click this link to approve the recipe";

            //Set the default pagesize.
            dgrd_recipe.PageSize = 40;

            //Data binding
            BindData();

            //Release allocated memory
            FetchData = null;
            Util      = null;
        }
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ArticleUpdateSection = constant.intArticleAdminUpdate;

        if (!IsPostBack)
        {
            //Validate admin session username and password by comparing them to the admin user database record.
            UserNameVal.ValidateAdminUserNameandPass();

            //Get admin username from the sessioan variable and place it in the label.
            lblusername.Text = "Welcome Admin:&nbsp;" + UserNameVal.AdminUsername;

            //Instantiate SQL params object
            Blogic myBL = new Blogic();

            lbCountArticle.Text = "Total Approved Article: " + myBL.ArticleCountAll;

            //Return Update Category List
            AdminUpdateArtCatList.DataSource = myBL.GetArticleCategoryList;
            AdminUpdateArtCatList.DataBind();

            //Return Add New Category List
            ArtCategoryList.DataSource = myBL.GetArticleCategoryList;
            ArtCategoryList.DataBind();

            ShowEditArticleListing();

            //Hide comment editing form
            Panel2.Visible = false;

            if (Request.QueryString["editcatid"] != null)
            {
                CategoryName.Text  = Request.QueryString["catname"];
                CategoryID.Value   = Request.QueryString["editcatid"];
                Panel2.Visible     = true;
                Panel3.Visible     = false;
                AddNewCat.Visible  = false;
                lblheaderform.Text = "Updating Article Category ID# " + Request.QueryString["editcatid"];
            }

            //Release allocated memory
            myBL = null;
        }
        else
        {
            //Show comment editing form
            Panel2.Visible = true;
        }
    }
Beispiel #5
0
    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();

            //Get admin username from the sessioan variable and place it in the label.
            lblusername.Text = "Welcome Admin:&nbsp;" + UserNameVal.AdminUsername;

            if (Request.QueryString["prevedit"] != null)
            {
                btn1.Visible = false;
                btn2.Visible = true;
            }
            else
            {
                btn1.Visible = true;
                btn2.Visible = false;
            }

            //Instantiate database field
            ArticleDetail Article = new ArticleDetail();

            Article.WhatPageID = (int)Util.Val(Request.QueryString["show"]); //Parameter 2 = we are dealing with the admin/updatearticle.aspx.
            Article.ID         = (int)Util.Val(Request.QueryString["aid"]);

            //Fill up database fields
            Article.fillup();

            string categoryname;
            categoryname = Article.Category;

            lbtitle.Text    = Article.Title;
            lbcatname2.Text = Article.Category;
            Title.Value     = Article.Title;
            Content.Value   = Util.FormatText(Article.Content);
            Summary.Value   = Util.FormatText(Article.Summary);
            Keyword.Value   = Article.Keyword;
            Author.Value    = Article.Author;
            CAT_ID.Value    = Article.CatID.ToString();

            //Release allocated memory
            myBL    = null;
            Util    = null;
            Article = 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();

            //Get admin username from the session variable and place it in the label.
            lblusername.Text = "Welcome Admin:&nbsp;" + UserNameVal.AdminUsername;

            Article.WhatPageID = constant.intArticleAdminPreview;
            Article.ID         = (int)Util.Val(Request.QueryString["aid"]);

            Article.fillup();

            lbtitle.Text     = Article.Title;
            lbartdetail.Text = Article.Content;

            //Release allocated memory
            Util    = null;
            Article = null;
        }
    }
Beispiel #7
0
    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;
        }
    }