Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            lblusername.Text = "Welcome Admin: " + UserIdentity.AdminUsername;

            LoadDropDownListCategory.LoadDropDownCategory("Article Category", ddlarticlecategory, "Select a Category");

            ProviderArticleDetails Article = new ProviderArticleDetails();

            int ArticleID = (int)Util.Val(Request.QueryString["aid"]);

            Article.Approved = constant.UnApproved;
            Article.FillUp(ArticleID);

            string categoryname;
            categoryname = Article.Category;

            lblauthorname.Text = Article.Author;
            lbtitle.Text = Article.Title;
            Userid.Value = Article.UID.ToString();
            Title.Value = Article.Title;
            Content.Value = (string)Article.Content;
            Summary.Value = Util.FormatText(Article.Summary);
            Keyword.Value = Article.Keyword;

            Util = null;
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Instantiate utility object
        Utility Util = new Utility();

        ProviderArticleDetails Article = new ProviderArticleDetails();

        int ArticleID = (int)Util.Val(Request.QueryString["aid"]);

        Article.Approved = constant.Approved;
        Article.FillUp(ArticleID);

        lbtitle.Text = Article.Title;
        lbcontent.Text = Article.Content;
        strArtTitle = "Printing " + Article.Title + " article";

        //Release allocated memory
        Util = null;
        Article = null;
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Instantiate utility object
        Utility Util = new Utility();

        ProviderArticleDetails Article =  new ProviderArticleDetails();

        int ArticleID = (int)Util.Val(Request.QueryString["aid"]);

        Article.Approved = constant.UnApproved;
        Article.FillUp(ArticleID);

        lbtitle.Text = Article.Title;
        lblsummary.Text = Article.Summary;
        lblkeyword.Text = Article.Keyword;
        lbartdetail.Text = Article.Content;

        //Release allocated memory
        Util = null;
        Article = null;
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ProviderArticleDetails Article = new ProviderArticleDetails();

        ArticleID = (int)Util.Val(Request.QueryString["aid"]);

        Article.Approved = constant.Approved;
        Article.FillUp(ArticleID);

        if (!string.IsNullOrEmpty(Article.Content))
            lblwordcount.Text = Utility.WordCount(Article.Content).ToString();

        CommentLink.Text = "Bình luận (" + Article.CountComments + ")";
        CommentLink.Attributes.Add("onmouseover", "Tip('Đọc hoặc viết bình luận.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
        CommentLink.Attributes.Add("onmouseout", "UnTip()");

        lbcountcomment.Text = Article.CountComments.ToString();
        lbtitle.Text = Article.Title;
        lbcontent.Text = Article.Content;
        lbhits.Text = string.Format("{0:#,###}", Article.Hits);
        lbauthor.Text = "<a class='content2' title='Xem tác giả hoàn tất thông tin cá nhân.' href=userprofile.aspx?uid=" + Article.UID + ">" + Article.Author + "</a>";
        lblrating.Text = Article.Rating;
        lblvotescount.Text = Article.NoRates;
        starimage.ImageUrl = Utility.GetStarImage(Article.Rating);
        lbldate.Text = Utility.FormatDate(Article.Date);

        lbauthor.Attributes.Add("onmouseover", "Tip('Xem thông tin cá nhân <b>" + Article.Author + "</b>.', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
        lbauthor.Attributes.Add("onmouseout", "UnTip()");

        strBookmarkURL = Bookmark.URL;

        strAuthor = Article.Author;
        strArtTitle = Article.Title;
        strCatName = Article.Category;
        ArtCatId = Article.CatID;
        ArticleSection = constant.intArticle;

        ShowEditLink(Article);
        GetMetaTitleTagKeywords(Article);
        GetUserCookingArticleRating(ArticleID);
        GetRelatedArticle(Article);
        GetOtherArticleByThisAuthor(Article);
        GetComments(ArticleID);
        ShowCommentFormIfLogin();

        Article = null;
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Authentication.IsUserAuthenticated)
        {
            ProviderArticleDetails Article = new ProviderArticleDetails();

            int ArticleID = (int)Util.Val(Request.QueryString["aid"]);

            Article.Approved = constant.Approved;
            Article.FillUp(ArticleID);

            if (Article.UID == UserIdentity.UserID)
            {
                HideContentIfNotLogin.Visible = true;
            }
            else
            {
                lblyouarenotlogin.Visible = true;
                lblyouarenotlogin.Text = "<div style='margin-top: 12px; margin-bottom: 7px;'><img src='images/lock.gif' align='absmiddle'> You are not authorize to edit this article.</div>";
            }

            LoadDropDownListCategory.LoadDropDownCategory("Article Category", ddlarticlecategory, "Select a Category");

            lblauthorname.Text = UserIdentity.UserName.ToString();

            Title.Value = Article.Title;
            Summary.Value = Article.Summary;
            Content.Value = Article.Content;
            Keyword.Value = Article.Keyword;

            Article = null;
        }
        else
        {
            lblyouarenotlogin.Visible = true;
            lblyouarenotlogin.Text = "<div style='margin-top: 12px; margin-bottom: 7px;'><img src='images/lock.gif' align='absmiddle'> You are not authorize to edit an article. Please login to edit your article.</div>";
        }
    }