Ejemplo n.º 1
0
        private void ViewNewsGroupDetail(int Id)
        {
            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            NewsGroup newsgroup = newsgroupBSO.GetNewsGroupById(Id);
            if (newsgroup == null)
                Response.Redirect("~/Default.aspx");

            ltlTitle.Text = newsgroup.Title;
            LabelDate.Text = newsgroup.PostDate.ToString("dd/MM/yyyy");// Convert.ToString(newsgroup.PostDate);
            ltlDescribe.Text = newsgroup.ShortDescribe;
            FullDescirbe.Text = newsgroup.FullDescribe;
            LabelAuthor.Text = newsgroup.Author;
            txtNewsGroupID.Value = Convert.ToString(newsgroup.NewsGroupID);
            //if (newsgroup.ImageThumb != "")
            //    ltlImageThumb.Text = @"<img src='"+ResolveUrl("~/")+"Admin/Upload/NewsGroup/NewsGroupThumb/" + newsgroup.ImageThumb + "' align='left' class='border_image' width='250'  >";
            //Page.Title = newsgroup.Title;
            if (newsgroup.FileName != "")
                ltlFile.Text = @"<a href='" + ResolveUrl("~/") + "Admin/Upload/NewsGroup/Files/" + newsgroup.FileName + "'><img src='" + ResolveUrl("~/") + "images/icon_file.png' width='30' class='icon_bullet'/> Tải File đính kèm</a>";
            newsgroupBSO.NewsGroupClickUpdate(Id);
            NewsGroupFollow(newsgroup.NewsGroupID, newsgroup.CateNewsID);

            CateNewsBSO catenewsBSO = new CateNewsBSO();
            CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID);
            //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID;
            title_name.Text = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + ".aspx'>" + catenews.CateNewsName + "</a>";

            string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + ".aspx' class='content_Text_Cat'>";
            string s1 = "";
            while (catenews.ParentNewsID != 0)
            {
                int pId = catenews.ParentNewsID;
                catenews = catenewsBSO.GetCateNewsById(pId);
                s1 = "<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'><a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + ".aspx'' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp;" + s1;
            }
            cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại
            cate += "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>";
            cate += s1;
            title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + String.Format(Resources.resource.Home) + "</a> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp; ";
            title_cate.Text += cate;

            if (!String.IsNullOrEmpty(Request["error"]))
                error.Text = "<div class='error_register_text'>" + String.Format(Resources.resource.ThanksComment) + "</div>";

            if (!newsgroup.IsComment)
            {
                CommentPanel.Visible = false;
            }
            else
            {
                CommentPanel.Visible = true;
                GetNewsCommentById(Id);
            }

            Page.Title = GetString(newsgroup.Title);
        }