public void LoadCycleProduct()
    {
        int         i       = 0;
        string      Lang    = Globals.GetLang();
        LanguageXML langXml = new LanguageXML("Language" + Lang);

        MyTool.Product obj                   = new MyTool.Product();
        DataSet        ds                    = obj.GetTopHotProduct("ProductCat", Globals.AgentCatID, 10, Lang);
        int            half                  = ds.Tables[0].Rows.Count / 2;
        string         detailUrl             = "";
        string         strScriptTooltipImage = "";

        Response.Write("<div>");
        for (i = 0; i < half; i++)
        {
            detailUrl             = "ProductDetail.aspx?ID=" + DataObject.GetString(ds, i, "ID") + "&CatID=" + DataObject.GetString(ds, i, "GroupID") + "&Lang=" + Lang;
            strScriptTooltipImage = "onmouseout=\"hideTip()\" onmouseover=\"doTooltip(event,'" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh") + "','" + DataObject.GetString(ds, i, "TenGoi") + "','#ffffff','#000000')\"";

            Response.Write("<a " + strScriptTooltipImage + " title=\"" + langXml.GetString("Web", "Text", "ClickToAddCart") + DataObject.GetString(ds, i, "TenGoi") + "\" class=\"article-item\" href=\"Contact.aspx?t=ContactProduct&ProductID=" + DataObject.GetString(ds, i, "ID") + "&Lang=" + Lang + "\">");
            Response.Write("<span>" + DataObject.GetString(ds, i, "TenGoi") + "</span>");
            if (Globals.IsFileExistent(DataObject.GetString(ds, i, "Anh")))
            {
                Response.Write("<img src=\"Thumbnail.ashx?width=140&height=160&ImgFilePath=" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh") + "\" />");
            }
            else
            {
                Response.Write("<img src=\"" + Globals.DefaultImage + "\" />");
            }
            Response.Write("<br />");
            Response.Write("<span style=\"text-align:center; color:Orange\">");
            Response.Write(Globals.FormatStringThousand(DataObject.GetDouble(ds, i, "GiaBan")) + " " + DataObject.GetString(ds, i, "NgoaiTe"));
            Response.Write("</span>");
            Response.Write("</a>");
        }
        Response.Write("</div>");
        /////
        Response.Write("<div>");
        for (i = half; i < ds.Tables[0].Rows.Count; i++)
        {
            detailUrl             = "ProductDetail.aspx?ID=" + DataObject.GetString(ds, i, "ID") + "&CatID=" + DataObject.GetString(ds, i, "GroupID") + "&Lang=" + Lang;
            strScriptTooltipImage = "onmouseout=\"hideTip()\" onmouseover=\"doTooltip(event,'" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh") + "','" + DataObject.GetString(ds, i, "TenGoi") + "','#ffffff','#000000')\"";

            Response.Write("<a " + strScriptTooltipImage + " title=\"" + langXml.GetString("Web", "Text", "ClickToAddCart") + DataObject.GetString(ds, i, "TenGoi") + "\" class=\"article-item\" href=\"Contact.aspx?t=ContactProduct&ProductID=" + DataObject.GetString(ds, i, "ID") + "&Lang=" + Lang + "\">");
            Response.Write("<span>" + DataObject.GetString(ds, i, "TenGoi") + "</span>");
            if (Globals.IsFileExistent(DataObject.GetString(ds, i, "Anh")))
            {
                Response.Write("<img src=\"Thumbnail.ashx?width=140&height=160&ImgFilePath=" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh") + "\" />");
            }
            else
            {
                Response.Write("<img src=\"" + Globals.DefaultImage + "\" />");
            }
            Response.Write("<br />");
            Response.Write("<span style=\"text-align:center; color:Orange\">");
            Response.Write(Globals.FormatStringThousand(DataObject.GetDouble(ds, i, "GiaBan")) + " " + DataObject.GetString(ds, i, "NgoaiTe"));
            Response.Write("</span>");
            Response.Write("</a>");
        }
        Response.Write("</div>");
    }
    private void LoadData()
    {
        string html = "";
        string Lang = Globals.GetLang();

        MyTool.Product obj = new MyTool.Product();
        if (_isAgentCat)
        {
            _agentCatID = Globals.AgentCatID;
        }
        DataSet ds = obj.GetTopHotProduct("ProductCat", _agentCatID, _nTop, Lang);

        divContent.InnerHtml = ProductListHtmlHelper.GetHtmlString(ds, Lang, 0, ds.Tables[0].Rows.Count, 150, _imageHeight);

        /*for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
         * {
         *  //detailUrl = "ProductDetail.aspx?ID=" + DataObject.GetString(ds, i, "ID") + "&CatID=" + DataObject.GetString(ds, i, "GroupID") + "&Lang=" + Lang;
         *  string detailUrl = Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh");
         *  html += "<div class=\"product-item\">";
         *  //html += "<a href=\"" + detailUrl + "\" class=\"product-name\">" + DataObject.GetString(ds, i, "TenGoi") + "</a>";
         *  html += "<a href=\"" + detailUrl + "\" class=\"product-image\" onclick=\"return hs.expand(this)\">";
         *  if (Globals.IsFileExistent(DataObject.GetString(ds, i, "Anh")))
         *      html += "<img width=\"" + _imageWidth + "\" height=\"" + _imageHeight + "\" src=\"Thumbnail.ashx?width=" + _imageWidth + "&height=" + _imageHeight + "&ImgFilePath=" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh") + "\" />";
         *  else
         *      html += "<img width=\"" + _imageWidth + "\" height=\"" + _imageHeight + "\" src=\"" + Globals.DefaultImage + "\" />";
         *  html += "</a>";
         *  //html += "<span class=\"product-price\">" + Globals.FormatStringThousand(DataObject.GetDouble(ds, i, "GiaBan")) + " " + DataObject.GetString(ds, i, "NgoaiTe") + "</span>";
         *  html += "</div>";
         * }
         * divContent.InnerHtml = html;*/
    }
    public void LoadBestSellerProduct()
    {
        string Lang = Globals.GetLang();

        Response.Write("<div class=\"title_box\">" + _subject + "</div>");
        Response.Write("<div class=\"border_box\">");
        MyTool.Product obj = new MyTool.Product();
        if (_isAgentCat)
        {
            _agentCatID = Globals.AgentCatID;
        }

        DataSet ds = obj.GetTopHotProduct("ProductCat", _agentCatID, _nTop, Lang);

        Response.Write("<div style=\"margin-left:50px;\">");
        Response.Write("<marquee behavior=\"scroll\" direction=\"up\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\" scrollamount=\"2\" height=\"200\">");
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            string detailUrl = "ProductDetail.aspx?ID=" + DataObject.GetString(ds, i, "ID") + "&CatID=" + DataObject.GetString(ds, i, "GroupID") + "&Lang=" + Lang;
            Response.Write("<div class=\"product_title\"><a class=\"" + _linkCssClass + "\" href=\"" + detailUrl + "\">" + DataObject.GetString(ds, i, "TenGoi") + "</a></div>");
            Response.Write("<div class=\"product_img\"><a href=\"" + detailUrl + "\">");
            if (Globals.IsFileExistent(DataObject.GetString(ds, i, "Anh")))
            {
                //Response.Write("<img class=\"imghotproduct\" src=\"" + Globals.GetUploadsUrl() + Convert.ToString(ds.Tables[0].Rows[i]["Anh"]) + "\" />");
                Response.Write("<img src=\"Thumbnail.ashx?width=" + _imageWidth + "&height=" + _imageHeight + "&ImgFilePath=" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh") + "\" class=\"" + _imageCssClass + "\" />");
            }
            else
            {
                Response.Write("<img class=\"" + _imageCssClass + "\" src=\"" + Globals.DefaultImage + "\" />");
            }
            Response.Write("</a></div>");
        }
        Response.Write("</marquee>");
        Response.Write("</div>");
    }
