protected string LoadMenu() { string top = ""; string field = "*"; string condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByVgapp(app), GroupsTSql.GetGroupsByIgparentid("0"), GroupsTSql.GetGroupsByIgenable("1"), GroupsTSql.GetGroupsByVglang(lang)); string orderby = GroupsColumns.IgorderColumn; DataTable dt = Groups.GetGroups(top, field, condition, orderby); string s = ""; if (dt.Rows.Count > 0) { string link = ""; string subMenus = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = RewriteExtension.GetLinkMenu(dt.Rows[i][GroupsColumns.VgdescColumn].ToString()); subMenus = LoadChildMenu(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), dt.Rows[i][GroupsColumns.VgdescColumn].ToString(), "", "1"); s += @" <li class='litop item " + (subMenus != "" ? "nb-dropdown" : "") + @"'> <a class='item-link' href='" + link + @"' " + MenuExtension.GetTarget(dt.Rows[i][GroupsColumns.VgparamsColumn].ToString()) + @" title='" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"'> <span>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</span> </a> " + subMenus + @" </li>"; } } return(s); }
private void GetAllTag() { condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByVgapp(app), GroupsTSql.GetGroupsByIgparentid("0"), GroupsTSql.GetGroupsByIgenable("1") ); if (ddlTagModul.SelectedValue.Length > 0) { condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgparams(ddlTagModul.SelectedValue)); } fields = DataExtension.GetListColumns(GroupsColumns.VgnameColumn, GroupsColumns.IgidColumn); orderby = GroupsColumns.VgnameColumn; DataTable dt = new DataTable(); dt = Groups.GetGroups("", fields, condition, orderby); cblListTag.DataSource = dt; cblListTag.DataTextField = GroupsColumns.VgnameColumn; cblListTag.DataValueField = GroupsColumns.IgidColumn; cblListTag.DataBind(); }
void GetList() { #region Condition, orderby string condition = ""; if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } else { condition = GroupsTSql.GetGroupsByIgid(igidFirst); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (key.Length > 0) { condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn)); } string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } #endregion DataSet ds = GroupsItems.GetAllDataPagging(p, rows.ToString(), condition, orderby); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; DataTable dtPager = ds.Tables[1]; #region Lấy ra danh sách bài viết if (dt.Rows.Count > 0) { string link = ""; string price = "", salePrice = ""; string time = ""; int point = 2; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); price = dt.Rows[i][ItemsColumns.FipriceColumn].ToString(); salePrice = dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString(); if (price == "0" || price == "") { price = ""; salePrice = LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ"); } else if (salePrice == "0" || salePrice == "") { salePrice = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); price = ""; } else { price = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); salePrice = NumberExtension.FormatNumber(salePrice) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); } time = LayThoiGianTour(dt.Rows[i][ItemsColumns.ViurlColumn].ToString()); if (i < point) { ltrList1.Text += @" <div class='item item-post item-big'> <div class='item-img'> <a href='" + link + @"' class='imgc' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> <div class='item-date'> <div> <i class='fa fa-calendar' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Time") + @": " + time + @"</span> </div> <div> <i class='fa fa-plane' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Departure") + @": " + dt.Rows[i][ItemsColumns.VISEOMETAPARAMSColumn] + @"</span> </div> </div> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <p class='item-text'>" + dt.Rows[i][ItemsColumns.VidescColumn].ToString() + @"</p> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div>"; } else { ltrList2.Text += @" <div class='col'> <div class='item item-post'> <div class='item-img'> <a href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> <div class='item-date'> <div> <i class='fa fa-calendar' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Time") + @": " + time + @"</span> </div> <div> <i class='fa fa-plane' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Departure") + @": " + dt.Rows[i][ItemsColumns.VISEOMETAPARAMSColumn] + @"</span> </div> </div> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div> </div>"; } } } #endregion #region Xuất ra phân trang if (dtPager.Rows.Count > 0 && dt.Rows.Count > 0) { string split = PagingExtension.SpilitPages(int.Parse(dtPager.Rows[0]["TotalRows"].ToString()), rows, int.Parse(p), "", "hientai", "trangkhac", "dau", "cuoi", "truoc", "sau"); if (split.Length > 0) { int totalPage = 0; try { double totalrow = double.Parse(dtPager.Rows[0]["TotalRows"].ToString()); totalPage = (int)(totalrow / rows); if (totalPage < (totalrow / rows)) { totalPage++; } } catch { } ltrPaging.Text += PagingExtension02.XuLyPhanTrang(split, dtPager.Rows[0]["TotalRows"].ToString(), (title != "" ? title : go), LanguageItemExtension.GetnLanguageItemTitleByName("Trang đầu"), LanguageItemExtension.GetnLanguageItemTitleByName("Trang cuối"), LanguageItemExtension.GetnLanguageItemTitleByName("Trước"), LanguageItemExtension.GetnLanguageItemTitleByName("Sau")); } else { if (dt.Rows.Count < 1) { ltrNoResult.Text += "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName(noResultText) + "</div>"; pnInfo.Visible = false; } } } else { ltrNoResult.Text += "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName(noResultText) + "</div>"; pnInfo.Visible = false; } #endregion } }
string LoadNicks() { string s = ""; string orderby = GroupsItemsColumns.IorderColumn; string condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByVgapp(app), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByViapp(app), ItemsTSql.GetItemsByIienable("1") ); DataTable dt = new DataTable(); dt = GroupsItems.GetAllData("", "*", condition, orderby); string title = ""; string img = ""; string yahoo = "", viber = "", fb = "", zalo = "", skype = "", email = "", phone = ""; if (dt.Rows.Count == 0) { return(""); } for (int i = 0; i < dt.Rows.Count; i++) { img = ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, ""); title = dt.Rows[i][ItemsColumns.VititleColumn].ToString(); yahoo = dt.Rows[i][ItemsColumns.ViurlColumn].ToString(); viber = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 5); fb = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 6); zalo = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 4); skype = dt.Rows[i][ItemsColumns.ViauthorColumn].ToString(); email = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 3); phone = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 1); s += @" <div class='itemhotro'> <a class='title'>" + title + @"</a> <div class='hotline'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Hotline") + @": <span>" + phone + @"</span></div> <div class='mxh'> <a class='email' href='mailto:" + email + @"'> <img src='Css/pic/email1.png' /></a> <a class='skype' href='skype:call?" + skype + @"'> <img src='Css/pic/skype.png' /></a> <a class='zalo' href='tel:" + zalo + @"'> <img src='Css/pic/zalo.png' /></a> </div> </div>"; } s = @" <div class='hotro' id='popuplh'> <a class='close' ></a> <div class='noidungtb'> <a class='closepopup'></a> <div class='nenpopup'> " + LoadTitle() + @" " + s + @" </div> </div> </div> "; return(s); }
string GetCate() { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsTSql.GetGroupsByIgid(igid); } else { condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgparentid("0"), GroupsTSql.GetGroupsByVgapp(app)); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1")); string orderby = GroupsColumns.VGSEOMETAPARAMSColumn; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn); #endregion DataTable dt = Groups.GetGroups("", "*", condition, orderby); string link = ""; string list = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "1") { s += @" <div class='itemM itemM--style02 fade-up'> <div class='itemM__content'> <h2 class='itemM__ttl'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2> <p class='txtBase'> " + StringExtension.LayChuoi(dt.Rows[i][GroupsColumns.VgcontentColumn].ToString(), "", 1) + @" </p> </div> <div class='itemM__img img'> <div class='img__crop'> " + ImagesExtension.GetImage(pic, dt.Rows[i][GroupsColumns.VgimageColumn].ToString(), dt.Rows[i][GroupsColumns.VgnameColumn].ToString(), "", true, false, "") + @" </div> </div> </div> "; } else if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "2") { list = GetList(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString()); if (list.Length > 0) { s += @" <h2 class=' ttl-comp03 ttl-comp03--md fade-up'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2> <div class='list-service'> " + list + @" </div> "; } } else if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "3") { list = GetList2(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString()); if (list.Length > 0) { s += list; } } else if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "4") { list = GetList3(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString()); if (list.Length > 0) { s += @" <div class='price-album'> <h2 class='ttl-comp03 ttl-comp03--md fade-up'>album ảnh cưới tại blue lotus</h2> <div class='list-price'> " + list + @" </div> </div> "; } } } return(s); }
string GetList2(string igid, string top) { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } else { condition = GroupsTSql.GetGroupsByVgapp(app); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (key.Length > 0) { condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn)); } string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; string fields = DataExtension.GetListColumns(ItemsColumns.VititleColumn, ItemsColumns.ViimageColumn, ItemsColumns.VISEOLINKSEARCHColumn, ItemsColumns.VidescColumn, ItemsColumns.DiCreateDate, ItemsColumns.IiTotalView); #endregion DataTable dt = GroupsItems.GetAllData("2", "*", condition, orderby); #region Lấy ra danh sách bài viết if (dt.Rows.Count > 0) { string link = (UrlExtension.WebisteUrl + dt.Rows[0][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); if (i == 0) { s += @" <section class='sec-content'> <div class='inner'> <h2 class='ttl-comp03 ttl-comp03--md fade-up'>" + dt.Rows[i][ItemsColumns.VititleColumn].ToString() + @"</h2> <div class='box-tab'> " + GetOtherImages(dt.Rows[i][ItemsColumns.IidColumn].ToString()) + @" </div> </div> </section> "; } else { s += @" <section class='sec-picdrink fade-up'> <div class='inner'> <h2 class='ttl-comp03 ttl-comp03--md fade-up'>" + dt.Rows[i][ItemsColumns.VititleColumn].ToString() + @"</h2> </div> <div class='list-picdrink'> " + GetOtherImages2(dt.Rows[i][ItemsColumns.IidColumn].ToString()) + @" </div> </section> "; } } } #endregion return(s); }
void GetList() { #region Condition, orderby string condition = ""; if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } else { condition = GroupsTSql.GetGroupsByVgapp(app); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (key.Length > 0) { condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn)); } string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } #endregion DataSet ds = GroupsItems.GetAllDataPagging(p, rows.ToString(), condition, orderby); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; DataTable dtPager = ds.Tables[1]; #region Lấy ra danh sách bài viết if (dt.Rows.Count > 0) { string link = ""; string bigPost = "", smallPost = ""; string price = "", salePrice = ""; int point = 2; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); price = dt.Rows[i][ItemsColumns.FipriceColumn].ToString(); salePrice = dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString(); if (price == "0" || price == "") { price = ""; salePrice = LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ"); } else if (salePrice == "0" || salePrice == "") { salePrice = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); price = ""; } else { price = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); salePrice = NumberExtension.FormatNumber(salePrice) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); } if (i < point) { bigPost += @" <div class='blog'> <div class='item item-row'> <div class='item-img'> <a href='" + link + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title fSize-20'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <div class='item-text'> " + StringExtension.LayChuoi(dt.Rows[i][ItemsColumns.VicontentColumn].ToString(), "", 1) + @" </div> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div> </div>"; } else { smallPost += @" <div class='col-12 col-sm-12 col-md-6 col-lg-6 col-xl-3'> <div class='item item-post'> <div class='item-img'> <a href='" + link + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div> </div>"; } ltrList.Text = @" <div class='sublist sublist-1'> <div class='sublist-body'> <div class='slick-slider' data-slick='{'slidesToShow': 1, 'slidesToScroll': 1, 'autoplay': true, 'dots': false, 'arrows':true}'> " + bigPost + @" </div> </div> </div> <div class='sublist sublist-2'> <div class='sublist-body'> <div class='row'> " + smallPost + @" </div> </div> </div>"; } } #endregion #region Xuất ra phân trang if (dtPager.Rows.Count > 0 && dt.Rows.Count > 0) { string split = PagingExtension.SpilitPages(int.Parse(dtPager.Rows[0]["TotalRows"].ToString()), rows, int.Parse(p), "", "hientai", "trangkhac", "dau", "cuoi", "truoc", "sau"); if (split.Length > 0) { int totalPage = 0; try { double totalrow = double.Parse(dtPager.Rows[0]["TotalRows"].ToString()); totalPage = (int)(totalrow / rows); if (totalPage < (totalrow / rows)) { totalPage++; } } catch { } ltrPaging.Text += PagingExtension02.XuLyPhanTrang(split, dtPager.Rows[0]["TotalRows"].ToString(), (title != "" ? title : go), LanguageItemExtension.GetnLanguageItemTitleByName("Đầu"), LanguageItemExtension.GetnLanguageItemTitleByName("Cuối"), LanguageItemExtension.GetnLanguageItemTitleByName("Trước"), LanguageItemExtension.GetnLanguageItemTitleByName("Sau")); } else { if (dt.Rows.Count < 1) { ltrList.Text += "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName(noResultText) + "</div>"; } } } else { ltrList.Text += "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName(noResultText) + "</div>"; } #endregion } }
void GetList() { #region Condition, orderby string condition = ""; if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } else { condition = GroupsTSql.GetGroupsByVgapp(app); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1")); if (key.Length > 0) { condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn)); } string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } #endregion DataTable dt = GroupsItems.GetAllData("", "*", condition, orderby); #region Lấy ra danh sách bài viết string s = ""; string s1 = ""; string s2 = ""; if (dt.Rows.Count > 0) { string link = ""; string titleIT = ""; string img = ""; string detail = ""; string dateIT = ""; string countView = ""; string ds_tintucnoibat_right = ""; s += @"<div class='head_news'> <div class='list-news01'>"; s2 += @"<div class='main-left'> <div class='list-news02'>"; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); img = ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, ""); titleIT = dt.Rows[i][ItemsColumns.VititleColumn].ToString().Replace("'", ""); detail = dt.Rows[i][ItemsColumns.ViDesc].ToString(); dateIT = ((DateTime)dt.Rows[i][ItemsColumns.DiCreateDate]).ToString(LanguageItemExtension.GetnLanguageItemTitleByName("dd/MM/yyyy")); countView = NumberExtension.FormatNumber(((int)dt.Rows[i][ItemsColumns.IitotalviewColumn]).ToString()); if (i < 6) { s += @" <div class='list-news01__item fade-up'> <div class='img'> <a class='img__crop' href='" + link + "' title='" + titleIT + @"'>" + img + @"</a> </div> <h2 class='list-news01__ttl'><a href='" + link + "' title='" + titleIT + @"'>" + titleIT + @"</a></h2> </div> "; } if (i > 5) { s2 += @" <div class='list-news02__item fade-up " + (i > 8?"hide":"") + @"'> <div class='list-news02__img img'> <a class='img__crop' href='" + link + "' title='" + titleIT + @"'>" + img + @"</a> </div> <div class='list-news02__content'> <h3 class='list-news02__ttl'><a href='" + link + "' title='" + titleIT + @"'>" + titleIT + @" </a></h3> <p class='txtBase'>" + detail + @"</p> </div> </div>"; } } s += @"</div></div>"; s2 += @"</div> <a href='javascript:void(0)' onclick='showmoreNews(this)' class='btn-view fade-up'>Xem thêm tin</a></div>"; } #endregion s1 += @" <h2 class='ttl-comp04 fade-up'><span><b>Tin khác</b></span></h2> <div class='main-news'>"; s1 += s2; s1 += GetGroups2(""); s1 += @"</div></div>"; ltrList.Text = s + s1; }
string GetCate() { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsTSql.GetGroupsByIgid(igid); } else { condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgparentid("0"), GroupsTSql.GetGroupsByVgapp(app)); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1")); string orderby = GroupsColumns.VGSEOMETAPARAMSColumn; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn); #endregion DataTable dt = Groups.GetGroups("", "*", condition, orderby); string link = ""; string list = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); s += @" <div class='item-seminor'> <div class='inner'> <div class='item-seminor__img fade-up'> <div class='img'> <div class='img__crop'> " + ImagesExtension.GetImage(pic, dt.Rows[i][GroupsColumns.VgimageColumn].ToString(), dt.Rows[i][GroupsColumns.VgnameColumn].ToString(), "", true, false, "", false) + @" </div> </div> </div> <div class='item-seminor__content fade-up'> <h2 class='item-seminor__ttl'> <span>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</span> </h2> <p class='txtBase'><span>" + dt.Rows[i][GroupsColumns.VgdescColumn] + @"</span></p> <div class='txt-center'> <a href='" + link + @"' class='btn on'>Xem chi tiết</a> </div> </div> </div> </div> "; } return(s); }
string GetList() { string s = ""; string condition = GroupsTSql.GetGroupsByVgapp(app); if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (iid != "") { condition += " and ITEMS.IID<> " + iid + " "; } string fields = DataExtension.GetListColumns(ItemsColumns.VititleColumn, ItemsColumns.IitotalviewColumn, ItemsColumns.VISEOLINKSEARCHColumn, ItemsColumns.DicreatedateColumn, ItemsColumns.ViImage); string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } DataTable dt = new DataTable(); dt = GroupsItems.GetAllData(rows.ToString(), "*", condition, orderby); if (dt.Rows.Count > 0) { string link = ""; s += @"<h2 class='ttl-comp04 fade-up'><span><b>Tin khác</b></span></h2> <div class='other-news'>"; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); s += @" <div class='other-news__item fade-up'> <div class='other-news__img img'> <a class='img__crop' href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn].ToString().Replace("'", "") + @"'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> </div> <h3 class='other-news__ttl'><a href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn].ToString().Replace("'", "") + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a></h3> <div class='thongke'> <div class='thongke__time'><i class='fa fa-clock-o'></i>" + ((DateTime)dt.Rows[i][ItemsColumns.DiCreateDate]).ToString(LanguageItemExtension.GetnLanguageItemTitleByName("dd/MM/yyyy")) + @"</div> <div class='thongke__view'><i class='fa fa-eye'></i>" + NumberExtension.FormatNumber(((int)dt.Rows[i][ItemsColumns.IitotalviewColumn] + 1).ToString()) + @" lượt xem</div> </div> <p class='txtBase'>" + dt.Rows[i][ItemsColumns.VidescColumn] + @"</p> </div>"; } s += @"</div>"; } return(s); }
string GetCate() { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsTSql.GetGroupsByIgid(igid); } else { condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgparentid("0"), GroupsTSql.GetGroupsByVgapp(app)); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1")); string orderby = GroupsColumns.IgorderColumn + "," + GroupsColumns.DgcreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn, GroupsColumns.VgdescColumn); #endregion DataTable dt = Groups.GetGroups("", fields, condition, orderby); string link = ""; string list = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); list = GetList(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString()); if (list.Length > 0) { s += @" <div class='section tag-service'> <div class='container'> <div class='list'> <h2> <a href='" + link + @"' class='title list-title txtCenter fSize-34 fSize-sm-26 nb-color-m1' title='" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</a> </h2> <p class='list-text hed txtCenter'>" + dt.Rows[i][GroupsColumns.VgdescColumn] + @"</p> <div class='list-body'> " + list + @" </div> </div> </div> </div>"; } } return(s); }
string GetList(string igid, string top) { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } else { condition = GroupsTSql.GetGroupsByVgapp(app); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (key.Length > 0) { condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn)); } string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; string fields = DataExtension.GetListColumns(ItemsColumns.VititleColumn, ItemsColumns.ViimageColumn, ItemsColumns.VISEOLINKSEARCHColumn, ItemsColumns.VidescColumn, ItemsColumns.DiCreateDate, ItemsColumns.IiTotalView, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn, ItemsColumns.VicontentColumn); #endregion DataTable dt = GroupsItems.GetAllData(top, fields, condition, orderby); #region Lấy ra danh sách bài viết if (dt.Rows.Count > 0) { string link = ""; string bigPost = "", smallPost = ""; string price = "", salePrice = ""; int point = dt.Rows.Count - 4; if (point < 1) { point = 1; } for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); price = dt.Rows[i][ItemsColumns.FipriceColumn].ToString(); salePrice = dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString(); if (price == "0" || price == "") { price = ""; salePrice = LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ"); } else if (salePrice == "0" || salePrice == "") { salePrice = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); price = ""; } else { price = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); salePrice = NumberExtension.FormatNumber(salePrice) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); } if (i < point) { bigPost += @" <div class='blog'> <div class='item item-row'> <div class='item-img'> <a href='" + link + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title fSize-20'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <div class='item-text'> " + StringExtension.LayChuoi(dt.Rows[i][ItemsColumns.VicontentColumn].ToString(), "", 1) + @" </div> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div> </div>"; } else { smallPost += @" <div class='col-12 col-sm-12 col-md-6 col-lg-6 col-xl-3'> <div class='item item-post'> <div class='item-img'> <a href='" + link + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div> </div>"; } } s = @" <div class='sublist sublist-1'> <div class='sublist-body'> <div class='slick-slider' data-slick='{'slidesToShow': 1, 'slidesToScroll': 1, 'autoplay': false, 'dots': false, 'arrows':true}'> " + bigPost + @" </div> </div> </div> <div class='sublist sublist-2'> <div class='sublist-body'> <div class='row'> " + smallPost + @" </div> </div> </div>"; } #endregion return(s); }
string GetList() { string s = ""; string condition = GroupsTSql.GetGroupsByVgapp(app); if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (iid != "") { condition += " and ITEMS.IID<> " + iid + " "; } string fields = DataExtension.GetListColumns(ItemsColumns.VititleColumn, ItemsColumns.IitotalviewColumn, ItemsColumns.VISEOLINKSEARCHColumn, ItemsColumns.DicreatedateColumn, ItemsColumns.ViImage, ItemsColumns.VidescColumn); string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } DataTable dt = new DataTable(); dt = GroupsItems.GetAllData(rows.ToString(), fields, condition, orderby); if (dt.Rows.Count > 0) { string link = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); s += @" <div class='blog'> <div class='item item-post'> <div class='item-img'> <a href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> </div> <div class='item-body'> <h3><a href='" + link + @"' class='title item-title' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a></h3> <p class='item-text'> " + dt.Rows[i][ItemsColumns.VidescColumn] + @" </p> </div> </div> </div>"; } } return(s); }
/// <summary> /// Lấy danh sách các nhóm /// </summary> /// <returns></returns> private string GetGroups(string position) { string s = ""; string condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByIgenable("1"), GroupsTSql.GetGroupsByVgapp(appGroup), GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByVgparams(position) ); string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn, GroupsColumns.IgtotalitemsColumn, GroupsColumns.VgdescColumn, GroupsColumns.VgimageColumn, GroupsColumns.VGSEOMETACANONICALColumn); DataTable dt = Groups.GetGroups("", fields, condition, GroupsColumns.IgorderColumn); string link = ""; string linkCate = ""; if (dt.Rows.Count > 0) { link = UrlExtension.WebisteUrl + rewrite + RewriteExtension.Extensions; s += @" <div class='section facilities'> <div class='container'> <div class='list'> <h2> <a href='" + link + @"' class='title list-title txtCenter fSize-34 fSize-sm-26 nb-color-m1'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Accommodation facilities") + @"</a> </h2> <p class='list-text hed txtCenter'>" + LanguageItemExtension.GetnLanguageItemTitleByName("If you want to travel to Quang Ninh and especially want to go to Ha Long, here are the most useful Ha Long travel experiences: How to travel to Ha Long? Where to Ha Long to go, eat, play what? Hotels in Ha Long") + @"</p> <div class='list-body clearfix'>"; for (int i = 0; i < dt.Rows.Count; i++) { linkCate = LayLinkCate(dt.Rows[i][GroupsColumns.VGSEOMETACANONICALColumn].ToString()); s += @" <div class='col " + (i == 0 ? "bigTwo" : i == 3 ? "bigOne" : "") + @"'> <div class='item " + (i == 3 ? "item-bign" : "") + @"'> <div class='item-img'> <a href='" + linkCate + @"' title='" + dt.Rows[i][GroupsColumns.VgnameColumn].ToString() + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][GroupsColumns.VgimageColumn].ToString(), dt.Rows[i][GroupsColumns.VgnameColumn].ToString(), "", true, false, "") + @" </a> </div> <div class='item-body'> <h3> <a href='" + linkCate + @"' class='title item-title' title='" + dt.Rows[i][GroupsColumns.VgnameColumn].ToString() + @"'>" + dt.Rows[i][GroupsColumns.VgnameColumn].ToString() + @"</a> </h3> </div> </div> </div>"; } s += @" </div> </div> </div> </div>"; } return(s); }
string GetCate() { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsTSql.GetGroupsByIgid(igid); } else { condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgparentid("0"), GroupsTSql.GetGroupsByVgapp(app)); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1")); string orderby = GroupsColumns.VGSEOMETAPARAMSColumn + " DESC"; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn); #endregion DataTable dt = Groups.GetGroups("", "*", condition, orderby); string link = ""; string list = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "3") { list = GetList(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString()); s += @" <section class='sec-drink'> <div class='inner'> <h2 class='ttl-comp03 fade-up'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2> <div class='list-drink'> " + list + @" </div> </div> </section> "; } else if (dt.Rows[i][GroupsColumns.VGSEOMETAPARAMSColumn].ToString() == "0") { list = GetList2(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString()); if (list.Length > 0) { s += list; } } } return(s); }
private void LoadListSlider(string position, string cssImage) { //get data // lấy danh sách group có vị trí xác định string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn); string orderBy = GroupsColumns.IgorderColumn; string condition = DataExtension.AndConditon(GroupsTSql.GetByApp(app), GroupsTSql.GetByLang(lang), GroupsTSql.GetGroupsByIgenable("1"), GroupsTSql.GetGroupsByVgparams(position), GroupsTSql.GetByLang(lang)); DataTable dt = Groups.GetGroups("1", fields, condition, orderBy); if (dt.Rows.Count.Equals(0)) { return; } string igid = ""; // items info string title = ""; string img = ""; string href = ""; string viparams = ""; string target = ""; string content = ""; string strList = ""; for (int i = 0; i < dt.Rows.Count; i++) { igid = dt.Rows[i][GroupsColumns.IgidColumn].ToString(); // getListItem DataTable dataItems = GroupsItems.GetAllData("1", " * ", GroupsItemsTSql.GetItemsInGroupCondition(igid, ItemsTSql.GetItemsByIienable("1")), GroupsItemsColumns.IorderColumn); if (dt.Rows.Count.Equals(0)) { continue; } else { string s = ""; for (int j = 0; j < dataItems.Rows.Count; j++) { title = dataItems.Rows[j][ItemsColumns.VititleColumn].ToString(); viparams = dataItems.Rows[j][ItemsColumns.ViparamsColumn].ToString(); if (viparams.Equals("1")) { target = "target='_blank'"; } else { target = ""; } href = dataItems.Rows[j][ItemsColumns.ViurlColumn].ToString(); img = ImagesExtension.SetTypeImageAdvertising("1", pic, dataItems.Rows[j][ItemsColumns.ViimageColumn].ToString(), title, "", "", cssImage, false); content = dataItems.Rows[j][ItemsColumns.VISEOTITLEColumn].ToString(); ltrAdv.Text = @" <a href='" + href + "' title='" + title + @"' class='logo'> " + img + @" </a>"; } } } //// render //ltrAdv.Text = "<ul class='khoi1170'>" + strList + "</ul>"; }
string GetList() { string s = ""; string condition = GroupsTSql.GetGroupsByVgapp(app); if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (iid != "") { condition += " and ITEMS.IID<> " + iid + " "; } string fields = DataExtension.GetListColumns(ItemsColumns.VititleColumn, ItemsColumns.IitotalviewColumn, ItemsColumns.VISEOLINKSEARCHColumn, ItemsColumns.DicreatedateColumn, ItemsColumns.ViImage, ItemsColumns.VidescColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn); string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } DataTable dt = new DataTable(); dt = GroupsItems.GetAllData(rows.ToString(), fields, condition, orderby); if (dt.Rows.Count > 0) { string link = ""; string price = "", salePrice = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); price = dt.Rows[i][ItemsColumns.FipriceColumn].ToString(); salePrice = dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString(); if (price == "0" || price == "") { price = ""; salePrice = LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ"); } else if (salePrice == "0" || salePrice == "") { salePrice = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); price = ""; } else { price = NumberExtension.FormatNumber(price) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); salePrice = NumberExtension.FormatNumber(salePrice) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); } s += @" <div class='blog'> <div class='item item-post'> <div class='item-img'> <a href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViImage].ToString(), dt.Rows[0][ItemsColumns.ViTitle].ToString(), "", true, false, "") + @" </a> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div> </div>"; } } return(s); }
string LoadNicks() { string s = ""; string orderby = GroupsItemsColumns.IorderColumn; string condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByVgapp(app), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByViapp(app), ItemsTSql.GetItemsByIienable("1") ); DataTable dt = new DataTable(); dt = GroupsItems.GetAllData("", "*", condition, orderby); string title = ""; string img = ""; string yahoo = "", viber = "", fb = "", zalo = "", skype = "", email = "", phone = ""; if (dt.Rows.Count == 0) { return(""); } for (int i = 0; i < dt.Rows.Count; i++) { img = ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "tall", true, false, ""); title = dt.Rows[i][ItemsColumns.VititleColumn].ToString(); yahoo = dt.Rows[i][ItemsColumns.ViurlColumn].ToString(); viber = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 5); fb = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 6); zalo = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 4); skype = dt.Rows[i][ItemsColumns.ViauthorColumn].ToString(); email = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 3); phone = StringExtension.LayChuoi(dt.Rows[i]["VIPARAMS"].ToString(), "", 1); s += @" <div class='item'> <div class='item_box'> <div class='khungAnh'> <a href='javascript://' title='" + title + @"' class='khungAnhCrop' tabindex='-1'> " + img + @" </a> </div> <div class='item_details'> <div class='item_title'>" + title + @"</div> <div class='item_mxh'> <ul class='icon'> " + (skype.Length > 0 ? @" <li> <a href='skype:call?" + skype + @"'> <img src='Css/Pic/sk.png'></a> </li>" : "") + @" " + (zalo.Length > 0 ? @" <li> <a href='tel:" + zalo + @"'> <img src='Css/Pic/zl.png'></a> </li>" : "") + @" " + (viber.Length > 0 ? @" <li> <a href='tel:" + viber + @"'> <img src='~/Css/Pic/vb.png'></a> </li>" : "") + @" " + (fb.Length > 0 ? @" <li> <a href='" + fb + @"'> <img src='Css/Pic/fb.png'></a> </li>" : "") + @" </ul> </div> </div> <ul class='infocontact'> <li class='mail' href='mailto:" + email + "'>" + email + @"</li> <li class='phone' href='tel:" + phone + "'>" + phone + @"</li> </ul> </div> </div>"; } s = @" <div class='hotro_1'> <div class='slick_1'> " + s + @" </div> </div>"; return(s); }
void GetList() { #region Condition, orderby string condition = ""; if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } else { condition = GroupsTSql.GetGroupsByVgapp(app); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (key.Length > 0) { condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn)); } string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } #endregion DataTable dt = GroupsItems.GetAllData("", "*", condition, orderby); if (dt.Rows.Count > 0) { string link = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); if (i == 0) { ltrList.Text += @" <div class='itemM fade-up'> <div class='itemM__content'> <h2 class='itemM__ttl'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</h2> <p class='txtBase'> " + dt.Rows[i][ItemsColumns.VicontentColumn] + @" </p> </div> <div class='itemM__img img'> <div class='img__crop'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "", false) + @" </div> </div> </div>"; } else if (i == 1) { ltrList.Text += @" <h2 class='ttl-comp03 ttl-comp03--md fade-up active'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</h2> <div class='box-tab'> <div class='img-left'> <img src='/img/seminor/img-left.jpg' alt=''> </div> " + GetOtherImages(dt.Rows[i][ItemsColumns.IidColumn].ToString()) + @" <div class='img-right'> <img src='/img/seminor/img-right.jpg' alt=''> </div> </div> "; } else { ltrList.Text += @" <div class='picture-restaurant'> <h2 class='ttl-comp03 ttl-comp03--md fade-up active'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</h2> <div class='list-picture'> " + GetOtherImages2(dt.Rows[i][ItemsColumns.IidColumn].ToString()) + @" </div> </div>"; } } } }
string GetCate() { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsTSql.GetGroupsByIgid(igid); } else { condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgparentid("0"), GroupsTSql.GetGroupsByVgapp(app)); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1")); string orderby = GroupsColumns.IgorderColumn + "," + GroupsColumns.DgcreatedateColumn + " desc "; try { rows = int.Parse(SettingsExtension.GetSettingKey(maxItemKey, lang)); } catch { } string fields = DataExtension.GetListColumns(GroupsColumns.IgidColumn, GroupsColumns.VgnameColumn, GroupsColumns.VGSEOLINKSEARCHColumn); #endregion DataTable dt = Groups.GetGroups("", "*", condition, orderby); string link = ""; string list = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); if (dt.Rows[i][GroupsColumns.IgtotalitemsColumn].ToString() == "0") { s += @" <div class='itemM fade-up'> <div class='itemM__content'> <h2 class='itemM__ttl'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2> <p class='txtBase'> " + dt.Rows[i][GroupsColumns.VgcontentColumn] + @" </p> </div> <div class='itemM__img img'> <div class='img__crop'> " + ImagesExtension.GetImage(pic, dt.Rows[i][GroupsColumns.VgimageColumn].ToString(), dt.Rows[i][GroupsColumns.VgnameColumn].ToString(), "", true, false, "") + @" </div> </div> </div> "; } else { list = GetList(dt.Rows[i][GroupsColumns.IgidColumn].ToString(), rows.ToString()); if (list.Length > 0) { s += @" <h2 class='ttl-comp03 fade-up'>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</h2> <div class='list-service'> " + list + @" </div> "; } } } return(s); }
/// <summary> /// Lấy các thông tin items, groups theo title, ưu tiên tìm items trước groups, dữ liệu sẽ lưu vào Session["dataByTitle"], đồng thời xác định igid hoặc iid và go /// </summary> void GetItemsOrGroupsInfoByTitle() { #region Xóa các session cũ //Các Session lưu lại các thông tin để ko cần mất công lấy lại lần nữa tại các modul //Session["igid"]: igid hiện tại //Session["iid"]: iid hiện tại //Session["rewrite"]: RewriteExtension. hiện tại, vd: RewriteExtension.Product //Session["app"]: modul hiện tại: vd: TatThanhJsc.ProductModul.CodeApplications.Product //Session["apptitle"]: Tiêu đề modul hiện tại: vd: "Sản phẩm" //Session["vititle"]: vititle hiện tại //Session["vilink"]: link seo hiện tại của items //Session["dataByTitle"]: lưu dữ liệu tìm thấy theo title để khi vào trang chi tiết không cần lấy lại Session["go"] = null; Session["igid"] = null; Session["iid"] = null; Session["rewrite"] = null; Session["app"] = null; Session["apptitle"] = null; Session["vititle"] = null; Session["vilink"] = null; Session["MultipPageContent"] = null; Session["dataByTitle"] = null; Session["dataByTitle_Cate"] = null;//Lưu danh mục đang chứa items hiện tại igid = iid = ""; #endregion if (Request.QueryString["title"] != null) { #region Kiểm tra trước xem có items theo title này không string condition = ItemsTSql.GetItemsByVilang(lang); DataTable dt = RewriteExtension.GetItemsByTitle(title, ItemsTSql.GetItemsByIienable("1")); if (dt.Rows.Count > 0) { Session["dataByTitle"] = dt; Session["iid"] = dt.Rows[0][ItemsColumns.IidColumn].ToString(); Session["go"] = GetGoByApp(dt.Rows[0][ItemsColumns.ViappColumn].ToString()); //Lấy thông tin Groups của Items, có lưu Session["igid"] GetGroupsInfoByItemId(dt.Rows[0][ItemsColumns.IidColumn].ToString(), dt.Rows[0][ItemsColumns.ViappColumn].ToString()); return;//Nếu có items rồi thì không cần kiểm tra groups nữa } #endregion #region Kiểm tra xem có groups theo title này không - chỉ kiểm tra khi không có items condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), //CMS mới bỏ phần trang nội dung ở menu nên không tìm theo menu nữa GroupsColumns.VgappColumn + "<>'" + TatThanhJsc.MenuModul.CodeApplications.MenuMain + "'", GroupsColumns.VgappColumn + "<>'" + TatThanhJsc.MenuModul.CodeApplications.MenuBottom + "'", GroupsColumns.VgappColumn + "<>'" + TatThanhJsc.MenuModul.CodeApplications.MenuOther + "'", GroupsColumns.VgappColumn + "<>'" + TatThanhJsc.MenuModul.CodeApplications.MenuTop + "'" ); dt = RewriteExtension.GetGroupsByTitle(title, condition); if (dt.Rows.Count > 0) { Session["dataByTitle"] = dt; Session["dataByTitle_Cate"] = dt; Session["igid"] = dt.Rows[0][GroupsColumns.IgidColumn].ToString(); Session["go"] = GetGoByApp(dt.Rows[0][GroupsColumns.VgappColumn].ToString()); #region Phục vụ xử lý trong trang giới thiệu if (StringExtension.LayChuoi(dt.Rows[0][GroupsColumns.VgparamsColumn].ToString(), "", 4) == "1") { Session["MultipPageContent"] = "1"; //Trang giới thiệu đa cấp } else { Session["MultipPageContent"] = null; } #endregion } #endregion } //Trường hợp vào trang chủ modul if (Session["dataByTitle"] == null) { Session["go"] = GetAppByGo(Request.QueryString["go"]); } }
string GetList(string igid, string top) { string s = ""; #region Condition, orderby, fields string condition = ""; if (igid != "") { condition = GroupsItemsTSql.GetItemsInGroupCondition(igid, ""); } else { condition = GroupsTSql.GetGroupsByVgapp(app); } condition = DataExtension.AndConditon( condition, GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1"), ItemsTSql.GetItemsByViapp(app)); if (key.Length > 0) { condition = DataExtension.AndConditon(condition, SearchTSql.GetSearchMathedCondition(key, ItemsColumns.VititleColumn, ItemsColumns.VikeyColumn, ItemsColumns.FipriceColumn, ItemsColumns.FisalepriceColumn)); } string orderby = ItemsColumns.IiorderColumn + "," + ItemsColumns.DicreatedateColumn + " desc "; string fields = DataExtension.GetListColumns(ItemsColumns.VititleColumn, ItemsColumns.ViimageColumn, ItemsColumns.VISEOLINKSEARCHColumn, ItemsColumns.VidescColumn, ItemsColumns.DiCreateDate, ItemsColumns.IiTotalView); #endregion DataTable dt = GroupsItems.GetAllData(top, fields, condition, orderby); #region Lấy ra danh sách bài viết if (dt.Rows.Count > 0) { string link = (UrlExtension.WebisteUrl + dt.Rows[0][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions) .ToLower(); s += @" <div class='list-service__item fade-up'> <div class='img'> <a href='#' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='img__crop'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> </div> <h3 class='list-service__ttl'><a href='#' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a></h3> <p class='txtBase txt-center'> " + dt.Rows[i][ItemsColumns.ViDesc] + @" </p> </div>"; } } #endregion return(s); }
protected string LoadChildMenu(string igParentId, string vgdesc, string rewrite, string layMenuConTheoDanhMuc) { string top = ""; string field = "*"; string orderby = GroupsColumns.IgorderColumn; string condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByIgenable("1"), GroupsTSql.GetGroupsByVglang(lang)); #region Xét điều kiện lấy các danh mục con nếu menu trỏ đến trang chủ của các modul if (layMenuConTheoDanhMuc == "1") { if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.News) { rewrite = RewriteExtension.News; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.NewsModul.CodeApplications.News), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.Product) { rewrite = RewriteExtension.Product; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.ProductModul.CodeApplications.Product), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } //else // if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.Service) //{ // rewrite = RewriteExtension.Service; // condition = DataExtension.AndConditon(condition, // GroupsTSql.GetGroupsByVgapp(TatThanhJsc.ServiceModul.CodeApplications.Service), // GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); //} else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.Video) { rewrite = RewriteExtension.Video; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.VideoModul.CodeApplications.Video), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.PhotoAlbum) { rewrite = RewriteExtension.PhotoAlbum; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.PhotoAlbumModul.CodeApplications.PhotoAlbum), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.FileLibrary) { rewrite = RewriteExtension.FileLibrary; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.FileLibraryModul.CodeApplications.FileLibrary), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.QA) { rewrite = RewriteExtension.QA; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.QAModul.CodeApplications.QA), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.Customer) { rewrite = RewriteExtension.Customer; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.CustomerModul.CodeApplications.Customer), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.Hotel) { rewrite = RewriteExtension.Hotel; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.HotelModul.CodeApplications.Hotel), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } else if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.Tour) { rewrite = RewriteExtension.Tour; condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByVgapp(TatThanhJsc.TourModul.CodeApplications.Tour), GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); } //else //if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.AboutUs) // { // rewrite = RewriteExtension.AboutUs; // condition = DataExtension.AndConditon(condition, // GroupsTSql.GetGroupsByVgapp(TatThanhJsc.AboutUsModul.CodeApplications.AboutUs), // GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); // } //else //if (MenuExtension.GetQueryString(vgdesc, "go") == RewriteExtension.CustomerReviews) // { // rewrite = RewriteExtension.CustomerReviews; // condition = DataExtension.AndConditon(condition, // GroupsTSql.GetGroupsByVgapp(TatThanhJsc.CustomerReviewsModul.CodeApplications.CustomerReviews), // GroupsTSql.GetGroupsByIgparentid(MenuExtension.GetIgidInVgdesc(vgdesc))); // } else { condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByIgparentid(igParentId)); } } else { condition = DataExtension.AndConditon(condition, GroupsTSql.GetGroupsByIgparentid(igParentId)); } #endregion DataTable dt = Groups.GetGroups(top, field, condition, orderby); string s = ""; if (dt.Rows.Count > 0) { string link = ""; s += @" <i class='fa fa-angle-down' aria-hidden='true'></i> <div class='sub-menu-1'> <ul class='sublist'>"; for (int i = 0; i < dt.Rows.Count; i++) { if (rewrite.Length < 1) { link = RewriteExtension.GetLinkMenu(dt.Rows[i][GroupsColumns.VgdescColumn].ToString()); } else { link = (UrlExtension.WebisteUrl + dt.Rows[i][GroupsColumns.VGSEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); } s += @" <li class='sub-item'> <a class='subitem-link' href='" + link + "' " + MenuExtension.GetTarget(dt.Rows[i][GroupsColumns.VgparamsColumn].ToString()) + @" title='" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"'> <i class='fa fa-angle-right' aria-hidden='true'></i> <span>" + dt.Rows[i][GroupsColumns.VgnameColumn] + @"</span> </a> </li>"; } s += "</ul></div>"; } return(s); }
string GetList() { string s = ""; string condition = DataExtension.AndConditon( GroupsTSql.GetGroupsByVgapp(TatThanhJsc.TourModul.CodeApplications.Tour), GroupsTSql.GetGroupsByVglang(lang), GroupsTSql.GetGroupsByIgenable("1"), ItemsTSql.GetItemsByIienable("1")); if (diemden.Length > 0) { condition += " AND VIAUTHOR = '" + diemden + "' "; ltrDiemDen.Text = LanguageItemExtension.GetnLanguageItemTitleByName("tới địa điểm ") + "<strong>" + LayDiemDen(diemden) + "</strong>"; } if (thoigian.Length > 0) { condition += " AND VIURL = '" + thoigian + "' "; ltrThoiGian.Text = LanguageItemExtension.GetnLanguageItemTitleByName("với thời lượng ") + "<strong>" + LayThoiGianTour(thoigian) + "</strong>"; } string orderby = ItemsColumns.DicreatedateColumn + " desc "; DataSet ds = GroupsItems.GetAllDataPagging(p, rows.ToString(), condition, orderby); ltrTotalResult.Text = NumberExtension.FormatNumber(ds.Tables[1].Rows[0]["TotalRows"].ToString()); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; DataTable dtPager = ds.Tables[1]; if (dtPager.Rows.Count > 0 && dt.Rows.Count > 0) { string split = PagingExtension.SpilitPages(int.Parse(dtPager.Rows[0]["TotalRows"].ToString()), rows, int.Parse(p), "?go=search&diemden=" + diemden + "&thoigian=" + thoigian, "hientai", "trangkhac", "dau", "cuoi", "truoc", "sau"); if (split.Length > 0) { int totalPage = 0; try { double totalrow = double.Parse(dtPager.Rows[0]["TotalRows"].ToString()); totalPage = (int)(totalrow / rows); if (totalPage < (totalrow / rows)) { totalPage++; } } catch { } ltrPagging.Text = split; } else { if (dt.Rows.Count < 1) { ltrPagging.Text = ""; } else { ltrPagging.Text = ""; } } } else { ltrPagging.Text = ""; } if (dt.Rows.Count > 0) { string link = ""; string price = "", salePrice = ""; string time = ""; for (int i = 0; i < dt.Rows.Count; i++) { link = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower(); price = dt.Rows[i][ItemsColumns.FipriceColumn].ToString() == "0" ? "" : NumberExtension.FormatNumber(dt.Rows[i][ItemsColumns.FipriceColumn].ToString()) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); salePrice = dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString() == "0" ? LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ") : NumberExtension.FormatNumber(dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString()) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ"); time = LayThoiGianTour(dt.Rows[i][ItemsColumns.ViurlColumn].ToString()); s += @" <div class='col'> <div class='item item-post'> <div class='item-img'> <a href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='imgc'> " + ImagesExtension.GetImage(TatThanhJsc.TourModul.FolderPic.Tour, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), dt.Rows[i][ItemsColumns.VititleColumn].ToString(), "", true, false, "") + @" </a> <div class='item-date'> <div> <i class='fa fa-calendar' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Time") + @": " + time + @"</span> </div> <div> <i class='fa fa-plane' aria-hidden='true'></i><span>" + LanguageItemExtension.GetnLanguageItemTitleByName("Departure") + @": " + dt.Rows[i][ItemsColumns.VISEOMETAPARAMSColumn] + @"</span> </div> </div> </div> <div class='item-body'> <h3> <a href='" + link + @"' class='title item-title' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a> </h3> <div class='item-price'> <span class='real'>" + salePrice + @"</span> <span class='throught'>" + price + @"</span> </div> <a href='" + link + @"' class='link item-link' title='" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("More") + @" <i class='fa fa-angle-right' aria-hidden='true'></i> </a> </div> </div> </div>"; } } } return(s); }