Exemplo n.º 1
0
    protected void lstProductCategory_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        var item         = e.Item as ListViewDataItem;
        var ParentIDSub  = (item.FindControl("hdnParentIDSub") as HiddenField).Value;
        var PanelProduct = item.FindControl("pnlProduct") as Panel;

        if (!string.IsNullOrEmpty(ParentIDSub))
        {
            var oProductCategory = new TLLib.ProductCategory();
            var dv = oProductCategory.ProductCategorySelectAll(Convert.ToInt32(ParentIDSub), 1, "", "").DefaultView;
            if (dv.Count == 0)
            {
                PanelProduct.Visible = true;
            }
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (((DataView)odsProductSale.Select()).Count <= DataPager1.PageSize)
            {
                DataPager1.Visible = false;
            }

            string strTitle, strDescription, strMetaTitle, strMetaDescription;
            if (!string.IsNullOrEmpty(Request.QueryString["pci"]))
            {
                var oProductCategory = new TLLib.ProductCategory();
                var dv = oProductCategory.ProductCategorySelectOne(Request.QueryString["pci"]).DefaultView;

                if (dv != null && dv.Count <= 0)
                {
                    return;
                }
                var row = dv[0];

                strTitle           = Server.HtmlDecode(row["ProductCategoryName"].ToString());
                strDescription     = Server.HtmlDecode(row["Description"].ToString());
                strMetaTitle       = Server.HtmlDecode(row["MetaTitle"].ToString());
                strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString());

                //hdnSanPham.Value = progressTitle(dv[0]["ProductCategoryName"].ToString()) + "-pci-" + dv[0]["ProductCategoryID"].ToString() + ".aspx";
            }
            else
            {
                strTitle           = strMetaTitle = "Khuyến Mãi";
                strDescription     = "";
                strMetaDescription = "";
            }
            Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle;
            var meta = new HtmlMeta()
            {
                Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription
            };
            Header.Controls.Add(meta);

            //lblName.Text = strTitle;
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string strTitle, strDescription, strMetaTitle, strMetaDescription;
            if (!string.IsNullOrEmpty(Request.QueryString["pi"]))
            {
                var oProductCategory = new TLLib.ProductCategory();
                var oProduct         = new TLLib.Product();

                var dv  = oProduct.ProductSelectOne(Request.QueryString["pi"]).DefaultView;
                var dv2 = oProductCategory.ProductCategorySelectOne(Request.QueryString["pci"]).DefaultView;

                if (dv != null && dv.Count <= 0)
                {
                    return;
                }
                var row = dv[0];

                strTitle           = Server.HtmlDecode(row["ProductName"].ToString());
                strDescription     = Server.HtmlDecode(row["Description"].ToString());
                strMetaTitle       = Server.HtmlDecode(row["MetaTittle"].ToString());
                strMetaDescription = Server.HtmlDecode(row["MetaDescription"].ToString());

                hdnSanPhamDetails.Value = progressTitle(dv2[0]["ProductCategoryName"].ToString()) + "-pci-" + dv2[0]["ProductCategoryID"].ToString() + ".aspx";
            }
            else
            {
                strTitle           = strMetaTitle = "Sản Phẩm";
                strDescription     = "";
                strMetaDescription = "";
            }
            Page.Title = !string.IsNullOrEmpty(strMetaTitle) ? strMetaTitle : strTitle;
            var meta = new HtmlMeta()
            {
                Name = "description", Content = !string.IsNullOrEmpty(strMetaDescription) ? strMetaDescription : strDescription
            };
            Header.Controls.Add(meta);

            lblProductTitle.Text = strTitle;
        }
    }