Beispiel #1
0
    void LoadDetail()
    {
        DataTable dt = (DataTable)Session["dataByTitle"];

        if (dt.Rows.Count > 0)
        {
            GetIid        = dt.Rows[0][ItemsColumns.IidColumn].ToString();
            ltrTitle.Text = dt.Rows[0][ItemsColumns.VititleColumn].ToString();

            ToTalPriceOrigin = dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString() == "0" ? dt.Rows[0][ItemsColumns.FipriceColumn].ToString() == "0" ? LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ") : dt.Rows[0][ItemsColumns.FipriceColumn].ToString() : dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString();

            if (ToTalPriceOrigin != LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ"))
            {
                ToTalPrice       = NumberExtension.FormatNumber(ToTalPriceOrigin);
                ltrSubPrice.Text = LanguageItemExtension.GetnLanguageItemTitleByName("VND");
            }
            else
            {
                ToTalPrice = LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ");
            }

            GiaNguoiLon       = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 1);
            GiaTreViThanhNien = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 2);
            GiaTreEm          = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 3);
            GiaEmBe           = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 4);

            LayIgid(dt.Rows[0][ItemsColumns.IidColumn].ToString());
        }
    }
Beispiel #2
0
    /// <summary>
    /// Hiện thị danh sách tin ra html
    /// </summary>
    /// <param name="dt"></param>
    /// <returns></returns>
    private string BindItemsToHTML(DataTable dt)
    {
        string s    = "";
        string link = "";

        if (dt.Rows.Count > 0)
        {
            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-program__item fade-up'>
        <div class='list-program__img img'>
            <a  href='" + link + @"' 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, "", false) + @"            
            </a>
        </div>
        <div class='list-program__content'>
            <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>
            <h3 class='list-program__ttl'><a href=''>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a></h3>
            <p class='txtBase'>" + dt.Rows[i][ItemsColumns.VidescColumn] + @"</p>
            <a href='" + link + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='view-more'>xem thêm</a>
        </div>
    </div>";
            }
        }
        return(s);
    }
    void GetCartDetails(string iid)
    {
        DataTable dt = new DataTable();

        condition = DataExtension.AndConditon(
            ItemsTSql.GetItemsByViapp(app),
            ItemsTSql.GetItemsByIid(iid)
            );
        dt = TatThanhJsc.Database.Items.GetItems("1", "*", condition, "");
        if (dt.Rows.Count > 0)
        {
            ltrMaDonHang.Text         = dt.Rows[0][ItemsColumns.VikeyColumn].ToString();
            ltrThongTinKhachHang.Text = LayThongTinKhachHang(dt.Rows[0][ItemsColumns.VicontentColumn].ToString());
            double phiVanChuyen = 0;
            double tongTienHang = 0;
            try
            {
                phiVanChuyen = double.Parse(dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString());
            }
            catch { }
            try
            {
                tongTienHang = double.Parse(dt.Rows[0][ItemsColumns.FipriceColumn].ToString());
            }
            catch {}
            tongTienHang      += phiVanChuyen;
            ltrTotalPrice.Text = NumberExtension.FormatNumber(tongTienHang.ToString());
            ltrReadPrice.Text  = NumberExtension.ReadNumber(tongTienHang.ToString());

            GetList(iid);
        }
    }
Beispiel #4
0
 private string CountTagInGroups(string igid)
 {
     return
         (NumberExtension.FormatNumber(
              GroupsItems.GetGroupsItems("", GroupsItemsColumns.IgiidColumn,
                                         GroupsItemsTSql.GetGroupsItemsByIgid(igid), "").Rows.Count.ToString()));
 }
Beispiel #5
0
    void LoadDetail()
    {
        DataTable dt = (DataTable)Session["dataByTitle"];//Thông tin chi tiết về Items hoặc Groups đã được gán ở Defualt.aspx vào session

        if (dt.Rows.Count > 0)
        {
            ltrDate.Text      = ((DateTime)dt.Rows[0][ItemsColumns.DiupdateColumn]).ToString(LanguageItemExtension.GetnLanguageItemTitleByName("dd/MM/yyyy - hh:mm tt"));
            ltrViewCount.Text = NumberExtension.FormatNumber(((int)dt.Rows[0][ItemsColumns.IitotalviewColumn] + 1).ToString());
        }
    }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ltrFooterCopyright.Text = SettingsExtension.GetSettingKey(SettingsExtension.KeyContentFooterWebsite + "Top", lang);
         ltrTripadvisor.Text     = SettingsExtension.GetSettingKey("KeyTripadvisor", lang);
         ltrOnline.Text          = NumberExtension.FormatNumber(OnlineActiveUsers.OnlineUsersInstance.OnlineUsers.UsersCount.ToString());
         ltrTotal.Text           = NumberExtension.FormatNumber(SettingsExtension.GetSettingKey(SettingsExtension.KeyTotalView, lang));
     }
 }