示例#4
0
    public void LoadHotProduct()
    {
        string Lang = Globals.GetLang();

        MyTool.Product obj = new MyTool.Product();
        if (_isAgentCat)
        {
            _agentCatID = Globals.AgentCatID;
        }
        DataSet ds = obj.GetTopHotProduct("ProductCat", _agentCatID, _nTop, Lang);

        Response.Write("<div class=\"title_box\">" + _subject + "</div>");
        Response.Write("<div class=\"border_box\">");
        Response.Write("<div style=\"margin-left:40px;\">");
        Response.Write("<marquee behavior=\"scroll\" direction=\"up\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\" scrollamount=\"2\" height=\"200\">");
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            string detailUrl = "ProductDetail.aspx?ID=" + DataObject.GetString(ds, i, "ID") + "&CatID=" + DataObject.GetString(ds, i, "GroupID") + "&Lang=" + Lang;
            Response.Write("<div class=\"product_title\"><a class=\"" + _linkCssClass + "\" href=\"" + detailUrl + "\">" + DataObject.GetString(ds, i, "TenGoi") + "</a></div>");
            Response.Write("<div class=\"product_img\"><a href=\"" + detailUrl + "\">");
            if (Globals.IsFileExistent(DataObject.GetString(ds, i, "Anh")))
            {
                Response.Write("<img src=\"Thumbnail.ashx?width=" + _imageWidth + "&height=" + _imageHeight + "&ImgFilePath=" + Globals.GetUploadsUrl() + DataObject.GetString(ds, i, "Anh") + "\" class=\"" + _imageCssClass + "\" />");
            }
            else
            {
                Response.Write("<img class=\"" + _imageCssClass + "\" src=\"" + Globals.DefaultImage + "\" />");
            }
            Response.Write("</a>");
            Response.Write("<div class=\"prod_price\" style=\"text-align:left; padding-left:15px;\">");
            //<!--<span class="reduce">350$</span>-->
            Response.Write("<span class=\"price\">" + Globals.FormatStringThousand(DataObject.GetDouble(ds, i, "GiaBan")) + " " + DataObject.GetString(ds, i, "NgoaiTe") + "</span></div>");
            Response.Write("</div>");
        }
        Response.Write("</marquee>");
        Response.Write("</div>");
        Response.Write("</div>");
    }