private bool checkActive(int cateID, int sCateID) { /* * Kiểm tra sCateID có thuộc cùng nhóm chuyên mục với cateID ko? * cateID: ID chuyên mục hiện hành * sCateID: ID của list chuyên mục tại */ CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews cateNews = new CateNews(); cateNews = catenewsBSO.GetCateNewsById(cateID); if (cateNews != null) { if (cateID == sCateID) { return(true); } else { while (cateNews.ParentNewsID != 0 && cateNews.CateNewsID != sCateID) { cateNews = catenewsBSO.GetCateNewsById(cateNews.ParentNewsID); if (cateNews.CateNewsID == sCateID) { return(true); } } } } return(false); }
protected void btn_slug_click(object sender, EventArgs e) { NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); CateNewsGroupBSO _catenewsgroupBSO = new CateNewsGroupBSO(); CateNewsBSO _catenewsBSO = new CateNewsBSO(); NewsGroup newsGroup = new NewsGroup(); DataTable table = newsGroupBSO.GetNewsGroupAll(Language.language); if (table.Rows.Count > 0) { for (int i = 0; i < table.Rows.Count; i++) { newsGroup = newsGroupBSO.GetNewsGroupById(Convert.ToInt32(table.Rows[i]["NewsGroupID"].ToString())); newsGroup.Slug = GetString(newsGroup.Title); newsGroup.Tags = _catenewsBSO.GetCateNewsById(newsGroup.CateNewsID).CateNewsName.Replace(",", ""); newsGroup.Tags += "," + _catenewsgroupBSO.GetCateNewsGroupByGroupCate(newsGroup.GroupCate, Language.language).CateNewsGroupName.Replace(",", ""); newsGroup.Keyword = _catenewsBSO.GetCateNewsById(newsGroup.CateNewsID).CateNewsName.Replace(",", ""); newsGroup.Keyword += "," + _catenewsgroupBSO.GetCateNewsGroupByGroupCate(newsGroup.GroupCate, Language.language).CateNewsGroupName.Replace(",", ""); newsGroupBSO.UpdateNewsGroup(newsGroup); } clientview.Text = "Xử lý OK"; ViewNewsGroup(-1); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int cateID = 0; if (!String.IsNullOrEmpty(hddValue.Value)) { if (int.TryParse(hddValue.Value.Replace(",", ""), out cateID)) { CateNewsBSO cateNewsBSO = new CateNewsBSO(); CateNews cateNews = cateNewsBSO.GetCateNewsById(cateID); int groupcate = cateNews.GroupCate; GetNewsGroup(cateID, groupcate); if (cateID != 0 && cateNews != null) { //lblIcon.Text = "<a href='" + ResolveUrl("~/") + "ts-dm/" + GetString(cateNews.CateNewsName) + "-" + groupcate + "-" + cateID + ".aspx' title='" + cateNews.CateNewsName + "'>" + "<img class='is_img onLaw2-icon1 onLaw1-Submit-Arrow' src='" + ResolveUrl("~/") + "images/invis.gif' style='border-width: 0px;'>" + "</a>"; lblTitle.Text = "<a href='" + ResolveUrl("~/") + "ts-dm/" + GetString(cateNews.CateNewsName) + "-" + groupcate + "-" + cateID + ".aspx' title='" + cateNews.CateNewsName + "'>" + cateNews.CateNewsName + "</a>"; } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int cateID = 0; if (!String.IsNullOrEmpty(hddValue.Value)) { if (int.TryParse(hddValue.Value.Replace(",", ""), out cateID)) { CateNewsBSO cateNewsBSO = new CateNewsBSO(); CateNews cateNews = cateNewsBSO.GetCateNewsById(cateID); if (cateID != 0 && cateNews != null) { int groupcate = cateNews.GroupCate; GetNewsGroup(cateID, groupcate); ltlTitle.Text = "<a class='h2-cate' href='" + ResolveUrl("~/") + "c3/" + cateNewsBSO.GetSlugByCateId(cateNews.CateNewsID) + "/" + GetString(cateNews.CateNewsName) + "-" + groupcate + "-" + cateID + ".aspx' title='" + cateNews.CateNewsName + "'><span>" + cateNews.ShortName + "</span></a>"; } } } } }
protected void Page_Load(object sender, EventArgs e) { int Id = 0; if (!string.IsNullOrEmpty(Request["Id"])) { int.TryParse(Request["Id"].Replace(",", ""), out Id); } if (!string.IsNullOrEmpty(Request["dll"])) { NavigationTitle(Request["dll"]); } hddCateNewsID.Value = Convert.ToString(Id); if (!IsPostBack) { CateNewsBSO catenewBSO = new CateNewsBSO(); CateNews catenews = catenewBSO.GetCateNewsById(Id); HddGroupCate.Value = Convert.ToString(catenews.GroupCate); ltlTitle.Text = catenews.CateNewsName; initControl(Id); } }
protected void Page_Load(object sender, EventArgs e) { int cId = 0; if (!String.IsNullOrEmpty(Request["cid"])) { int.TryParse(Request["cid"], out cId); } int gId = 0; if (!String.IsNullOrEmpty(Request["g"])) { int.TryParse(Request["g"], out gId); } hddGroupCate.Value = Convert.ToString(gId); hddCateID.Value = Convert.ToString(cId); if (!IsPostBack) { CateNewsGroupBSO cateNewsGroupBso = new CateNewsGroupBSO(); CateNewsBSO cateNewsBso = new CateNewsBSO(); CateNews cateNewsById = cateNewsBso.GetCateNewsById(cId); CateNewsGroup groupByGroupCate = cateNewsGroupBso.GetCateNewsGroupByGroupCate(gId, Language.language); if (groupByGroupCate != null && cateNewsById != null) { GetCateParentNewsGroup(cId, gId); Page.Title = cateNewsById.CateNewsName; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = cateNewsById.CateNewsName + "," + GetString(cateNewsById.CateNewsName); Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = GetString(cateNewsById.CateNewsName); Page.Header.Controls.Add(_keyWords); } else if (cId == 0) { if (groupByGroupCate != null) { //GetHotNewsGroup(cId, gId); GetCateParentNewsGroup(cId, gId); Page.Title = groupByGroupCate.CateNewsGroupName; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = groupByGroupCate.CateNewsGroupName; Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = groupByGroupCate.CateNewsGroupName + "," + GetString(groupByGroupCate.CateNewsGroupName); Page.Header.Controls.Add(_keyWords); } } } }
private void initControl(int Id) { if (Id > 0) { btn_add.Visible = false; btn_edit.Visible = true; btn_add1.Visible = false; btn_add2.Visible = false; btn_edit1.Visible = true; try { CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews catenews = catenewsBSO.GetCateNewsById(Id); hddCateNewsID.Value = Convert.ToString(catenews.CateNewsID); hddParentID.Value = Convert.ToString(catenews.ParentNewsID); ddlCateNews.SelectedValue = Convert.ToString(catenews.ParentNewsID); ddlCateNews.Items.Remove(new ListItem(catenews.CateNewsName, Convert.ToString(catenews.CateNewsID))); txtCateNewsName.Text = catenews.CateNewsName; hddCateNewsOrder.Value = Convert.ToString(catenews.CateNewsOrder); hddCateNewsTotal.Value = Convert.ToString(catenews.CateNewsTotal); //rdbGroupCate.SelectedValue = Convert.ToString(catenews.GroupCate); hddIcon.Value = catenews.Icon; txtimage4_3.Text = catenews.Icon; if (catenews.Icon != "") { img_thumb.Text = "<img src='" + catenews.Icon + "' width='48px'>"; } txtSlogan.Text = catenews.Slogan; hddUserName.Value = Session["Admin_UserName"].ToString(); hddCreated.Value = DateTime.Now.ToString(); txtGroupCate.Text = Convert.ToString(catenews.GroupCate); // HddGroupCate.Value = Convert.ToString(catenews.GroupCate); rdbType.Checked = catenews.isUrl; txtUrl.Text = catenews.Url; rdbStatus.Checked = catenews.Status; txtShortName.Text = catenews.ShortName; if (catenews.isUrl == true) { txtUrl.Visible = true; panelUrl.Visible = true; } else { txtUrl.Visible = false; panelUrl.Visible = false; } ViewCateGroup(catenews.GroupCate); Bind_ddlPageLayout(); ddlPageLayout.SelectedValue = Convert.ToString(catenews.PageLayoutID); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } } else { txtGroupCate.Text = Convert.ToString(HddGroupCate.Value); Bind_ddlPageLayout(); ddlPageLayout.SelectedIndex = 0; btn_edit.Visible = false; btn_add.Visible = true; btn_edit1.Visible = false; btn_add1.Visible = true; btn_add2.Visible = true; rdbType.Checked = false; txtUrl.Visible = false; panelUrl.Visible = false; } }
protected void initControl(int ID) { if (ID > 0) { txtID.Value = Convert.ToString(ID); //btn_add.Visible = false; btn_edit.Visible = true; //btn_add1.Visible = false; //btn_add2.Visible = false; btn_edit1.Visible = true; try { SYS_WidgetPageLayoutBSO _widgetPageLayoutBSO = new SYS_WidgetPageLayoutBSO(); SYS_WidgetPageLayout _widgetPageLayout = _widgetPageLayoutBSO.GetSYS_WidgetPageLayoutById(ID); Bind_ddlPageLayout(); ddlPageLayout.SelectedValue = Convert.ToString(_widgetPageLayout.PageLayoutId); //Bind_ddlWidgetType(); Bind_ddlWidget(0); ddlWidget.SelectedValue = Convert.ToString(_widgetPageLayout.WidgetId); GetRegion(); ddlRegion.SelectedValue = _widgetPageLayout.RegionId; txtWidgetTitle.Text = _widgetPageLayout.Title; hddIcon.Value = _widgetPageLayout.Icon; //if (_widgetPageLayout.Icon != "") // ltl_icon.Text = "<img src='" + ResolveUrl("~/") + "Upload/Widgets/Icons/" + _widgetPageLayout.Icon + "' width='48px'>"; chkStatus.Checked = _widgetPageLayout.Status; hddRadInfo.Value = _widgetPageLayout.Info; hddRadHTML.Value = _widgetPageLayout.HTML; BindToCateNewsGroup2(); CateNewsBSO _cateNewsBSO = new CateNewsBSO(); if (_widgetPageLayout.Value != "0" && _widgetPageLayout.Value != "") { CateNews _catenews = _cateNewsBSO.GetCateNewsById(Convert.ToInt32(_widgetPageLayout.Value)); if (_catenews != null) { BindToCateNews(_catenews.GroupCate); lboCateNews.SelectedValue = Convert.ToString(_widgetPageLayout.Value); lboGroupCate.SelectedValue = Convert.ToString(_catenews.GroupCate); } } if (_widgetPageLayout.Value2 != "0" && _widgetPageLayout.Value2 != "") { CateNews _catenews2 = _cateNewsBSO.GetCateNewsById(Convert.ToInt32(_widgetPageLayout.Value2)); if (_catenews2 != null) { BindToCateNews2(_catenews2.GroupCate); lboCateNews2.SelectedValue = Convert.ToString(_widgetPageLayout.Value2); lboGroupCate2.SelectedValue = Convert.ToString(_catenews2.GroupCate); } } txtRecord.Text = _widgetPageLayout.Record.ToString(); //sửa txtRecord2.Text = _widgetPageLayout.Record2.ToString(); //sửa hddOrders.Value = _widgetPageLayout.Orders.ToString(); } catch (Exception ex) { error.Text = ex.Message.ToString(); } } else { Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "window.onunload = CloseWindow();"); } }
public static void GetNavigation(string strSlugPage, string g, string cId, string Id, string urlRoot) { if (strSlugPage != string.Empty) { SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); SYS_PageLayout _pageLayout = new SYS_PageLayout(); if (!AspNetCache.CheckCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_"))) { _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug(strSlugPage, Language.language); if (_pageLayout == null) { _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug("home", Language.language); } AspNetCache.SetCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_"), _pageLayout); } else { _pageLayout = (SYS_PageLayout)AspNetCache.GetCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_")); } Navigation.TitleName = _pageLayout.PageName; Navigation.TitleCate = "<li><a href='" + urlRoot + "'>Trang chủ</a></li>"; CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); NewsGroupBSO newsgroupBSO = new NewsGroupBSO(); CateNewsBSO catenewsBSO = new CateNewsBSO(); if (strSlugPage == "du-an") { if (!String.IsNullOrEmpty(Id)) { Navigation.TitleName = "Thông tin dự án"; string cate = "<li><a href='" + urlRoot + "c2/du-an-c/du-an-1.aspx'>Dự án"; cate += "</a></li>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else if (strSlugPage == "detailvideos") { if (!String.IsNullOrEmpty(cId)) { VideosCateBSO videosCateBSO = new VideosCateBSO(); VideosCate videoCate = videosCateBSO.GetVideosCateById(Convert.ToInt32(cId)); Navigation.TitleName = "<a href='" + urlRoot + "thu-vien-video" + "-" + videoCate.VideosCateID + ".aspx'>" + videoCate.VideosCateName + "</a>"; string cate = "<li><a href='" + urlRoot + "thu-vien-video.aspx'>Thư viện Video"; string s1 = ""; while (videoCate.ParentCateID != 0) { int pId = videoCate.ParentCateID; videoCate = videosCateBSO.GetVideosCateById(pId); s1 = "<li><a href='" + urlRoot + "thu-vien-video/" + videoCate.VideosCateName + "-" + videoCate.VideosCateID + ".aspx'>" + videoCate.VideosCateName + "</a></li>" + s1; } // cate += "Video"; //Sửa lại cate += "</a></li>"; cate += s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else if (strSlugPage == "detailalbums") { if (!String.IsNullOrEmpty(cId)) { AlbumsCateBSO albumsCateBSO = new AlbumsCateBSO(); AlbumsCate videoCate = albumsCateBSO.GetAlbumsCateById(Convert.ToInt32(cId)); Navigation.TitleName = "<a href='" + urlRoot + "thu-vien-video" + "-" + videoCate.AlbumsCateID + ".aspx'>" + videoCate.AlbumsCateName + "</a>"; string cate = "<li><a href='" + urlRoot + "thu-vien-video.aspx'>Thư viện Video"; string s1 = ""; while (videoCate.ParentCateID != 0) { int pId = videoCate.ParentCateID; videoCate = albumsCateBSO.GetAlbumsCateById(pId); s1 = "<li><a href='" + urlRoot + "thu-vien-video/" + videoCate.AlbumsCateName + "-" + videoCate.AlbumsCateID + ".aspx'>" + videoCate.AlbumsCateName + "</a></li>" + s1; } // cate += "Video"; //Sửa lại cate += "</a></li>"; cate += s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else if (strSlugPage == "dh") { if (!String.IsNullOrEmpty(g)) { Navigation.TitleName = "<a href='" + urlRoot + "tim-truong/0-0-0-0-0-0-0/search.aspx'>Thông tin trường</a>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; } } else if (strSlugPage == "dang-ky-ts") { if (!String.IsNullOrEmpty(g)) { Navigation.TitleName = "<a href='" + urlRoot + "c2/dh-dk/Dang-ky-tuyen-sinh-truc-tuyen-20.aspx'>Trang Đăng ký tuyển sinh</a>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; } } else if (strSlugPage == "dh-dk") { if (!String.IsNullOrEmpty(g)) { Navigation.TitleName = "<a href='" + urlRoot + "c2/dh-dk/Dang-ky-tuyen-sinh-truc-tuyen-20.aspx'>Trang Đăng ký tuyển sinh</a>"; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; } } else if (!String.IsNullOrEmpty(Id)) { NewsGroup newsgroup = newsgroupBSO.GetNewsGroupById(Convert.ToInt32(Id)); if (newsgroup != null && newsgroup.CateNewsID > 0) { CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID); CateNewsGroup cateNewsGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate, Language.language); Navigation.TitleName = "<a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a>"; string cate = "<li><a href='" + urlRoot + "c2/" + cateNewsgroupBSO.GetSlugById(cateNewsGroup.CateNewsGroupID) + "/" + GetString(cateNewsGroup.CateNewsGroupName) + "-" + catenews.GroupCate + ".aspx'>"; string s1 = ""; while (catenews.ParentNewsID != 0) { int pId = catenews.ParentNewsID; catenews = catenewsBSO.GetCateNewsById(pId); s1 = "<li><a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a></li>" + s1; } cate += cateNewsGroup.CateNewsGroupName.ToString(); //Sửa lại cate += "</a></li>"; cate += s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else { if (!String.IsNullOrEmpty(cId) && !String.IsNullOrEmpty(g)) { CateNews cateNewsById = catenewsBSO.GetCateNewsById(Convert.ToInt32(cId)); CateNewsGroup groupByGroupCate = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g), Language.language); if (groupByGroupCate != null && cateNewsById != null) { Navigation.TitleName = cateNewsById.CateNewsName; string cate = "<li><a href='" + urlRoot + "c2/" + cateNewsgroupBSO.GetSlugById(groupByGroupCate.CateNewsGroupID) + "/" + GetString(groupByGroupCate.CateNewsGroupName) + "-" + cateNewsById.GroupCate + ".aspx' title='" + groupByGroupCate.CateNewsGroupName + "'>"; string s1 = ""; while (cateNewsById.ParentNewsID != 0) { int parentNewsId = cateNewsById.ParentNewsID; cateNewsById = catenewsBSO.GetCateNewsById(parentNewsId); s1 = "<li><a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(cateNewsById.CateNewsID) + "/" + GetString(cateNewsById.CateNewsName) + "-" + cateNewsById.GroupCate + "-" + cateNewsById.CateNewsID + ".aspx' title='" + cateNewsById.CateNewsName + "'>" + cateNewsById.CateNewsName + "</a></li>" + s1; } cate += groupByGroupCate.CateNewsGroupName.ToString() + "</a></li>" + s1; Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; Navigation.TitleCate += cate; } } else { if (!String.IsNullOrEmpty(g)) { CateNewsGroup groupByGroupCate = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g), Language.language); Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>"; if (groupByGroupCate != null) { Navigation.TitleName = groupByGroupCate.CateNewsGroupName; } } } } } }
protected void Page_Load(object sender, EventArgs e) { int cId = 0; if (!String.IsNullOrEmpty(Request["cid"])) { int.TryParse(Request["cid"], out cId); } int gId = 0; if (!String.IsNullOrEmpty(Request["g"])) { int.TryParse(Request["g"], out gId); } hddGroupCate.Value = Convert.ToString(gId); hddCateID.Value = Convert.ToString(cId); if (!IsPostBack) { CateNewsGroupBSO cateNewsGroupBso = new CateNewsGroupBSO(); CateNewsBSO cateNewsBso = new CateNewsBSO(); CateNews cateNewsById = cateNewsBso.GetCateNewsById(cId); CateNewsGroup groupByGroupCate = cateNewsGroupBso.GetCateNewsGroupByGroupCate(gId, Language.language); if (groupByGroupCate != null && cateNewsById != null) { //GetHotNewsGroup(cId, gId); ViewListCate(cId, gId); title_name.Text = cateNewsById.CateNewsName; string cate = "<a href='" + ResolveUrl("~/") + "c2/" + cateNewsGroupBso.GetSlugById(groupByGroupCate.CateNewsGroupID) + "/" + GetString(groupByGroupCate.CateNewsGroupName) + "-" + cateNewsById.GroupCate + ".aspx' class='content_Text_Cat' title='" + groupByGroupCate.CateNewsGroupName + "'>"; string s1 = ""; while (cateNewsById.ParentNewsID != 0) { int parentNewsId = cateNewsById.ParentNewsID; cateNewsById = cateNewsBso.GetCateNewsById(parentNewsId); s1 = "<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' ><a href='" + ResolveUrl("~/") + "c3/" + cateNewsBso.GetSlugByCateId(cateNewsById.CateNewsID) + "/" + GetString(cateNewsById.CateNewsName) + "-" + cateNewsById.GroupCate + "-" + cateNewsById.CateNewsID + ".aspx' class='content_Text_Cat' title='" + cateNewsById.CateNewsName + "'>" + cateNewsById.CateNewsName + "</a>" + s1; } cate += groupByGroupCate.CateNewsGroupName.ToString() + "</a> " + s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.T_home + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' >"; title_cate.Text += cate; Page.Title = cateNewsById.CateNewsName; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = cateNewsById.CateNewsName; Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = GetString(cateNewsById.CateNewsName); Page.Header.Controls.Add(_keyWords); } else if (cId == 0) { if (groupByGroupCate != null) { //GetHotNewsGroup(cId, gId); ViewListCate(cId, gId); //title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>TRANG CHỦ</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> "; title_name.Text = groupByGroupCate.CateNewsGroupName; Page.Title = title_name.Text; System.Web.UI.HtmlControls.HtmlMeta _descrip = new HtmlMeta(); _descrip.Name = "description"; _descrip.Content = title_name.Text; Page.Header.Controls.Add(_descrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = GetString(title_name.Text); Page.Header.Controls.Add(_keyWords); } } } }
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"); } commonBSO commonBSO = new commonBSO(); //Kiem tra neu phan quyen truy cap chuyen muc nay DataTable dtCheckRole = commonBSO.CreateDataView("SELECT FROM tblRoleCate WHERE CateId=" + newsgroup.CateNewsID); if (dtCheckRole != null && dtCheckRole.Rows.Count > 0) { UserValidation m_UserValidation = new UserValidation(); if (m_UserValidation.IsSigned()) { DataTable dtGroupRole = new AdminRolesBSO().GetAdminRolesByUserName(m_UserValidation.UserName); if (dtGroupRole != null && dtGroupRole.Rows.Count > 0) { DataTable dtRoleCate = commonBSO.CreateDataView("SELECT Id FROM tblRoleCate WHERE GroupId IN (SELECT RolesID FROM tblAdminRoles WHERE Admin_UserName = '******') AND CateId=" + newsgroup.CateNewsID); if (dtRoleCate != null && dtRoleCate.Rows.Count > 0) { //Da dang nhap va co quyen xem } else { //Da dang nhap nhung khong co quyen truy cap, chuyen ve trang thong bao; content_notice.Visible = true; content_news.Visible = false; } } } else { //Yeu cau dang nhap Response.Redirect(ResolveUrl("~") + "Dang-nhap.aspx?RetUrl=" + Request.RawUrl); } } 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); newsgroupBSO.NewsGroupClickUpdate(Id); NewsGroupFollow(newsgroup.NewsGroupID, newsgroup.CateNewsID); CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID); CateNewsGroup cateNewsGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate, Language.language); title_name.Text = "<a href='" + ResolveUrl("~/") + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a>"; string cate = "<a href='" + ResolveUrl("~/") + "c2/" + cateNewsgroupBSO.GetSlugById(cateNewsGroup.CateNewsGroupID) + "/" + GetString(cateNewsGroup.CateNewsGroupName) + "-" + catenews.GroupCate + ".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("~/") + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a>" + s1; } cate += cateNewsGroup.CateNewsGroupName.ToString(); //Sửa lại cate += "</a>"; cate += s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.T_home + "</a><img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> "; title_cate.Text += cate; if (!String.IsNullOrEmpty(Request["error"])) { error.Text = "<div class='error_register_text'>" + Resources.resource.T_Comment_Error1 + "</div>"; } if (!newsgroup.IsComment) { btnComment.Visible = false; CommentPanel.Visible = false; } else { btnComment.Visible = true; CommentPanel.Visible = true; GetNewsCommentById(Id); } //ViewRegister(Id); //ltlFb_like.Text = "<div class='fb-like' data-href='http://http://tuyensinhtructuyen.edu.vn/ts/" + GetString(newsgroup.Title) + "-" + newsgroup.GroupCate + "-" + newsgroup.NewsGroupID + ".aspx' data-send='true' data-width='670' data-height='65' data-show-faces='true'></div>"; //ltlFb_comment.Text = "<div class='fb-comments' data-href='http://http://tuyensinhtructuyen.edu.vn/ts/" + GetString(newsgroup.Title) + "-" + newsgroup.GroupCate + "-" + newsgroup.NewsGroupID + ".aspx' data-num-posts='10' data-width='670'></div>"; Page.Title = newsgroup.Title; HtmlMeta _desrip = new HtmlMeta(); _desrip.Name = "description"; _desrip.Content = Tool.StripTagsCharArray(newsgroup.ShortDescribe) + " ; " + newsgroup.Title + " , " + (newsgroup.Tags) + " , " + newsgroup.Keyword; Page.Header.Controls.Add(_desrip); System.Web.UI.HtmlControls.HtmlMeta _keyWords = new HtmlMeta(); _keyWords.Name = "keywords"; _keyWords.Content = newsgroup.Keyword; Page.Header.Controls.Add(_keyWords); }