void InitialControlsValue(bool insert) { #region update if (!insert) { LtInsertUpdate.Text = Developer.ContactKeyword.CapNhatNhomBaiVietMoi; btn_insert_update.Text = "Đồng ý"; ckbContinue.Visible = false; fields = "*"; condition = GroupsTSql.GetGroupsByIgid(igid); DataTable dt = new DataTable(); dt = Groups.GetGroups(top, fields, condition, orderBy); txt_title_modul.Text = dt.Rows[0]["VGNAME"].ToString(); ltimg.Text = ImagesExtension.GetImage(pic, dt.Rows[0]["VGIMAGE"].ToString(), "", "adm_img_product", false, false, "", false); if (ltimg.Text.Length > 0) { btnXoaAnhHienTai.Visible = true; hd_img.Value = dt.Rows[0]["VGIMAGE"].ToString(); } txt_ordermodul.Text = dt.Rows[0]["IGORDER"].ToString(); txtDesc.Text = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgdescColumn].ToString(); #region SEO textLinkRewrite.Text = dt.Rows[0]["VGSEOLINK"].ToString(); textTagTitle.Text = dt.Rows[0]["VGSEOTITLE"].ToString(); textTagKeyword.Text = dt.Rows[0]["VGSEOMETAKEY"].ToString(); textTagDescription.Text = dt.Rows[0]["VGSEOMETADESC"].ToString(); #endregion if (dt.Rows[0]["IGENABLE"].ToString().Equals("0")) { chk_status.Checked = false; } else { chk_status.Checked = true; } #region Địa chỉ, điện thoại, fax, email, gmap string content = dt.Rows[0][TatThanhJsc.Columns.GroupsColumns.VgcontentColumn].ToString(); tbDiaChi.Text = StringExtension.LayChuoi(content, "", 1); tbDienThoai.Text = StringExtension.LayChuoi(content, "", 2); tbFax.Text = StringExtension.LayChuoi(content, "", 3); tbEmail.Text = StringExtension.LayChuoi(content, "", 4); tbKinhDo.Text = StringExtension.LayChuoi(content, "", 5); tbViDo.Text = StringExtension.LayChuoi(content, "", 6); tbWebsite.Text = StringExtension.LayChuoi(content, "", 7); lat = tbViDo.Text; lng = tbKinhDo.Text; infoWindow = tbDiaChi.Text; #endregion } #endregion #region insert else { LtInsertUpdate.Text = Developer.ContactKeyword.TaoNhomBaiVietMoi; btn_insert_update.Text = "Đồng ý"; } #endregion }
protected void btSave_Click(object sender, EventArgs e) { #region Cấu hình số lượng SettingsExtension.SetOtherSettingKey(SettingKey.SoHotelTrenTrangChu, tbSoHotelTrenTrangChu.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.SoHotelKhacTrenMotTrang, tbSoHotelKhacTrenMotTrang.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.SoHotelTrenTrangDanhMuc, tbSoHotelTrenTrangDanhMuc.Text, lang); #endregion SettingsExtension.SetOtherSettingKey("KeyThongBaoDatPhongThanhCong", tbThongBaoDatPhongThanhCong.Text, lang); SettingsExtension.SetOtherSettingKey("KeyNoiDungCuoiTrangDanhSachHotel", tbNoiDungCuoiTrangDanhSach.Text, lang); #region Cấu hình đóng dấu ảnh #region Đóng dấu ảnh if (cbDongDauAnh.Checked) { SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel, "1", lang); } else { SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel, "0", lang); } #region Ảnh làm dấu if (fulDongDauAnh.PostedFile.ContentLength > 0) { //Xoá ảnh cũ if (hdWatermarkLogo.Value.Length > 0) { ImagesExtension.DeleteImageWhenDeleteItem(pic, hdWatermarkLogo.Value); } //Lưu ảnh mới string fileName = ""; if (ImagesExtension.ValidType(fulDongDauAnh.FileName)) { string fileEx = fulDongDauAnh.FileName.Substring(fulDongDauAnh.FileName.LastIndexOf(".")); fileName = "WatermarkLogo" + fileEx; fulDongDauAnh.SaveAs(Request.PhysicalApplicationPath + "/" + pic + "/" + fileName); ltrWatermarkLogo.Text = ImagesExtension.GetImage(pic, fileName, "", "", false, false, ""); } SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel_AnhDau, fileName, lang); } #endregion SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel_ViTri, rbViTriDongDau.SelectedValue, lang); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel_LeNgang, tbLeX.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel_LeDoc, tbLeY.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel_TyLe, tbPhanTram.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhHotel_TrongSuot, tbTrongSuot.Text, lang); #endregion #region Hạn chế kích thước ảnh đại diện if (cbHanCheKichThuoc.Checked) { SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhHotel, "1", lang); } else { SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhHotel, "0", lang); } SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhHotel_MaxWidth, tbHanCheW.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhHotel_MaxHeight, tbHanCheH.Text, lang); #endregion #region Tạo ảnh nhỏ cho ảnh đại diện if (cbTaoAnhNho.Checked) { SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhHotel, "1", lang); } else { SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhHotel, "0", lang); } SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhHotel_MaxWidth, tbAnhNhoW.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhHotel_MaxHeight, tbAnhNhoH.Text, lang); #endregion #endregion #region Cấu hình tối ưu seo SettingsExtension.SetOtherSettingKey(SettingKey.TitleHotel, tbTitle.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.DescriptionHotel, tbDescription.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.SeoTitleHotel, tbSeoTitle.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.SeoUrlHotel, tbSeoUrl.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.SeoKeywordHotel, tbSeoKeyword.Text, lang); SettingsExtension.SetOtherSettingKey(SettingKey.SeoDescriptionHotel, tbSeoDescription.Text, lang); #region Hình ảnh khi share if (flShareImage.PostedFile.ContentLength > 0) { //Xoá ảnh cũ if (hdShareImage.Value.Length > 0) { ImagesExtension.DeleteImageWhenDeleteItem(pic, hdShareImage.Value); } //Lưu ảnh mới string fileName = ""; if (ImagesExtension.ValidType(flShareImage.FileName)) { string filename = flShareImage.FileName; string fileEx = flShareImage.FileName.Substring(flShareImage.FileName.LastIndexOf(".")); string fileNotEx = StringExtension.ReplateTitle(filename.Remove(filename.LastIndexOf(".") - 1)); if (fileNotEx.Length > 9) { fileNotEx = fileNotEx.Remove(9); } string ticks = DateTime.Now.Ticks.ToString(); fileName = fileNotEx + "_" + ticks + fileEx; flShareImage.SaveAs(Request.PhysicalApplicationPath + "/" + pic + "/" + fileName); ltrShareImage.Text = ImagesExtension.GetImage(pic, fileName, "", "", false, false, ""); } SettingsExtension.SetOtherSettingKey(SettingKey.SeoImageHotel, fileName, lang); } #endregion #endregion ScriptManager.RegisterStartupScript(this, this.GetType(), "alertSuccess", "ThongBao(3000,'Cập nhật thành công !');", true); }
void GetOtherSetting() { tbSoServiceTrenTrangChu.Text = SettingsExtension.GetSettingKey(SettingKey.SoServiceTrenTrangChu, lang); tbSoServiceKhacTrenMotTrang.Text = SettingsExtension.GetSettingKey(SettingKey.SoServiceKhacTrenMotTrang, lang); tbSoServiceTrenTrangDanhMuc.Text = SettingsExtension.GetSettingKey(SettingKey.SoServiceTrenTrangDanhMuc, lang); tbBaiVietTrangLichHoc.Text = SettingsExtension.GetSettingKey("BaiVietTrangLichHoc", lang); #region Đóng dấu ảnh if (SettingsExtension.GetSettingKey(SettingKey.DongDauAnhService, lang) == "1") { cbDongDauAnh.Checked = true; } else { cbDongDauAnh.Checked = false; } #region Ảnh làm dấu hdLogoImage.Value = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhService_AnhDau, lang); if (hdLogoImage.Value.Length > 0) { ltrLogoImage.Text = TatThanhJsc.Extension.ImagesExtension.GetImage(pic, hdLogoImage.Value, "", "", false, false, ""); } #endregion rbViTriDongDau.SelectedValue = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhService_ViTri, lang); tbLeX.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhService_LeNgang, lang); tbLeY.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhService_LeDoc, lang); tbPhanTram.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhService_TyLe, lang); tbTrongSuot.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhService_TrongSuot, lang); #endregion #region Hạn chế kích thước ảnh đại diện if (SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhService, lang) == "1") { cbHanCheKichThuoc.Checked = true; } else { cbHanCheKichThuoc.Checked = false; } tbHanCheW.Text = SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhService_MaxWidth, lang); tbHanCheH.Text = SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhService_MaxHeight, lang); #endregion #region Tạo ảnh nhỏ cho ảnh đại diện if (SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhService, lang) == "1") { cbTaoAnhNho.Checked = true; } else { cbTaoAnhNho.Checked = false; } tbAnhNhoW.Text = SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhService_MaxWidth, lang); tbAnhNhoH.Text = SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhService_MaxHeight, lang); #endregion LoadConfigs("cms/admin/Moduls/Service/Index.ascx"); #region Cấu hình tối ưu seo tbTitle.Text = SettingsExtension.GetSettingKey(SettingKey.TitleService, lang); tbDescription.Text = SettingsExtension.GetSettingKey(SettingKey.DescriptionService, lang); tbSeoTitle.Text = SettingsExtension.GetSettingKey(SettingKey.SeoTitleService, lang); tbSeoUrl.Text = SettingsExtension.GetSettingKey(SettingKey.SeoUrlService, lang); tbSeoKeyword.Text = SettingsExtension.GetSettingKey(SettingKey.SeoKeywordService, lang); tbSeoDescription.Text = SettingsExtension.GetSettingKey(SettingKey.SeoDescriptionService, lang); hdShareImage.Value = SettingsExtension.GetSettingKey(SettingKey.SeoImageService, lang); if (hdShareImage.Value.Length > 0) { ltrShareImage.Text = ImagesExtension.GetImage(pic, hdShareImage.Value, "", "", false, false, ""); btnXoaAnhHienTai.Visible = true; } #endregion }
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 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); }
void InitialControlsValue(bool insert) { #region update if (!insert) { //btn_insert_update.Text = "Đồng ý"; ckbContinue.Visible = false; fields = "*"; condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByVgapp(app), ItemsTSql.GetItemsByIid(iid)); DataTable dt = new DataTable(); dt = GroupsItems.GetAllData(top, fields, condition, orderBy); lnk_delete_Image_current.Visible = true; ddl_group_TrainTicket.SelectedValue = dt.Rows[0]["IGID"].ToString(); txt_title.Text = dt.Rows[0]["VITITLE"].ToString(); txt_description.Text = dt.Rows[0]["VIDESC"].ToString(); txt_content.Text = dt.Rows[0]["VICONTENT"].ToString(); hdOldTrainTicket.Value = dt.Rows[0]["VICONTENT"].ToString(); #region SEO textLinkRewrite.Text = dt.Rows[0]["VISEOLINK"].ToString(); textTagTitle.Text = dt.Rows[0]["VISEOTITLE"].ToString(); textTagKeyword.Text = dt.Rows[0]["VISEOMETAKEY"].ToString(); textTagDescription.Text = dt.Rows[0]["VISEOMETADESC"].ToString(); #endregion txtCreateDate.Text = dt.Rows[0]["DCREATEDATE"].ToString(); #region Image if (!dt.Rows[0]["VIIMAGE"].ToString().Equals("")) { ltimg.Text = ImagesExtension.GetImage(pic, dt.Rows[0]["VIIMAGE"].ToString(), "", "imgItem", false, false, "", false); lnk_delete_Image_current.Visible = true; } else { ltimg.Visible = false; lnk_delete_Image_current.Visible = false; } hd_img.Value = dt.Rows[0]["VIIMAGE"].ToString(); if (hd_img.Value.Length < 1) { cbLayAnhTuNoiDung.Checked = true; } else { cbLayAnhTuNoiDung.Checked = false; } #endregion HdIitotalview.Value = dt.Rows[0]["IITOTALVIEW"].ToString(); #region IIENABLE if (dt.Rows[0]["IIENABLE"].ToString().Equals("0")) { chk_status.Checked = false; } else { chk_status.Checked = true; } #endregion tbPrice.Text = dt.Rows[0][ItemsColumns.FipriceColumn].ToString(); tbPriceOld.Text = dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString(); tbKey.Text = dt.Rows[0][ItemsColumns.VikeyColumn].ToString(); tbOrder.Text = dt.Rows[0][ItemsColumns.IiorderColumn].ToString(); GetFilterProperties(); #region ThuocTinhTrainTicket-Chi thực hiện khi chức năng Quản lý thuộc tính được hiển thị if (TrainTicketConfig.KeyHienThiQuanLyThuocTinhTrainTicket) { string properties = ""; condition = DataExtension.AndConditon( SubitemsTSql.GetSubitemsByIid(iid), SubitemsTSql.GetSubitemsByVskey(propertyModul)); fields = SubitemsColumns.VscontentColumn; dt = Subitems.GetSubItems("", fields, condition, ""); if (dt.Rows.Count > 0) { properties = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(); } for (int i = 0; i < rptProperties.Items.Count; i++) { CheckBox checkBoxProperties = (CheckBox)rptProperties.Items[i].FindControl("checkBoxProperties"); if (properties.IndexOf(parramSpitString + checkBoxProperties.ToolTip + parramSpitString) > -1) { checkBoxProperties.Checked = true; } else { checkBoxProperties.Checked = false; } } } #endregion #region Nicks- Chỉ hiển thị khi chức năng add nick được hiển thị if (TrainTicketConfig.KeyHienThiAddNickChoTrainTicket) { string nicks = ""; condition = DataExtension.AndConditon( SubitemsTSql.GetSubitemsByIid(iid), SubitemsTSql.GetSubitemsByVskey(TatThanhJsc.OtherModul.CodeApplications.SupportOnline)); fields = SubitemsColumns.VscontentColumn; dt = Subitems.GetSubItems("", fields, condition, ""); if (dt.Rows.Count > 0) { nicks = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(); } for (int i = 0; i < rptNicks.Items.Count; i++) { CheckBox checkBoxNicks = (CheckBox)rptNicks.Items[i].FindControl("checkBoxNicks"); if (nicks.IndexOf(parramSpitString + checkBoxNicks.ToolTip + parramSpitString) > -1) { checkBoxNicks.Checked = true; } else { checkBoxNicks.Checked = false; } } } #endregion #region ThuocTinhLoc- Chỉ hiển thị khi chức năng quản lý thuộc tính lọc được hiển thị string filterProperties = ""; condition = DataExtension.AndConditon( SubitemsTSql.GetSubitemsByIid(iid), SubitemsTSql.GetSubitemsByVskey(CodeApplications.TrainTicketFilterProperties)); fields = SubitemsColumns.VscontentColumn; dt = Subitems.GetSubItems("", fields, condition, ""); if (dt.Rows.Count > 0) { filterProperties = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(); } for (int i = 0; i < rptParentFilter.Items.Count; i++) { //Đánh dấu radiobuttonlist RadioButtonList rdblListAnswer = (RadioButtonList)rptParentFilter.Items[i].FindControl("rdblAnswer"); if (rdblListAnswer != null) { for (int j = 0; j < rdblListAnswer.Items.Count; j++) { if (filterProperties.IndexOf(parramSpitString + rdblListAnswer.Items[j].Value + parramSpitString) > -1) { rdblListAnswer.Items[j].Selected = true; } else { rdblListAnswer.Items[j].Selected = false; } } } //Đánh dấu checkboxlist CheckBoxList cblListAnswer = (CheckBoxList)rptParentFilter.Items[i].FindControl("cblAnswer"); if (cblListAnswer != null) { for (int j = 0; j < cblListAnswer.Items.Count; j++) { if (filterProperties.IndexOf(parramSpitString + cblListAnswer.Items[j].Value + parramSpitString) > -1) { cblListAnswer.Items[j].Selected = true; } else { cblListAnswer.Items[j].Selected = false; } } } } #endregion } #endregion #region insert else { //btn_insert_update.Text = "Đồng ý"; txtCreateDate.Text = DateTime.Now.ToString(); GetFilterProperties(); } #endregion }
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); }
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 GetOtherSetting() { tbSoDealTrenTrangChu.Text = SettingsExtension.GetSettingKey(SettingKey.SoDealTrenTrangChu, language); tbSoDealKhacTrenMotTrang.Text = SettingsExtension.GetSettingKey(SettingKey.SoDealKhacTrenMotTrang, language); tbSoDealTrenTrangDanhMuc.Text = SettingsExtension.GetSettingKey(SettingKey.SoDealTrenTrangDanhMuc, language); tbDauDonHangDeal.Text = SettingsExtension.GetSettingKey(SettingKey.NoiDungDauDonHangDeal, language); tbCuoiDonHangDeal.Text = SettingsExtension.GetSettingKey(SettingKey.NoiDungCuoiDonHangDeal, language); txtThongBaoCart.Text = SettingsExtension.GetSettingKey(SettingKey.KeyThongBaoSauDatHangDeal, language); #region Đóng dấu ảnh if (SettingsExtension.GetSettingKey(SettingKey.DongDauAnhDeal, language) == "1") { cbDongDauAnh.Checked = true; } else { cbDongDauAnh.Checked = false; } #region Ảnh làm dấu hdLogoImage.Value = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhDeal_AnhDau, language); if (hdLogoImage.Value.Length > 0) { ltrLogoImage.Text = ImagesExtension.GetImage(pic, hdLogoImage.Value, "", "", false, false, ""); } #endregion rbViTriDongDau.SelectedValue = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhDeal_ViTri, language); tbLeX.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhDeal_LeNgang, language); tbLeY.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhDeal_LeDoc, language); tbPhanTram.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhDeal_TyLe, language); tbTrongSuot.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhDeal_TrongSuot, language); #endregion #region Hạn chế kích thước ảnh đại diện if (SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhDeal, language) == "1") { cbHanCheKichThuoc.Checked = true; } else { cbHanCheKichThuoc.Checked = false; } tbHanCheW.Text = SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhDeal_MaxWidth, language); tbHanCheH.Text = SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhDeal_MaxHeight, language); #endregion #region Tạo ảnh nhỏ cho ảnh đại diện if (SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhDeal, language) == "1") { cbTaoAnhNho.Checked = true; } else { cbTaoAnhNho.Checked = false; } tbAnhNhoW.Text = SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhDeal_MaxWidth, language); tbAnhNhoH.Text = SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhDeal_MaxHeight, language); #endregion LoadConfigs("cms/admin/Moduls/Deal/Index.ascx"); }
/// <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); }
protected void btSave_Click(object sender, EventArgs e) { SettingsExtension.SetOtherSettingKey(SettingKey.SoDealTrenTrangChu, tbSoDealTrenTrangChu.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.SoDealKhacTrenMotTrang, tbSoDealKhacTrenMotTrang.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.SoDealTrenTrangDanhMuc, tbSoDealTrenTrangDanhMuc.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.NoiDungDauDonHangDeal, tbDauDonHangDeal.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.NoiDungCuoiDonHangDeal, tbCuoiDonHangDeal.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.KeyThongBaoSauDatHangDeal, txtThongBaoCart.Text, language); #region Đóng dấu ảnh if (cbDongDauAnh.Checked) { SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal, "1", language); } else { SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal, "0", language); } #region Ảnh làm dấu if (fulDongDauAnh.PostedFile.ContentLength > 0) { //Xoá ảnh cũ if (hdLogoImage.Value.Length > 0) { ImagesExtension.DeleteImageWhenDeleteItem(pic, hdLogoImage.Value); } //Lưu ảnh mới string fileName = ""; if (ImagesExtension.ValidType(fulDongDauAnh.FileName)) { string fileEx = fulDongDauAnh.FileName.Substring(fulDongDauAnh.FileName.LastIndexOf(".")); fileName = "WatermarkLogo" + fileEx; fulDongDauAnh.SaveAs(Request.PhysicalApplicationPath + "/" + pic + "/" + fileName); ltrLogoImage.Text = ImagesExtension.GetImage(pic, fileName, "", "", false, false, ""); } SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal_AnhDau, fileName, language); } #endregion SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal_ViTri, rbViTriDongDau.SelectedValue, language); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal_LeNgang, tbLeX.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal_LeDoc, tbLeY.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal_TyLe, tbPhanTram.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.DongDauAnhDeal_TrongSuot, tbTrongSuot.Text, language); #endregion #region Hạn chế kích thước ảnh đại diện if (cbHanCheKichThuoc.Checked) { SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhDeal, "1", language); } else { SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhDeal, "0", language); } SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhDeal_MaxWidth, tbHanCheW.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.HanCheKichThuocAnhDeal_MaxHeight, tbHanCheH.Text, language); #endregion #region Tạo ảnh nhỏ cho ảnh đại diện if (cbTaoAnhNho.Checked) { SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhDeal, "1", language); } else { SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhDeal, "0", language); } SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhDeal_MaxWidth, tbAnhNhoW.Text, language); SettingsExtension.SetOtherSettingKey(SettingKey.TaoAnhNhoChoAnhDeal_MaxHeight, tbAnhNhoH.Text, language); #endregion SaveConfigs(); ScriptManager.RegisterStartupScript(this, this.GetType(), "alertSuccess", "ThongBao(3000,'Cập nhật thành công !');", true); }
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("", 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-drink__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> <h2 class='list-drink__ttl'><a href='#' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"'><span>" + (i + 1).ToString("D2") + @"</span>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a></h2> <p class='txtBase'> " + dt.Rows[i][ItemsColumns.ViDesc] + @"</p> </div>"; } } #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 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>"; } } } }
void GetOtherSetting() { #region Cấu hình số lượng tbSoHotelTrenTrangChu.Text = SettingsExtension.GetSettingKey(SettingKey.SoHotelTrenTrangChu, lang); tbSoHotelKhacTrenMotTrang.Text = SettingsExtension.GetSettingKey(SettingKey.SoHotelKhacTrenMotTrang, lang); tbSoHotelTrenTrangDanhMuc.Text = SettingsExtension.GetSettingKey(SettingKey.SoHotelTrenTrangDanhMuc, lang); #endregion tbThongBaoDatPhongThanhCong.Text = SettingsExtension.GetSettingKey("KeyThongBaoDatPhongThanhCong", lang); tbNoiDungCuoiTrangDanhSach.Text = SettingsExtension.GetSettingKey("KeyNoiDungCuoiTrangDanhSachHotel", lang); #region Cấu hình đóng dấu ảnh #region Đóng dấu ảnh if (SettingsExtension.GetSettingKey(SettingKey.DongDauAnhHotel, lang) == "1") { cbDongDauAnh.Checked = true; } else { cbDongDauAnh.Checked = false; } #region Ảnh làm dấu hdWatermarkLogo.Value = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhHotel_AnhDau, lang); if (hdWatermarkLogo.Value.Length > 0) { ltrWatermarkLogo.Text = ImagesExtension.GetImage(pic, hdWatermarkLogo.Value, "", "", false, false, ""); } #endregion rbViTriDongDau.SelectedValue = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhHotel_ViTri, lang); tbLeX.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhHotel_LeNgang, lang); tbLeY.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhHotel_LeDoc, lang); tbPhanTram.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhHotel_TyLe, lang); tbTrongSuot.Text = SettingsExtension.GetSettingKey(SettingKey.DongDauAnhHotel_TrongSuot, lang); #endregion #region Hạn chế kích thước ảnh đại diện if (SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhHotel, lang) == "1") { cbHanCheKichThuoc.Checked = true; } else { cbHanCheKichThuoc.Checked = false; } tbHanCheW.Text = SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhHotel_MaxWidth, lang); tbHanCheH.Text = SettingsExtension.GetSettingKey(SettingKey.HanCheKichThuocAnhHotel_MaxHeight, lang); #endregion #region Tạo ảnh nhỏ cho ảnh đại diện if (SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhHotel, lang) == "1") { cbTaoAnhNho.Checked = true; } else { cbTaoAnhNho.Checked = false; } tbAnhNhoW.Text = SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhHotel_MaxWidth, lang); tbAnhNhoH.Text = SettingsExtension.GetSettingKey(SettingKey.TaoAnhNhoChoAnhHotel_MaxHeight, lang); #endregion #endregion #region Cấu hình tối ưu seo tbTitle.Text = SettingsExtension.GetSettingKey(SettingKey.TitleHotel, lang); tbDescription.Text = SettingsExtension.GetSettingKey(SettingKey.DescriptionHotel, lang); tbSeoTitle.Text = SettingsExtension.GetSettingKey(SettingKey.SeoTitleHotel, lang); tbSeoUrl.Text = SettingsExtension.GetSettingKey(SettingKey.SeoUrlHotel, lang); tbSeoKeyword.Text = SettingsExtension.GetSettingKey(SettingKey.SeoKeywordHotel, lang); tbSeoDescription.Text = SettingsExtension.GetSettingKey(SettingKey.SeoDescriptionHotel, lang); hdShareImage.Value = SettingsExtension.GetSettingKey(SettingKey.SeoImageHotel, lang); if (hdShareImage.Value.Length > 0) { ltrShareImage.Text = ImagesExtension.GetImage(pic, hdShareImage.Value, "", "", false, false, ""); btnXoaAnhHienTai.Visible = true; } #endregion }
void InitialControlsValue(bool insert) { #region update if (!insert) { btOK.Text = "Đồng ý"; cbTiepTuc.Visible = false; DataTable dt = new DataTable(); dt = Members.GetMembersCondition("1", "*", MembersTSql.GetMembersByImid(imid), ""); tbTenDangNhap.Text = dt.Rows[0][MembersColumns.vMemberAccount].ToString(); tbTenDangNhap.Enabled = false; hdTenDangNhap.Value = SecurityExtension.Encode(dt.Rows[0][MembersColumns.vMemberAccount].ToString()); ltrGhiChuMatKhau.Text = "<div class='GhiChuMatKhau'>Để trống ô mật khẩu nếu không muốn thay đổi</div>"; tbMatKhau.Text = dt.Rows[0][MembersColumns.vMemberPassword].ToString(); tbNhapLaiMatKhau.Text = dt.Rows[0][MembersColumns.vMemberPassword].ToString(); RequiredFieldValidator2.Visible = false; RequiredFieldValidator3.Visible = false; tbEmail.Text = dt.Rows[0][MembersColumns.vMemberEmail].ToString(); tbHoTen.Text = dt.Rows[0][MembersColumns.vMemberName].ToString(); tbNgaySinh.Text = ((DateTime)dt.Rows[0][MembersColumns.dMemberBirthday]).ToString("MM/dd/yyyy"); ddlGioiTinh.SelectedValue = tbTenDangNhap.Text = dt.Rows[0][MembersColumns.vMemberIdentityCard].ToString(); tbDiaChi.Text = dt.Rows[0][MembersColumns.vMemberAddress].ToString(); tbDienThoai.Text = dt.Rows[0][MembersColumns.vMemberPhone].ToString(); tbTrinhDoHocVan.Text = dt.Rows[0][MembersColumns.vMemberEdu].ToString(); tbNgheNghiep.Text = dt.Rows[0][MembersColumns.vMemberJob].ToString(); tbQuanHeXaHoi.Text = dt.Rows[0][MembersColumns.vMemberRelationship].ToString(); tbTenDangNhap.Text = dt.Rows[0][MembersColumns.vMemberAccount].ToString(); tbChieuCao.Text = dt.Rows[0][MembersColumns.VmemberheightColumn].ToString(); tbCanNang.Text = dt.Rows[0][MembersColumns.VmemberweightColumn].ToString(); tbCauGioiThieuNgan.Text = dt.Rows[0][MembersColumns.VmemberblastColumn].ToString(); ddlKichHoat.SelectedValue = dt.Rows[0][MembersColumns.iMemberIsApproved].ToString(); ddlTrangThai.SelectedValue = dt.Rows[0][MembersColumns.iMemberIsLockedOut].ToString(); #region Image if (!dt.Rows[0][MembersColumns.vMemberImage].ToString().Equals("")) { ltimg.Text = ImagesExtension.GetImage(pic, dt.Rows[0][MembersColumns.vMemberImage].ToString(), "", "imgItem", false, false, "", false); lnk_delete_Image_current.Visible = true; } else { ltimg.Visible = false; lnk_delete_Image_current.Visible = false; } hd_img.Value = dt.Rows[0][MembersColumns.vMemberImage].ToString(); #endregion #region Các trường không xuất hiện trên form hdvProperty.Value = dt.Rows[0][MembersColumns.VpropertyColumn].ToString(); hdvMemberYahooNick.Value = dt.Rows[0][MembersColumns.vMemberYahooNick].ToString(); hdvMemberPasswordQuestion.Value = dt.Rows[0][MembersColumns.vMemberPasswordQuestion].ToString(); hdvMemberPasswordAnswer.Value = dt.Rows[0][MembersColumns.vMemberPasswordAnswer].ToString(); hdvMemberComment.Value = dt.Rows[0][MembersColumns.vMemberComment].ToString(); hdiMemberTotalLogin.Value = dt.Rows[0][MembersColumns.ImemberTotalLoginColumn].ToString(); hdiMemberTotalview.Value = dt.Rows[0][MembersColumns.ImembertotalviewColumn].ToString(); #endregion } #endregion #region insert else { tbTenDangNhap.Focus(); } #endregion }
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 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); }
void InitialControlsValue(bool insert) { #region update if (!insert) { //btn_insert_update.Text = "Đồng ý"; ckbContinue.Visible = false; fields = "*"; condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByVgapp(app), ItemsTSql.GetItemsByIid(iid)); DataTable dt = new DataTable(); dt = GroupsItems.GetAllData("", fields, condition, "");//Sắp xếp theo igiid để bản ghi đầu tiên là danh mục chính --> mặc định thử tục mới lấy ra 1 bản ghi của danh mục chính hdigi_id.Value = dt.Rows[0][GroupsItemsColumns.IgiidColumn].ToString(); CheckOtherIgid(dt.Rows[0][ItemsColumns.IidColumn].ToString()); lnk_delete_Image_current.Visible = true; ddl_group_product.SelectedValue = dt.Rows[0]["IGID"].ToString(); txt_title.Text = dt.Rows[0]["VITITLE"].ToString(); txt_description.Text = dt.Rows[0]["VIDESC"].ToString(); txt_content.Text = dt.Rows[0]["VICONTENT"].ToString(); hdOldProduct.Value = dt.Rows[0]["VICONTENT"].ToString(); #region SEO textLinkRewrite.Text = dt.Rows[0]["VISEOLINK"].ToString(); textTagTitle.Text = dt.Rows[0]["VISEOTITLE"].ToString(); textTagKeyword.Text = dt.Rows[0]["VISEOMETAKEY"].ToString(); textTagDescription.Text = dt.Rows[0]["VISEOMETADESC"].ToString(); #endregion txtCreateDate.Text = dt.Rows[0]["DCREATEDATE"].ToString(); #region Image if (!dt.Rows[0]["VIIMAGE"].ToString().Equals("")) { ltimg.Text = ImagesExtension.GetImage(pic, dt.Rows[0]["VIIMAGE"].ToString(), "", "imgItem", false, false, "", false); lnk_delete_Image_current.Visible = true; } else { ltimg.Visible = false; lnk_delete_Image_current.Visible = false; } hd_img.Value = dt.Rows[0]["VIIMAGE"].ToString(); if (hd_img.Value.Length < 1) { cbLayAnhTuNoiDung.Checked = true; } else { cbLayAnhTuNoiDung.Checked = false; } #endregion HdIitotalview.Value = dt.Rows[0]["IITOTALVIEW"].ToString(); #region IIENABLE if (dt.Rows[0]["IIENABLE"].ToString().Equals("0")) { chk_status.Checked = false; } else { chk_status.Checked = true; } #endregion tbPrice.Text = dt.Rows[0][ItemsColumns.FipriceColumn].ToString(); tbPriceOld.Text = dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString(); tbKey.Text = dt.Rows[0][ItemsColumns.VikeyColumn].ToString(); tbOrder.Text = dt.Rows[0][ItemsColumns.IiorderColumn].ToString(); tbThongSo.Text = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.ViparamsColumn].ToString(), "", 1); hdNguoiDangCu.Value = dt.Rows[0]["VIURL"].ToString(); hdThongTinThem.Value = dt.Rows[0]["VISEOMETACANONICAL"].ToString(); hdEnable.Value = dt.Rows[0]["IIENABLE"].ToString(); hdNgayXuatBan.Value = dt.Rows[0]["VISEOMETALANG"].ToString(); #region Ẩn nút hiển thị bài viết với tính năng duyệt tin if (ProductConfig.KeyDuyetTin) { string userRole = CookieExtension.GetCookies("RolesUser"); #region Với tính năng duyệt tin 2 cấp (phóng viên, biên tập => trưởng ban biên tập => tổng biên tập) if (HorizaMenuConfig.ShowDuyetTin2) { if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap1, userRole)) { #region Với tài khoản cấp 1 (phóng viên, biên tập) pnTichChonDeHienThi.Visible = false; ltrTrangThai.Visible = false; chk_status.Checked = false; #endregion } else if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap2, userRole)) { #region Với tài khoản cấp 2 (trưởng ban biên tập) pnTichChonDeHienThi.Visible = false; ltrTrangThai.Visible = false; chk_status.Checked = false; #endregion } else if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap3, userRole)) { #region Với tài khoản cấp 3 (tổng biên tập) chk_status.Text = Developer.DuyetTinKeyword.XuatBanBaiViet; #endregion } } #endregion #region Với tính năng duyệt tin 1 cấp (phóng viên, biên tập viên => tổng biên tập) else if (HorizaMenuConfig.ShowDuyetTin1) { if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap2, userRole)) { #region Với tài khoản cấp 2 (phóng viên, biên tập) pnTichChonDeHienThi.Visible = false; ltrTrangThai.Visible = false; chk_status.Checked = false; #endregion } else if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap3, userRole)) { #region Với tài khoản cấp 3 (tổng biên tập) chk_status.Text = Developer.DuyetTinKeyword.XuatBanBaiViet; #endregion } } #endregion } #endregion GetFilterProperties(); #region ThuocTinhSanPham-Chi thực hiện khi chức năng Quản lý thuộc tính được hiển thị if (ProductConfig.KeyHienThiQuanLyThuocTinhSanPham) { string properties = ""; condition = DataExtension.AndConditon( SubitemsTSql.GetSubitemsByIid(iid), SubitemsTSql.GetSubitemsByVskey(propertyModul)); fields = SubitemsColumns.VscontentColumn; dt = Subitems.GetSubItems("", fields, condition, ""); if (dt.Rows.Count > 0) { properties = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(); } for (int i = 0; i < rptProperties.Items.Count; i++) { CheckBox checkBoxProperties = (CheckBox)rptProperties.Items[i].FindControl("checkBoxProperties"); if (properties.IndexOf(parramSpitString + checkBoxProperties.ToolTip + parramSpitString) > -1) { checkBoxProperties.Checked = true; } else { checkBoxProperties.Checked = false; } } } #endregion #region Nicks- Chỉ hiển thị khi chức năng add nick được hiển thị if (ProductConfig.KeyHienThiAddNickChoSanPham) { string nicks = ""; condition = DataExtension.AndConditon( SubitemsTSql.GetSubitemsByIid(iid), SubitemsTSql.GetSubitemsByVskey(TatThanhJsc.OtherModul.CodeApplications.SupportOnline)); fields = SubitemsColumns.VscontentColumn; dt = Subitems.GetSubItems("", fields, condition, ""); if (dt.Rows.Count > 0) { nicks = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(); } for (int i = 0; i < rptNicks.Items.Count; i++) { CheckBox checkBoxNicks = (CheckBox)rptNicks.Items[i].FindControl("checkBoxNicks"); if (nicks.IndexOf(parramSpitString + checkBoxNicks.ToolTip + parramSpitString) > -1) { checkBoxNicks.Checked = true; } else { checkBoxNicks.Checked = false; } } } #endregion #region ThuocTinhLoc- Chỉ hiển thị khi chức năng quản lý thuộc tính lọc được hiển thị string filterProperties = ""; condition = DataExtension.AndConditon( SubitemsTSql.GetSubitemsByIid(iid), SubitemsTSql.GetSubitemsByVskey(CodeApplications.ProductFilterProperties)); fields = SubitemsColumns.VscontentColumn; dt = Subitems.GetSubItems("", fields, condition, ""); if (dt.Rows.Count > 0) { filterProperties = dt.Rows[0][SubitemsColumns.VscontentColumn].ToString(); } for (int i = 0; i < rptParentFilter.Items.Count; i++) { //Đánh dấu radiobuttonlist RadioButtonList rdblListAnswer = (RadioButtonList)rptParentFilter.Items[i].FindControl("rdblAnswer"); if (rdblListAnswer != null) { for (int j = 0; j < rdblListAnswer.Items.Count; j++) { if (filterProperties.IndexOf(parramSpitString + rdblListAnswer.Items[j].Value + parramSpitString) > -1) { rdblListAnswer.Items[j].Selected = true; } else { rdblListAnswer.Items[j].Selected = false; } } } //Đánh dấu checkboxlist CheckBoxList cblListAnswer = (CheckBoxList)rptParentFilter.Items[i].FindControl("cblAnswer"); if (cblListAnswer != null) { for (int j = 0; j < cblListAnswer.Items.Count; j++) { if (filterProperties.IndexOf(parramSpitString + cblListAnswer.Items[j].Value + parramSpitString) > -1) { cblListAnswer.Items[j].Selected = true; } else { cblListAnswer.Items[j].Selected = false; } } } } #endregion } #endregion #region insert else { //btn_insert_update.Text = "Đồng ý"; txtCreateDate.Text = DateTime.Now.ToString(); GetFilterProperties(); #region Ẩn nút hiển thị bài viết với tính năng duyệt tin if (ProductConfig.KeyDuyetTin) { chk_status.Checked = false; string userRole = CookieExtension.GetCookies("RolesUser"); #region Với tính năng duyệt tin 2 cấp (phóng viên, biên tập => trưởng ban biên tập => tổng biên tập) if (HorizaMenuConfig.ShowDuyetTin2) { if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap1, userRole)) { #region Với tài khoản cấp 1 (phóng viên, biên tập) pnTichChonDeHienThi.Visible = false; #endregion } else if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap2, userRole)) { #region Với tài khoản cấp 2 (trưởng ban biên tập) pnTichChonDeHienThi.Visible = false; #endregion } else if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap3, userRole)) { #region Với tài khoản cấp 3 (tổng biên tập) chk_status.Text = Developer.DuyetTinKeyword.XuatBanBaiViet; #endregion } } #endregion #region Với tính năng duyệt tin 1 cấp (phóng viên, biên tập viên => tổng biên tập) else if (HorizaMenuConfig.ShowDuyetTin1) { if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap2, userRole)) { #region Với tài khoản cấp 2 (phóng viên, biên tập) pnTichChonDeHienThi.Visible = false; #endregion } else if (StringExtension.RoleInListRoles(PhanQuyen.DuyetTin.Cap3, userRole)) { #region Với tài khoản cấp 3 (tổng biên tập) chk_status.Text = Developer.DuyetTinKeyword.XuatBanBaiViet; #endregion } } #endregion } #endregion } #endregion }
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, ItemsColumns.ViurlColumn, ItemsColumns.VISEOMETAPARAMSColumn); 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 = ""; 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(); 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()); s += @" <div class='blog'> <div class='item item-post'> <div class='item-img'> <a href='" + link + @"' class='imgc'> " + ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViImage].ToString(), dt.Rows[0][ItemsColumns.ViTitle].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); }