//private void GetCateParentNewsGroup(int cId, int gId) //{ // string strCate = this.GetCateParentIDArrayByID(cId, gId); // NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); // DataTable newsGroupPaging = newsGroupBSO.GetNewsGroupPaging(Language.language, Convert.ToInt32(hddGroupCate.Value), strCate, _page); // if (newsGroupPaging.Rows.Count > 0) // { // TotalRecord = Convert.ToInt32(newsGroupPaging.Rows[0]["Total"].ToString()); // SetAttributeGvArticle(Convert.ToInt32(newsGroupPaging.Rows[0]["Total"].ToString())); // rptListNewsGroup.DataSource = newsGroupPaging; // rptListNewsGroup.DataBind(); // Paging.DataLoad(); // if (TotalPage(Convert.ToInt32(newsGroupPaging.Rows[0]["Total"].ToString())) <= 1L) // { // Paging.Visible = false; // } // else // { // Paging.Visible = true; // } // } // else // { // SetAttributeGvArticle(0); // Paging.Visible = false; // } // //CateNewsBSO cateNewsBSO = new CateNewsBSO(); // //DataTable cateClientGroup = cateNewsBSO.getCateClientGroup(cId, Language.language, gId, 5); // //if (cateClientGroup.Rows.Count > 0) // //{ // // tintuc_col1.Attributes.Add("class", "tintuc-col1"); // // ViewListCate(cId, gId); // //} // //else // //{ // // tintuc_col1.Attributes.Add("class", "tintuc-col-main"); // //} // PagingInfo paging = new PagingInfo(10, (Convert.ToInt32(hdnPage.Value) + 1), true); // DataTable newsGroupPaging2 = newsGroupBSO.GetNewsGroupPaging(Language.language, Convert.ToInt32(hddGroupCate.Value), paging); // if (newsGroupPaging2.Rows.Count > 0) // { // newsOther.Visible = true; // rptListNewsOther.DataSource = newsGroupPaging2; // rptListNewsOther.DataBind(); // return; // } // newsOther.Visible = false; //} private void ViewListCate(int cId, int gId) { //Cate CateNewsBSO cateNewsBSO = new CateNewsBSO(); DataTable tblCateClient = new DataTable(); if (!AspNetCache.CheckCache("tblCateClient_" + gId + "_" + cId)) { tblCateClient = cateNewsBSO.getCateClientGroupUrl(cId, Language.language, gId, 4); AspNetCache.SetCacheWithTime("tblCateClient_" + gId + "_" + cId, tblCateClient, 150.0); } else { tblCateClient = (DataTable)AspNetCache.GetCache("tblCateClient_" + gId + "_" + cId); } string strCateSub = ""; if (tblCateClient.Rows.Count > 0) { strCateSub += "<div class='r-ro'>"; for (int i = 0; i < tblCateClient.Rows.Count; i++) { DataRow dataRow = tblCateClient.Rows[i]; if (Convert.ToBoolean(dataRow["isUrl"])) { strCateSub += "<a class='catelink' href='" + dataRow["Url"] + "' title='" + dataRow["CateNewsName"] + "'>" + dataRow["ShortName"] + "</a>"; } else { strCateSub += "<a class='catelink' href='" + ResolveUrl("~/") + "c3/" + cateNewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx' title='" + dataRow["CateNewsName"] + "'>" + dataRow["ShortName"] + "</a>"; } //if (i < tblCateClient.Rows.Count - 1) // strCateSub += "<span class='catelink-line'> </span>"; } strCateSub += "</div>"; ltlCateLink.Text = strCateSub; } else { ltlCateLink.Visible = false; } //GetNews DataTable table = new DataTable(); if (!AspNetCache.CheckCache("HTML_AboutTabListbyCate_" + gId + "_" + cId)) { NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); if (cId == 0) { table = newsGroupBSO.GetNewsGroupHot(Language.language, "1", gId); } else { table = newsGroupBSO.GetNewsGroupByCateHotAll(cId, gId, "1", "1", "1"); } AspNetCache.SetCacheWithTime("HTML_AboutTabListbyCate_" + gId + "_" + cId, table, 150.0); } else { table = (DataTable)AspNetCache.GetCache("HTML_AboutTabListbyCate_" + gId + "_" + cId); } if (table.Rows.Count > 0) { DataTable tableHot = table.Clone(); DataTable tableOther = table.Clone(); //SubCate if (tblCateClient.Rows.Count == 0 || tblCateClient == null) { for (int i = 0; i < table.Rows.Count; i++) { if (i < 4) { tableHot.ImportRow(table.Rows[i]); } else { tableOther.ImportRow(table.Rows[i]); } } string strTabNews = ""; if (tableHot.Rows.Count > 0) { strTabNews += "<div class='tab_title-tabdetail'>"; strTabNews += "<ul id='detailtabs' class='tabdetail'>"; for (int i = 0; i < tableHot.Rows.Count; i++) { DataRow row = tableHot.Rows[i]; strTabNews += "<li><a href='' rel='detail_news_" + i + "' class='selected'>"; strTabNews += row["ShortTitle"]; strTabNews += "</a></li>"; } strTabNews += "</ul>"; strTabNews += "</div> "; for (int i = 0; i < tableHot.Rows.Count; i++) { DataRow row = tableHot.Rows[i]; strTabNews += "<div id='detail_news_" + i + "' class='tabcontent-detail'>"; strTabNews += "<div class='main-tab-vanban-detail'>"; strTabNews += row["FullDescribe"]; strTabNews += "</div>"; strTabNews += "</div>"; } } newsTabList.Text = strTabNews; } else //CateParent { for (int i = 0; i < table.Rows.Count; i++) { if (i < 1) { tableHot.ImportRow(table.Rows[i]); } else { tableOther.ImportRow(table.Rows[i]); } } string newsdetail = ""; if (tableHot.Rows.Count > 0) { DataRow row = tableHot.Rows[0]; newsdetail += "<h1 class='news-title-detail'>"; newsdetail += row["Title"]; newsdetail += "</h1>"; newsdetail += "<div class='news-detail-ct'>"; newsdetail += "<p>"; newsdetail += row["FullDescribe"]; newsdetail += "</p>"; newsdetail += "</div>"; } newsTabList.Text = newsdetail; } if (tableOther.Rows.Count > 0) { newsOther.Visible = true; rptListNewsOther.DataSource = tableOther; rptListNewsOther.DataBind(); } else { newsOther.Visible = false; } } else { newsOther.Visible = false; } DataTable table1 = new DataTable(); if (!AspNetCache.CheckCache("HTML_AboutTabListbyCate1_" + gId + "_" + cId)) { NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); if (cId == 0) { table1 = newsGroupBSO.GetNewsGroupHot(Language.language, "1", "0", gId); } else { table1 = newsGroupBSO.GetNewsGroupByCateHotAll(cId, gId, "1", "1", "0"); } AspNetCache.SetCacheWithTime("HTML_AboutTabListbyCate1_" + gId + "_" + cId, table1, 150.0); } else { table1 = (DataTable)AspNetCache.GetCache("HTML_AboutTabListbyCate1_" + gId + "_" + cId); } if (table1.Rows.Count > 0) { newsOther1.Visible = true; rptNewsOther1.DataSource = table1; rptNewsOther1.DataBind(); } else { newsOther1.Visible = false; } }
private void ViewListCate(int cId, int gId) { //Cate //CateNewsBSO cateNewsBSO = new CateNewsBSO(); //DataTable tblCateClient = new DataTable(); //if (!AspNetCache.CheckCache("tblCateClient_" + gId + "_" + cId)) //{ // tblCateClient = cateNewsBSO.getCateClientGroupUrl(cId, Language.language, gId, 4); // AspNetCache.SetCacheWithTime("tblCateClient_" + gId + "_" + cId, tblCateClient, 150.0); //} //else // tblCateClient = (DataTable)AspNetCache.GetCache("tblCateClient_" + gId + "_" + cId); //string strCateSub = ""; //if (tblCateClient.Rows.Count > 0) //{ // strCateSub += "<div class='r-ro'>"; // for (int i = 0; i < tblCateClient.Rows.Count; i++) // { // DataRow dataRow = tblCateClient.Rows[i]; // if (Convert.ToBoolean(dataRow["isUrl"])) // { // strCateSub += "<a class='catelink' href='" + dataRow["Url"] + "' title='" + dataRow["CateNewsName"] + "'>" + dataRow["ShortName"] + "</a>"; // } // else // { // strCateSub += "<a class='catelink' href='" + ResolveUrl("~/") + "c3/" + cateNewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx' title='" + dataRow["CateNewsName"] + "'>" + dataRow["ShortName"] + "</a>"; // } // //if (i < tblCateClient.Rows.Count - 1) // // strCateSub += "<span class='catelink-line'> </span>"; // } // strCateSub += "</div>"; // //ltlCateLink.Text = strCateSub; //} ////else //// ltlCateLink.Visible = false; //GetNews DataTable table = new DataTable(); if (!AspNetCache.CheckCache("HTML_AboutTabListbyCate_" + gId + "_" + cId)) { NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); if (cId == 0) { table = newsGroupBSO.GetNewsOneByGroup(Language.language, "1", gId); } else { table = newsGroupBSO.GetNewsGroupByCateHotAll(cId, gId, "1", "1", "1"); } AspNetCache.SetCacheWithTime("HTML_AboutTabListbyCate_" + gId + "_" + cId, table, 150.0); } else { table = (DataTable)AspNetCache.GetCache("HTML_AboutTabListbyCate_" + gId + "_" + cId); } if (table.Rows.Count > 0) { DataTable tableHot = table.Clone(); DataTable tableOther = table.Clone(); ////SubCate //if (tblCateClient.Rows.Count == 0 || tblCateClient == null) //{ // for (int i = 0; i < table.Rows.Count; i++) // { // if (i < 4) // tableHot.ImportRow(table.Rows[i]); // else // tableOther.ImportRow(table.Rows[i]); // } // string strTabNews = ""; // if (tableHot.Rows.Count > 0) // { // strTabNews += "<div class='tab_title-tabdetail'>"; // strTabNews += "<ul id='detailtabs' class='tabdetail'>"; // for (int i = 0; i < tableHot.Rows.Count; i++) // { // DataRow row = tableHot.Rows[i]; // strTabNews += "<li><a href='' rel='detail_news_" + i + "' class='selected'>"; // strTabNews += row["Title"]; // strTabNews += "</a></li>"; // } // strTabNews += "</ul>"; // strTabNews += "</div> "; // for (int i = 0; i < tableHot.Rows.Count; i++) // { // DataRow row = tableHot.Rows[i]; // strTabNews += "<div id='detail_news_" + i + "' class='tabcontent-detail'>"; // strTabNews += "<div class='main-tab-vanban-detail'>"; // strTabNews += row["FullDescribe"]; // strTabNews += "</div>"; // strTabNews += "</div>"; // } // } // newsTabList.Text = strTabNews; //} //else //CateParent //{ for (int i = 0; i < table.Rows.Count; i++) { if (i < 1) { tableHot.ImportRow(table.Rows[i]); } else { tableOther.ImportRow(table.Rows[i]); } } if (tableHot.Rows.Count > 0) { DataRow row = tableHot.Rows[0]; ltlTitle.Text = row["Title"].ToString(); //LabelDate.Text = newsgroup.PostDate.ToString("dd/MM/yyyy");// Convert.ToString(newsgroup.PostDate); // ltlDescribe.Text = newsgroup.ShortDescribe; FullDescirbe.Text = row["FullDescribe"].ToString(); LabelAuthor.Text = row["Author"].ToString(); lblAproved.Text = Convert.ToDateTime(row["PostDate"].ToString()).ToString("dd/MM/yyyy hh:mm"); } //newsTabList.Text = newsdetail; //} if (tableOther.Rows.Count > 0) { newsOther.Visible = true; rptListNewsOther.DataSource = tableOther; rptListNewsOther.DataBind(); } else { newsOther.Visible = false; } } else { newsOther.Visible = false; } DataTable table1 = new DataTable(); if (!AspNetCache.CheckCache("HTML_AboutTabListbyCate11_" + gId + "_" + cId)) { NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); if (cId == 0) { table1 = newsGroupBSO.GetNewsGroupHot(Language.language, "1", "0", gId); } else { table1 = newsGroupBSO.GetNewsGroupByCateHotAll(cId, gId, "1", "1", "0"); } AspNetCache.SetCacheWithTime("HTML_AboutTabListbyCate11_" + gId + "_" + cId, table1, 150.0); } else { table1 = (DataTable)AspNetCache.GetCache("HTML_AboutTabListbyCate11_" + gId + "_" + cId); } if (table1.Rows.Count > 0) { newsOther1.Visible = true; rptNewsOther1.DataSource = table1; rptNewsOther1.DataBind(); } else { newsOther1.Visible = false; } }