Beispiel #7
0
        /// <summary>
        /// Đếm số hình ảnh trong một album
        /// </summary>
        /// <param name="iid"></param>
        /// <returns></returns>
        public static string CountSubItems(string iid)
        {
            string condition = DataExtension.AndConditon(
                SubitemsTSql.GetSubitemsByIid(iid),
                SubitemsTSql.GetSubitemsByIsenable("1"),
                SubitemsTSql.GetSubitemsByVskey(TatThanhJsc.PhotoAlbumModul.CodeApplications.PhotoAlbumImagesOther));
            DataTable dt = new DataTable();

            dt = Subitems.GetSubItems("", SubitemsColumns.IsidColumn, condition, "");
            return(NumberExtension.FormatNumber(dt.Rows.Count.ToString()));
        }
    /// <summary>
    /// Đếm comment cho một blog
    /// </summary>
    /// <param name="iid"></param>
    /// <returns></returns>
    public static string CountComment(string iid)
    {
        string app       = TatThanhJsc.BlogModul.CodeApplications.BlogComment;
        string condition = DataExtension.AndConditon(
            SubitemsTSql.GetByIid(iid),
            SubitemsTSql.GetByApp(app),
            SubitemsTSql.GetByEnable("1")
            );
        DataTable dt = Subitems.GetSubItems("", SubitemsColumns.IsidColumn, condition, "");

        return(NumberExtension.FormatNumber(dt.Rows.Count.ToString()));
    }
 private string TienDuocGiam(double giaNY, double giaKM)
 {
     giaNY = giaNY - giaKM;
     if (giaNY <= 0 || giaKM <= 0)
     {
         return("");
     }
     else
     {
         return(LanguageItemExtension.GetnLanguageItemTitleByName("$") +
                NumberExtension.FormatNumber(giaNY.ToString(), false, "", ""));
     }
 }
