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
 private void ShowEditLink(ProviderArticleDetails Article)
 {
     if (Authentication.IsUserAuthenticated && Article.UID == UserIdentity.UserID)
     {
         editarticlelink.Visible = true;
         editarticlelink.Text = "<img src='images/icon_pencil.gif' alt='Sửa' border='0'> Sửa";
         editarticlelink.NavigateUrl = "editarticle.aspx?aid=" + Article.ID;
         editarticlelink.Attributes.Add("onmouseover", "Tip('Sửa bài viết <b>" + Article.Title + "</b>. của bạn', BGCOLOR, '#FFFBE1', BORDERCOLOR, '#acc6db')");
         editarticlelink.Attributes.Add("onmouseout", "UnTip()");
     }
 }
Esempio n. 5
0
    private void GetRelatedArticle(ProviderArticleDetails Article)
    {
        ProviderRalatedArticle GetRelatedArticle = ProviderRalatedArticle.GetInstance();
        GetRelatedArticle.Param(Article.CatID, Article.ID);

        if (GetRelatedArticle.RecordCount > 1)
        {
            PanelRelatedArticle.Visible = true;
            RelatedArticle.DataSource = GetRelatedArticle.GetArticle();
            RelatedArticle.DataBind();
        }
    }
Esempio n. 6
0
    private void GetOtherArticleByThisAuthor(ProviderArticleDetails Article)
    {
        ProviderOtherArticleByThisAuthor GetOtherArticle = ProviderOtherArticleByThisAuthor.GetInstance();
        GetOtherArticle.Param(Article.UID, Article.ID);

        if (GetOtherArticle.RecordCount > 1)
        {
            PanelOtherArticleByAuthor.Visible = true;
            OtherArticleByThisAuthor.DataSource = GetOtherArticle.GetArticle();
            OtherArticleByThisAuthor.DataBind();
        }
    }
Esempio n. 7
0
 private void GetMetaTitleTagKeywords(ProviderArticleDetails Article)
 {
     Page.Header.Title = Article.Title + "," + Article.Category;
     HtmlMeta metaTag = new HtmlMeta();
     metaTag.Name = "Từ khóa";
     metaTag.Content = Article.Title + "," + Article.Category;
     this.Header.Controls.Add(metaTag);
 }
Esempio n. 8
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. 9
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>";
        }
    }