Beispiel #10
0
    void LoadDetail()
    {
        DataTable dt = (DataTable)Session["dataByTitle"];

        if (dt.Rows.Count > 0)
        {
            UpdateTotalView(dt.Rows[0][ItemsColumns.IidColumn].ToString());

            ltrImage.Text = ImagesExtension.GetImage(TatThanhJsc.TourModul.FolderPic.Tour, dt.Rows[0][ItemsColumns.ViimageColumn].ToString(), dt.Rows[0][ItemsColumns.VititleColumn].ToString(), "", true, false, "");

            ltrTitle.Text         = dt.Rows[0][ItemsColumns.VititleColumn].ToString();
            ltrDesc.Text          = dt.Rows[0][ItemsColumns.VidescColumn].ToString();
            ltrDepartureFrom.Text = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VicontentColumn].ToString(), "", 1);
            ltrDepartureTime.Text = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VicontentColumn].ToString(), "", 5);
            ltrVehicle.Text       = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VicontentColumn].ToString(), "", 2);
            //ltrSalePrice.Text = dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString() == "0" ? LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ") : NumberExtension.FormatNumber(dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString()) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ");
            //ltrPrice.Text = dt.Rows[0][ItemsColumns.FipriceColumn].ToString() == "0" ? "" : NumberExtension.FormatNumber(dt.Rows[0][ItemsColumns.FipriceColumn].ToString()) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ");
            ltrVideo.Text = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VicontentColumn].ToString(), "", 3);
            ltrMap.Text   = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VicontentColumn].ToString(), "", 4);


            string price     = dt.Rows[0][ItemsColumns.FipriceColumn].ToString();
            string salePrice = dt.Rows[0][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Đ");
            }

            ltrSalePrice.Text = salePrice;
            ltrPrice.Text     = price;

            ltrItinerary.Text = LayLichTrinh(dt.Rows[0][ItemsColumns.IidColumn].ToString());
            ltrImages.Text    = LayHinhAnh(dt.Rows[0][ItemsColumns.IidColumn].ToString());
            ltrDuration.Text  = LayThoiGianTour(dt.Rows[0][ItemsColumns.ViurlColumn].ToString());
        }
    }
        /// <summary>
        /// Hiển thị giá niêm yết, giá khuyến mại. Nếu không có giá khuyến mại thì chỉ hiển thị giá niêm yết, có cho gạch ngang giá cũ
        /// </summary>
        /// <param name="giaNY">dt.Rows[i][ItemsColumns.FipriceColumn].ToString()</param>
        /// <param name="giaKM">dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString()</param>
        /// <returns></returns>
        public static string HienThiGia02(string giaNY, string giaKM)
        {
            string s = "";

            if (ConfigurationManager.AppSettings["amegatour3"] != null)
            {
                if (giaKM != "0")
                {
                    s += "<span class='giaKM'>" +
                         NumberExtension.FormatNumber(giaKM, true, LanguageItemExtension.GetnLanguageItemTitleByName("contact"), LanguageItemExtension.GetnLanguageItemTitleByName("$")).Replace(" ", "") +
                         "</span>";
                    s += " <span class='giaNY' style='text-decoration:line-through'>" +
                         NumberExtension.FormatNumber(giaNY, true, LanguageItemExtension.GetnLanguageItemTitleByName("contact"), LanguageItemExtension.GetnLanguageItemTitleByName("$")).Replace(" ", "") +
                         "</span>";
                }
                else
                {
                    s = "<span class='giaKM'>" +
                        NumberExtension.FormatNumber(giaNY, true, LanguageItemExtension.GetnLanguageItemTitleByName("contact"), LanguageItemExtension.GetnLanguageItemTitleByName("$")).Replace(" ", "") +
                        "</span>";
                }
            }
            else
            {
                if (giaKM != "0")
                {
                    s += "<span class='giaKM'>" + LanguageItemExtension.GetnLanguageItemTitleByName("$") +
                         NumberExtension.FormatNumber(giaKM, true,
                                                      LanguageItemExtension.GetnLanguageItemTitleByName("contact"), "") +
                         "</span>";
                    s += "<span class='giaNY' style='text-decoration:line-through'>" +
                         LanguageItemExtension.GetnLanguageItemTitleByName("$") +
                         NumberExtension.FormatNumber(giaNY, true,
                                                      LanguageItemExtension.GetnLanguageItemTitleByName("contact"), "") +
                         "</span>";
                }
                else
                {
                    s = "<span class='giaKM'>" + LanguageItemExtension.GetnLanguageItemTitleByName("$") +
                        NumberExtension.FormatNumber(giaNY, true,
                                                     LanguageItemExtension.GetnLanguageItemTitleByName("contact"), "") +
                        "</span>";
                }
            }
            return(s);
        }
    private string GetList(string id, string top)
    {
        var    s = string.Empty;
        string fields = "*", condition = "", orderby = "";
        int    rows = 6;

        try
        {
            rows = int.Parse(top);
        }
        catch
        {
        }
        condition = DataExtension.AndConditon(
            ItemsTSql.GetByEnable("1"),
            ItemsTSql.GetByApp(app)
            );
        condition = GroupsItemsTSql.GetItemsInGroupCondition(id, condition);
        orderby   = GroupsItemsColumns.IorderColumn;
        DataTable dt = GroupsItems.GetAllData(rows.ToString(), fields, condition, orderby);

        if (dt.Rows.Count > 0)
        {
            s = "";
            string link = "", titleItem = "", desc = "", img = "", dateIT = "", countView = "", listOrther = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                link      = (UrlExtension.WebisteUrl + dt.Rows[i][ItemsColumns.VISEOLINKSEARCHColumn] + RewriteExtension.Extensions).ToLower();
                titleItem = dt.Rows[i][ItemsColumns.VititleColumn].ToString();
                img       = ImagesExtension.GetImage(pic, dt.Rows[i][ItemsColumns.ViimageColumn].ToString(), titleItem, "", true, false, "", false);
                desc      = dt.Rows[i][ItemsColumns.VidescColumn].ToString();
                dateIT    = ((DateTime)dt.Rows[i][ItemsColumns.DicreatedateColumn]).ToString("dd/MM/yyyy");
                countView = NumberExtension.FormatNumber((int.Parse(dt.Rows[i][ItemsColumns.IitotalviewColumn].ToString())).ToString());
                s        += @"
        <div class='list-news03__item fade-up'>
            <div class='list-news03__img img'>
                <a class='img__crop' href='" + link + "' title='" + titleItem + @"'> " + img + @"</a>
            </div>
            <div class='list-news03__content'>
                <h3 class='list-news03__ttl'><a href='" + link + "' title='" + titleItem + @"'>" + titleItem + @"</a></h3>
            </div>
        </div>";
            }
        }
        return(s);
    }
Beispiel #13
0
    void LoadDetail()
    {
        DataTable dt = (DataTable)Session["dataByTitle"];

        if (dt.Rows.Count > 0)
        {
            UpdateTotalView(dt.Rows[0][ItemsColumns.IidColumn].ToString());

            ltrTitle.Text  = dt.Rows[0][ItemsColumns.VititleColumn].ToString();
            ltrDate.Text   = ((DateTime)dt.Rows[0][ItemsColumns.DiupdateColumn]).ToString(LanguageItemExtension.GetnLanguageItemTitleByName("dd/MM/yyyy - HH:mm tt"));
            ltrViews.Text  = NumberExtension.FormatNumber(((int)dt.Rows[0][ItemsColumns.IitotalviewColumn] + 1).ToString()) + " " + LanguageItemExtension.GetnLanguageItemTitleByName("lượt xem");
            ltContent.Text = dt.Rows[0][ItemsColumns.VicontentColumn].ToString();
            if (ltContent.Text == "")
            {
                ltContent.Text = "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Nội dung bài viết đang được chúng tôi cập nhật. Cảm ơn quý khách đã quan tâm!") + "</div>";
            }
        }
    }
        /// <summary>
        /// Hiển thị giá niêm yết, giá khuyến mại. Nếu không có giá khuyến mại thì chỉ hiển thị giá niêm yết
        /// </summary>
        /// <param name="giaNY">dt.Rows[i][ItemsColumns.FipriceColumn].ToString()</param>
        /// <param name="giaKM">dt.Rows[i][ItemsColumns.FisalepriceColumn].ToString()</param>
        /// <returns></returns>
        public static string HienThiGia(string giaNY, string giaKM)
        {
            string s = "";

            if (giaKM != "0")
            {
                s += "<span class='giaKM'>" +
                     NumberExtension.FormatNumber(giaKM, true, LanguageItemExtension.GetnLanguageItemTitleByName("liên hệ"), LanguageItemExtension.GetnLanguageItemTitleByName("đ")) +
                     "</span>";
                s += " <span class='giaNY'>" +
                     NumberExtension.FormatNumber(giaNY, true, LanguageItemExtension.GetnLanguageItemTitleByName("liên hệ"), LanguageItemExtension.GetnLanguageItemTitleByName("đ")) +
                     "</span>";
            }
            else
            {
                s = "<span class='giaKM'>" +
                    NumberExtension.FormatNumber(giaNY, true, LanguageItemExtension.GetnLanguageItemTitleByName("liên hệ"), LanguageItemExtension.GetnLanguageItemTitleByName("đ")) +
                    "</span>";
            }
            return(s);
        }
    void LoadDetail()
    {
        DataTable dt = (DataTable)Session["dataByTitle"];

        if (dt.Rows.Count > 0)
        {
            UpdateTotalView(dt.Rows[0][ItemsColumns.IidColumn].ToString());
            ltrTitle.Text = dt.Rows[0][ItemsColumns.VititleColumn].ToString();

            ltContent.Text = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VicontentColumn].ToString(), "", 9);

            string price     = dt.Rows[0][ItemsColumns.FipriceColumn].ToString();
            string salePrice = dt.Rows[0][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Đ");
            }

            ltrSalePrice.Text = salePrice;
            ltrPrice.Text     = price;


            if (ltContent.Text == "")
            {
                ltContent.Text = "<div class='emptyresult'>" + LanguageItemExtension.GetnLanguageItemTitleByName("Nội dung bài viết đang được chúng tôi cập nhật. Cảm ơn quý khách đã quan tâm!") + "</div>";
            }
        }
    }
    protected string ThanhTien(string soLuong, string donGia)
    {
        double soluong = 0;
        double dongia  = 0;

        try
        {
            soluong = double.Parse(soLuong);
        }
        catch
        {
        }
        try
        {
            dongia = double.Parse(donGia);
        }
        catch
        {
        }
        dongia *= soluong;

        return(NumberExtension.FormatNumber(dongia.ToString()));
    }
Beispiel #17
0
    private void GetPrice()
    {
        string s   = "Success";
        string iid = Request.Params["iid"];

        string ToTalPrice       = "";
        string ToTalPriceOrigin = "";

        string GiaNguoiLon       = "";
        string GiaTreViThanhNien = "";
        string GiaTreEm          = "";
        string GiaEmBe           = "";

        DataTable dt = GroupsItems.GetAllData("1", "*", ItemsTSql.GetById(iid), ItemsColumns.IiorderColumn + " desc ");

        if (dt.Rows.Count > 0)
        {
            ToTalPriceOrigin = dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString() == "0" ? dt.Rows[0][ItemsColumns.FipriceColumn].ToString() == "0" ? LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ") : dt.Rows[0][ItemsColumns.FipriceColumn].ToString() : dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString();

            if (ToTalPriceOrigin != LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ"))
            {
                ToTalPrice = NumberExtension.FormatNumber(ToTalPriceOrigin);
            }
            else
            {
                ToTalPrice = LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ");
            }

            GiaNguoiLon       = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 1);
            GiaTreViThanhNien = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 2);
            GiaTreEm          = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 3);
            GiaEmBe           = StringExtension.LayChuoi(dt.Rows[0][ItemsColumns.VISEOMETACANONICALColumn].ToString(), "", 4);
        }

        string[] strArrayReturn = { s, ToTalPriceOrigin, ToTalPrice, GiaNguoiLon, GiaTreViThanhNien, GiaTreEm, GiaEmBe };
        Response.Write(js.Serialize(strArrayReturn));
    }
Beispiel #18
0
    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);
    }
    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
        }
    }
Beispiel #20
0
    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
        }
    }
Beispiel #21
0
    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;
    }
Beispiel #22
0
    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 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);
    }
Beispiel #24
0
    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);
    }
Beispiel #25
0
    private string BindItemsToHTML(DataTable dt)
    {
        string s = "";

        if (dt.Rows.Count > 0)
        {
            string link = "";
            string price = "", salePrice = "";
            string time  = "";
            int    point = dt.Rows.Count - 4;

            if (point < 1)
            {
                point = 1;
            }

            string layout1 = "";
            string layout2 = "";

            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)
                {
                    layout1 += @"
          <div class='blog'>
            <div class='item item-post item-big'>
              <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 + @"' title='" + dt.Rows[i][ItemsColumns.VititleColumn] + @"' class='title item-title'>" + dt.Rows[i][ItemsColumns.VititleColumn] + @"</a>
                </h3>
                <p class='item-text'>" + dt.Rows[i][ItemsColumns.VidescColumn] + @"</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>
          </div>";
                }
                else
                {
                    layout2 += @"
          <div class='colBlog'>
            <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>";
                }
            }

            s = @"
      <div class='colBlog colDouble'>
        <div class='slick-slider' data-slick='{""slidesToShow"": 1, ""slidesToScroll"": 1, ""autoplay"": false, ""dots"": false, ""arrows"":true, ""responsive"": [{""breakpoint"":1025,""settings"": ""unslick""}]}'>
          " + layout1 + @"
        </div>
      </div>
      " + layout2 + @"";
        }
        return(s);
    }
    void LoadDetail()
    {
        DataTable dt = (DataTable)Session["dataByTitle"];

        if (dt.Rows.Count > 0)
        {
            iid   = dt.Rows[0][ItemsColumns.IidColumn].ToString();
            hotel = dt.Rows[0][ItemsColumns.VititleColumn].ToString();
            price = dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString() == "0" ? LanguageItemExtension.GetnLanguageItemTitleByName("Liên hệ") : NumberExtension.FormatNumber(dt.Rows[0][ItemsColumns.FisalepriceColumn].ToString()) + LanguageItemExtension.GetnLanguageItemTitleByName("VNĐ");
        }
    }