Exemple #1
0
        public string CreateTree(int pid, int deep)
        {
            string str = "";
            //的道所有的更节点
            // List<Lebi_Pro_Type> types = B_Lebi_Pro_Type.GetList("Parentid=" + pid + "", "Sort desc");
            List <Lebi_Pro_Type> types = EX_Product.Types(pid);
            //将根节点进行遍历
            string style = "";

            if (deep > 0)
            {
                style = "style=\"display:none;\"";
            }
            string showids = LB.Tools.CookieTool.GetCookieString("showTypeids").Replace("%2C", ",");
            string image   = "";

            foreach (Lebi_Pro_Type t in types)
            {
                image = AdminImage("plus.gif");
                bool showson = false;
                if (showids.Contains("," + t.id + ",") || showids.Contains("," + t.Parentid + ","))
                {
                    style = "";
                }
                if (showids.Contains("," + t.id + ","))
                {
                    image   = AdminImage("minus.gif");
                    showson = true;
                }
                int count = B_Lebi_Pro_Type.Counts("Parentid=" + t.id + "");
                //str += "<tr onclick='javascript:selectrow(\"check" + t.id + "\");' name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                str += "<tr class=\"list\" name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                str += "<td>" + deepstr(deep);
                if (count > 0)
                {
                    str += "<img src=\"" + image + "\" name=\"img" + t.Parentid + "\" id=\"img" + t.id + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" onclick=\"ShowChild('" + findpath(t.id) + "'," + t.id + "," + (deep + 1) + ")\" title=\"" + Tag("展开") + "\" />&nbsp;&nbsp;";
                }
                else
                {
                    str += "<img src=\"" + AdminImage("minus.gif") + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" />&nbsp;&nbsp;";
                }
                if (t.ImageSmall != "")
                {
                    str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                }
                str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><img src=\"" + PageImage("icon/newWindow.png") + "\" style=\"vertical-align:absmiddle\" /></a></td>";
                str += "<td>" + Shop.Bussiness.EX_Product.TypeProductCount(t.id) + "</td>";
                str += "<td>" + Shop.Bussiness.EX_Product.LikeProductCount(t.id) + "</td>";
                str += "<td>" + Shop.Bussiness.EX_Product.SalesProductCount(t.id) + "</td>";
                str += "<td>" + Shop.Bussiness.EX_Product.ViewsProductCount(t.id) + "</td>";
                str += "</tr>";
                if (showson)
                {
                    str += CreateTree(t.id, deep + 1);
                }

                //CreateSunNode(int.Parse(ds.Tables[0].Rows[i]["id"].ToString()), ",0", ss);
            }
            return(str);
        }
Exemple #2
0
        public string CreateList(string key)
        {
            string str = "";

            List <Lebi_Pro_Type> types = B_Lebi_Pro_Type.GetList("Name like lbsql{'%" + key + "%'}", "Sort desc");

            //将根节点进行遍历
            foreach (Lebi_Pro_Type t in types)
            {
                string caozuo = "<a href=\"javascript:Edit(" + t.id + ",0)\">" + Tag("添加子类") + "</a> |  <a href=\"javascript:Edit(0," + t.id + ")\">" + Tag("编辑") + "</a> | <a href=\"javascript:Del(" + t.id + ")\">" + Tag("删除") + "</a>";
                str += "<tr class=\"list\" name=\"tr" + t.Parentid + "\" id=\"tr" + t.id + "\">";
                str += "<td style=\"text-align:center\"><input type='checkbox' id=\"check" + t.id + "\" value='" + t.id + "' name='id' del=\"del\" /></td>";
                str += "<td>" + t.id + "</td>";
                str += "<td>";
                if (t.ImageSmall != "")
                {
                    str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                }
                str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><img src=\"" + PageImage("icon/newWindow.png") + "\" /></a></td>";
                str += "<td>" + Shop.Tools.Utils.GetUnicodeSubString(ProPertystring(t.ProPerty132), 100, "...") + "</td>";
                str += "<td>" + Shop.Tools.Utils.GetUnicodeSubString(ProPertystring(t.ProPerty131), 100, "...") + "</td>";
                str += "<td><a href=\"default.aspx?Pro_Type_id=" + t.id + "&Type_id_ProductType=320,321,322,323\">" + EX_Product.TypeProductCount(t.id) + "</a></td>";
                str += "<td>" + t.Sort + "</td>";
                str += "<td>" + (t.IsShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                str += "<td>" + (t.IsIndexShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                str += "<td>" + caozuo + "</td></tr>";

                //CreateSunNode(int.Parse(ds.Tables[0].Rows[i]["id"].ToString()), ",0", ss);
            }
            return(str);
        }
Exemple #3
0
        private string CreateProductTypeSelect(int id)
        {
            string        str  = "<select id=\"ProductType_" + id + "\" name=\"ProductType_" + id + "\" shop=\"true\" onchange=\"SelectProductType('ProductType_" + id + "');\">";
            Lebi_Pro_Type area = B_Lebi_Pro_Type.GetModel(id);

            if (area == null)
            {
                return("");
            }
            List <Lebi_Pro_Type> models = B_Lebi_Pro_Type.GetList("Parentid=" + area.Parentid + "", "Sort desc");

            if (models.Count == 0)
            {
                return("");
            }
            foreach (Lebi_Pro_Type model in models)
            {
                if (id == model.id)
                {
                    str += "<option value=\"" + model.id + "\" selected>" + Lang(model.Name) + "</option>";
                }
                else
                {
                    str += "<option value=\"" + model.id + "\">" + Lang(model.Name) + "</option>";
                }
            }
            str += "</select> ";
            str  = CreateProductTypeSelect(area.Parentid) + str;
            return(str);
        }
Exemple #4
0
        /// <summary>
        /// 卡备注
        /// </summary>
        /// <param name="card"></param>
        /// <returns></returns>
        public string CardRemark(Lebi_Card card)
        {
            string str = "";

            if (card.Money_Buy > 0)
            {
                str += Tag("最低消费") + ":" + FormatMoney(card.Money_Buy) + ";";
            }
            if (card.Pro_Type_ids != "")
            {
                string tstr             = "";
                List <Lebi_Pro_Type> ts = B_Lebi_Pro_Type.GetList("id in (" + card.Pro_Type_ids + ")", "");
                foreach (Lebi_Pro_Type t in ts)
                {
                    if (tstr == "")
                    {
                        tstr = Lang(t.Name);
                    }
                    else
                    {
                        tstr += "," + Lang(t.Name);
                    }
                }
                str += Tag("限制商品") + ":" + tstr + ";";
            }
            return(str);
        }
        /// <summary>
        /// 某个商品分类的路径
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string Categorypath(int id)
        {
            Shop.Model.Lebi_Pro_Type pro_type = Shop.Bussiness.B_Lebi_Pro_Type.GetModel(id);
            if (pro_type == null)
            {
                pro_type = new Shop.Model.Lebi_Pro_Type();
            }
            string str = EX_Product.TypePath(pro_type, id.ToString());

            string[] arr = str.Split(',');
            string   res = "";

            for (int i = 0; i < arr.Length; i++)
            {
                Lebi_Pro_Type model = B_Lebi_Pro_Type.GetModel("id = " + int.Parse(arr[i]) + " and IsShow = 1");
                if (model == null)
                {
                    continue;
                }
                res += Lang(model.Name);
                if (i < arr.Length - 1)
                {
                    res += " &raquo; ";
                }
            }
            return(res);
        }
Exemple #6
0
        public string tabname(int id)
        {
            Lebi_Pro_Type t = B_Lebi_Pro_Type.GetModel(id);

            if (t == null)
            {
                return("");
            }
            return(Language.Content(t.Name, CurrentLanguage.Code));
        }
Exemple #7
0
        /// <summary>
        /// 处理一个商品分类
        /// </summary>
        private Lebi_Pro_Type DoOneCategory(Lebi_Pro_Type t)
        {
            Lebi_Pro_Type model = B_Lebi_Pro_Type.GetModel("taobaoid='" + t.taobaoid + "'");

            if (model == null)
            {
                model = t;
                if (t.ProPerty131 != "")
                {
                    List <Lebi_ProPerty> ps131 = B_Lebi_ProPerty.GetList("taobaoid in (" + t.ProPerty131 + ")", "");
                    if (ps131 != null)
                    {
                        string pid131 = "";
                        foreach (Lebi_ProPerty p131 in ps131)
                        {
                            if (pid131 == "")
                            {
                                pid131 = p131.id.ToString();
                            }
                            else
                            {
                                pid131 += "," + p131.id.ToString();
                            };
                        }
                        model.ProPerty131 = pid131;
                    }
                }
                if (t.ProPerty132 != "")
                {
                    List <Lebi_ProPerty> ps132 = B_Lebi_ProPerty.GetList("taobaoid in (" + t.ProPerty132 + ")", "");
                    if (ps132 != null)
                    {
                        string pid132 = "";
                        foreach (Lebi_ProPerty p132 in ps132)
                        {
                            if (pid132 == "")
                            {
                                pid132 = p132.id.ToString();
                            }
                            else
                            {
                                pid132 += "," + p132.id.ToString();
                            };
                        }
                        model.ProPerty132 = pid132;
                    }
                }
                B_Lebi_Pro_Type.Add(model);
                model.id = B_Lebi_Pro_Type.GetMaxId();
            }
            return(model);
        }
Exemple #8
0
        public string CreateList(string key)
        {
            string str = "";

            List <Lebi_Pro_Type> types = B_Lebi_Pro_Type.GetList("Name like lbsql{'%" + key + "%'}", "Sort desc");

            //将根节点进行遍历
            foreach (Lebi_Pro_Type t in types)
            {
                string caozuo = "<a href=\"javascript:Edit(" + t.id + ",0)\">" + Tag("添加子类") + "</a> |  <a href=\"javascript:Edit(0," + t.id + ")\">" + Tag("编辑") + "</a>";
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    caozuo += " | <a href=\"javascript:DeleteConfirm(" + t.id + ")\">" + Tag("删除") + "</a>";
                    str    += "<tr name=\"tr" + t.Parentid + "\" id=\"tr" + t.id + "\">";
                    str    += "<td><label class=\"custom-control custom-checkbox\"><input type=\"checkbox\" id=\"check" + t.id + "\" name=\"id\" value=\"" + t.id + "\" class=\"custom-control-input\" del=\"del\"><span class=\"custom-control-label\"></span></label></td>";
                    str    += "<td>" + t.id + "</td>";
                    str    += "<td>";
                    if (t.ImageSmall != "")
                    {
                        str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                    }
                    str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><i class=\"ti-new-window\"></i></a></td>";
                    str += "<td><a href=\"default.aspx?Pro_Type_id=" + t.id + "&Type_id_ProductType=320,321,322,323\">" + EX_Product.TypeProductCount(t.id) + "</a></td>";
                    str += "<td>" + (t.IsShow == 1 ? "<span class=\"label label-success\">" + Tag("是") + "</span>" : "<span class=\"label label-danger\">" + Tag("否") + "</span>") + "</td>";
                    str += "<td>" + (t.IsIndexShow == 1 ? "<span class=\"label label-success\">" + Tag("是") + "</span>" : "<span class=\"label label-danger\">" + Tag("否") + "</span>") + "</td>";
                    str += "<td>" + t.Sort + "</td>";
                    str += "<td>" + caozuo + "</td></tr>";
                }
                else
                {
                    caozuo += " | <a href=\"javascript:Del(" + t.id + ")\">" + Tag("删除") + "</a>";
                    str    += "<tr class=\"list\" name=\"tr" + t.Parentid + "\" id=\"tr" + t.id + "\">";
                    str    += "<td style=\"text-align:center\"><input type='checkbox' id=\"check" + t.id + "\" value='" + t.id + "' name='id' del=\"del\" /></td>";
                    str    += "<td>" + t.id + "</td>";
                    str    += "<td>";
                    if (t.ImageSmall != "")
                    {
                        str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                    }
                    str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><i class=\"ti-new-window\"></i></a></td>";
                    str += "<td>" + LB.Tools.Utils.GetUnicodeSubString(ProPertystring(t.ProPerty132), 100, "...") + "</td>";
                    str += "<td>" + LB.Tools.Utils.GetUnicodeSubString(ProPertystring(t.ProPerty131), 100, "...") + "</td>";
                    str += "<td><a href=\"default.aspx?Pro_Type_id=" + t.id + "&Type_id_ProductType=320,321,322,323\">" + EX_Product.TypeProductCount(t.id) + "</a></td>";
                    str += "<td>" + t.Sort + "</td>";
                    str += "<td>" + (t.IsShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                    str += "<td>" + (t.IsIndexShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                    str += "<td>" + caozuo + "</td></tr>";
                }
                //CreateSunNode(int.Parse(ds.Tables[0].Rows[i]["id"].ToString()), ",0", ss);
            }
            return(str);
        }
        public string protypes(string ids)
        {
            string str = "";
            List<Lebi_Pro_Type> ts = B_Lebi_Pro_Type.GetList("Parentid=0", "Sort desc");
            foreach (Lebi_Pro_Type t in ts)
            {
                string sel = "";
                if (("," + ids + ",").Contains("," + t.id + ","))
                    sel = "checked";
                str += "<label><input type=\"checkbox\" name=\"Pro_Type_ids\" shop=\"true\" value=\"" + t.id + "\" " + sel + "/>" + Lang(t.Name) +"</label>";
            }

            return str;
        }
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            int id = Rint_Para("0");

            comment = B_Lebi_Comment.GetModel(id);
            if (comment.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            product      = GetProduct(comment.Keyid);
            string where = "Parentid =" + id;
            comments     = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Comment.Counts(where);

            PageString  = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id, pageindex, PageSize, recordCount, CurrentLanguage);
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
            pro_type = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type != null)
            {
                string[,] parr = Categorypath(pro_type.id);
                for (int i = 0; i <= parr.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                }
            }
            path += "<a href=\"" + URL("P_Product", product.id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em>";
            path += "<a><span>" + Tag("晒单") + "</span></a>";
            //path += "<a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a>";

            smalls = comment.ImagesSmall.Split('@');
            bigs   = comment.Images.Split('@');
            if (bigs.Count() > 1)
            {
                DefaultImage = bigs[1];
            }

            productcomments = B_Lebi_Comment.GetList("TableName='Product' and Keyid=" + comment.Keyid + " and id!=" + comment.id + "", "id desc", 5, 1);
        }
        /// <summary>
        ///  多站点选择
        /// </summary>
        /// <param name="InputName"></param>
        /// <param name="ids"></param>
        /// <param name="lang"></param>
        /// <returns></returns>
        public string Pro_TypeCheckbox(string InputName, string ids, string lang)
        {
            List <Lebi_Pro_Type> models = B_Lebi_Pro_Type.GetList("Parentid = 0", "Sort desc");
            string str = "";

            foreach (Lebi_Pro_Type model in models)
            {
                string sel = "";
                if (("," + ids + ",").IndexOf("," + model.id + ",") > -1)
                {
                    sel = "checked";
                }
                str += "<label><input type=\"checkbox\" name=\"" + InputName + "\" id=\"" + InputName + "\" shop=\"true\" value=\"" + model.id + "\" " + sel + ">" + Lang(model.Name) + "&nbsp;</label>";
            }
            return(str);
        }
Exemple #12
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            int id = Rint_Para("0");

            product = GetProduct(id);
            if (product.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            string where = "Parentid = 0 and TableName = 'Product' and (Keyid = " + id + "";
            if (product.Product_id != 0)
            {
                where += " or Product_id = " + product.Product_id + "";
            }
            where   += ") and (Status = 281 or User_id = " + CurrentUser.id + ")";
            comments = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Comment.Counts(where);

            PageString  = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id, pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage    = "?page=" + (pageindex + 1) + "&id=" + id + "";
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
            pro_type = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type != null)
            {
                string[,] parr = Categorypath(pro_type.id);
                for (int i = 0; i <= parr.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                }
            }
            path += "<a href=\"" + URL("P_Product", product.id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em>";
            path += "<a><span>" + Tag("商品评论") + "</span></a>";
        }
Exemple #13
0
        public void LoadPage()
        {
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Product'");
            int id = Rint("id");

            product = EX_Product.GetProduct(id);
            if (product.id == 0)
            {
                Response.End();
            }
            Protype = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            GetProWords();
            supplier = B_Lebi_Supplier.GetModel(product.Supplier_id);
            if (supplier == null)
            {
                supplier = new Lebi_Supplier();
            }
            product.IsSupplierTransport = supplier.IsSupplierTransport;
        }
Exemple #14
0
        /// <summary>
        /// 代金券限制信息
        /// </summary>
        /// <param name="card"></param>
        /// <returns></returns>
        public string cardinfo(Lebi_Card card)
        {
            string str = "";

            if (card.Money_Buy > 0)
            {
                str  = Tag("最低消费") + ":";
                str += FormatMoney(card.Money_Buy);
            }
            if (card.Pro_Type_ids != "")
            {
                str += "&nbsp;&nbsp;" + Tag("限品类") + ":";
                List <Lebi_Pro_Type> ts = B_Lebi_Pro_Type.GetList("id in (" + card.Pro_Type_ids + ")", "");
                foreach (Lebi_Pro_Type t in ts)
                {
                    str += Lang(t.Name);
                }
            }
            return(str);
        }
Exemple #15
0
        /// <summary>
        /// 生成商品分类选择框
        /// </summary>
        public void GetProductTypeList()
        {
            int id       = RequestTool.RequestInt("id", 0);
            int Parentid = 0;
            List <Lebi_Pro_Type> models = B_Lebi_Pro_Type.GetList("Parentid=" + id + "", "Sort desc");
            Lebi_Pro_Type        area   = B_Lebi_Pro_Type.GetModel(id);

            if (models.Count == 0)
            {
                if (area == null)
                {
                    Parentid = 0;
                }
                else
                {
                    Parentid = area.Parentid;
                }
                models = B_Lebi_Pro_Type.GetList("Parentid=" + Parentid + "", "Sort desc");
            }
            else
            {
                Parentid = id;
            }
            string str = "<select id=\"Pro_Type_id\" name=\"Pro_Type_id\" shop=\"true\" onchange=\"SelectProductType('Pro_Type_id');\">";

            str += "<option value=\"0\" selected>" + Tag(" 请选择 ") + "</option>";
            foreach (Lebi_Pro_Type model in models)
            {
                if (id == model.id)
                {
                    str += "<option value=\"" + model.id + "\" selected>" + Lang(model.Name) + "</option>";
                }
                else
                {
                    str += "<option value=\"" + model.id + "\">" + Lang(model.Name) + "</option>";
                }
            }
            str += "</select>";
            str  = CreateProductTypeSelect(Parentid) + str;
            Response.Write(str);
        }
Exemple #16
0
        public string ThreadGetProductTypeList(int id, int Parentid)
        {
            List <Lebi_Pro_Type> models = B_Lebi_Pro_Type.GetList("Parentid=" + id + "", "Sort desc");
            Lebi_Pro_Type        area   = B_Lebi_Pro_Type.GetModel(id);

            if (models.Count == 0)
            {
                if (area == null)
                {
                    Parentid = 0;
                }
                else
                {
                    Parentid = area.Parentid;
                }
                models = B_Lebi_Pro_Type.GetList("Parentid=" + Parentid + "", "Sort desc");
            }
            else
            {
                Parentid = id;
            }
            string str = "<select id=\"Pro_Type_id\" name=\"Pro_Type_id\" shop=\"true\" onchange=\"SelectProductType('Pro_Type_id');\" class=\"form-control\">";

            str += "<option value=\"0\" selected>" + Tag(" 请选择 ") + "</option>";
            foreach (Lebi_Pro_Type model in models)
            {
                if (id == model.id)
                {
                    str += "<option value=\"" + model.id + "\" selected>" + Lang(model.Name) + "</option>";
                }
                else
                {
                    str += "<option value=\"" + model.id + "\">" + Lang(model.Name) + "</option>";
                }
            }
            str += "</select>";
            str  = CreateProductTypeSelect(Parentid) + str;
            return(str);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (id == 0)
            {
                if (!EX_Admin.Power("pro_type_add", "添加商品分类"))
                {
                    PageNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("pro_type_edit", "编辑商品分类"))
                {
                    PageNoPower();
                }
            }
            int pid = RequestTool.RequestInt("pid", 0);

            model = B_Lebi_Pro_Type.GetModel(id);
            if (model == null)
            {
                model             = new Lebi_Pro_Type();
                model.IsIndexShow = 1;
                model.IsShow      = 1;
                model.Site_ids    = site.Sitesid();
            }
            else
            {
                pid = model.Parentid;
            }
            pmodel = B_Lebi_Pro_Type.GetModel(pid);
            if (pmodel == null)
            {
                pmodel = new Lebi_Pro_Type();
            }
        }
Exemple #18
0
        /// <summary>
        ///  管理分类选择
        /// </summary>
        /// <param name="InputName"></param>
        /// <param name="ids"></param>
        /// <param name="lang"></param>
        /// <returns></returns>
        public string Pro_TypeCheckbox(string InputName, string ids, string lang)
        {
            List <Lebi_Pro_Type> models = B_Lebi_Pro_Type.GetList("Parentid = 0", "Sort desc");
            string str = "";

            foreach (Lebi_Pro_Type model in models)
            {
                string sel = "";
                if (("," + ids + ",").IndexOf("," + model.id + ",") > -1)
                {
                    sel = "checked";
                }
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    str += "<label class=\"custom-control custom-checkbox m-r-20\"><input type=\"checkbox\" id=\"" + InputName + "" + model.id + "\" name=\"" + InputName + "\" value=\"" + model.id + "\" class=\"custom-control-input\" shop=\"true\" " + sel + "><span class=\"custom-control-label\">" + Lang(model.Name) + "</span></label>";
                }
                else
                {
                    str += "<label><input type=\"checkbox\" name=\"" + InputName + "\" id=\"" + InputName + "\" shop=\"true\" value=\"" + model.id + "\" " + sel + ">" + Lang(model.Name) + "&nbsp;</label>";
                }
            }
            return(str);
        }
Exemple #19
0
        /// <summary>
        /// 生成分类列表
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="deep"></param>
        /// <returns></returns>
        public void CreateTree()
        {
            int    pid  = RequestTool.RequestInt("pid");
            int    deep = RequestTool.RequestInt("deep");
            string str  = "";
            //的道所有的更节点
            // List<Lebi_Pro_Type> types = B_Lebi_Pro_Type.GetList("Parentid=" + pid + "", "Sort desc");
            List <Lebi_Pro_Type> types = EX_Product.Types(pid);
            //将根节点进行遍历
            string style = "";

            foreach (Lebi_Pro_Type t in types)
            {
                int count = B_Lebi_Pro_Type.Counts("Parentid=" + t.id + "");
                str += "<tr class=\"list\" name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                str += "<td>" + deepstr(deep);
                if (count > 0)
                {
                    str += "<img src=\"" + AdminImage("plus.gif") + "\" name=\"img" + t.Parentid + "\" id=\"img" + t.id + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" onclick=\"ShowChild('" + findpath(t.id) + "'," + t.id + "," + (deep + 1) + ")\" title=\"" + Tag("展开") + "\" />&nbsp;&nbsp;";
                }
                else
                {
                    str += "<img src=\"" + AdminImage("minus.gif") + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" />&nbsp;&nbsp;";
                }
                if (t.ImageSmall != "")
                {
                    str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                }
                str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><img src=\"" + PageImage("icon/newWindow.png") + "\" style=\"vertical-align:absmiddle\" /></a></td>";
                str += "<td>" + Shop.Bussiness.EX_Product.TypeProductCount(t.id) + "</td>";
                str += "<td>" + Shop.Bussiness.EX_Product.LikeProductCount(t.id) + "</td>";
                str += "<td>" + Shop.Bussiness.EX_Product.SalesProductCount(t.id) + "</td>";
                str += "<td>" + Shop.Bussiness.EX_Product.ViewsProductCount(t.id) + "</td>";
                str += "</tr>";
            }
            Response.Write(str);
        }
Exemple #20
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            int id = Rint_Para("0");

            product = GetProduct(id);
            if (product.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            pro_type = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type != null)
            {
                string[,] parr = Categorypath(pro_type.id);
                for (int i = 0; i <= parr.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                }
            }
            path += "<a href=\"" + URL("P_Product", product.id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em>";
            path += "<a><span>" + Tag("商品咨询") + "</span></a>";
        }
Exemple #21
0
        public string protypes(string ids)
        {
            string str = "";
            List <Lebi_Pro_Type> ts = B_Lebi_Pro_Type.GetList("Parentid=0", "Sort desc");

            foreach (Lebi_Pro_Type t in ts)
            {
                string sel = "";
                if (("," + ids + ",").Contains("," + t.id + ","))
                {
                    sel = "checked";
                }
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    str += "<label class=\"custom-control custom-checkbox m-r-20\"><input type=\"checkbox\" id=\"Pro_Type_ids" + t.id + "\" name=\"Pro_Type_ids\" value=\"" + t.id + "\" class=\"custom-control-input\" shop=\"true\" " + sel + "><span class=\"custom-control-label\">" + Lang(t.Name) + "</span></label>";
                }
                else
                {
                    str += "<label><input type=\"checkbox\" name=\"Pro_Type_ids\" shop=\"true\" value=\"" + t.id + "\" " + sel + "/>" + Lang(t.Name) + "</label>";
                }
            }

            return(str);
        }
Exemple #22
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            pageindex = RequestTool.RequestInt("page", 1);
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Product'");
            int id = Rint_Para("0");

            product = EX_Product.GetProduct(id);
            if (product.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            int num = 0;
            int Count_Views_Show = 0;

            if (SYS.ClickFlag == "0")
            {
                int.TryParse(SYS.ClickNum1, out num);
                Count_Views_Show = num;
            }
            else
            {
                int.TryParse(SYS.ClickNum2, out num);
                Random r = new Random();
                int    c = r.Next(1, num);
                Count_Views_Show = c;
            }
            string sql = "update [Lebi_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where id=" + id + "";

            Common.ExecuteSql(sql);
            if (product.Product_id > 0)
            {
                sql = "update [Lebi_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where Product_id=" + product.Product_id + "";
                Common.ExecuteSql(sql);
            }
            int DT_id = ShopPage.GetDT();

            if (DT_id > 0)
            {
                sql = "update [Lebi_DT_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where DT_id = " + DT_id + " and Product_id=" + id + "";
                Common.ExecuteSql(sql);
                if (product.Product_id > 0)
                {
                    Common.ExecuteSql("update [Lebi_DT_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where DT_id = " + DT_id + " and Product_id=" + product.Product_id + "");
                }
            }
            Protype = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            images  = EX_Product.ProductImages(product, CurrentTheme);
            //===============================================================
            //处理规格选项
            //ProductProperty = Get_guige(product);
            //处理规格选项结束
            //==================================================================


            //添加访问记录
            int Product_id = product.Product_id == 0 ? product.id : product.Product_id;

            EX_User.UserProduct_Edit(CurrentUser, Product_id, 1, 143, "", 0, "");
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (product.Type_id_ProductType == 321)
            {
                path += "<a href=\"" + URL("P_LimitBuy", "") + "\"><span>" + Tag("限时抢购") + "</span></a><em>&raquo;</em>";
            }
            else if (product.Type_id_ProductType == 322)
            {
                path += "<a href=\"" + URL("P_GroupPurchase", "") + "\"><span>" + Tag("团购") + "</span></a><em>&raquo;</em>";
            }
            else if (product.Type_id_ProductType == 323)
            {
                path += "<a href=\"" + URL("P_Exchange", "") + "\"><span>" + Tag("积分换购") + "</span></a><em>&raquo;</em>";
            }
            else
            {
                if (Protype != null)
                {
                    string[,] parr = Categorypath(Protype.id);
                    for (int i = 0; i <= parr.GetUpperBound(0); i++)
                    {
                        path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                    }
                }
            }
            path += "<a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a>";


            GetProWords();
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
        }
Exemple #23
0
        /// <summary>
        /// 处理添加一个商品
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        private Lebi_Product DoOneProduct(Lebi_Product pro)
        {
            Lebi_Pro_Type t   = new Lebi_Pro_Type();
            string        ids = pro.taobaoid_type;

            if (ids != "")
            {
                ids = "'0" + ids.Replace(",", "','") + "0'";
                List <Lebi_Pro_Type> models = B_Lebi_Pro_Type.GetList("taobaoid in (lbsql{" + ids + "})", "");
                t = models.FirstOrDefault();
            }

            if (t == null)
            {
                t = new Lebi_Pro_Type();
            }
            string p131ids = pro.ProPerty131;
            string p132ids = pro.ProPerty132;

            if (p131ids != "")
            {
                p131ids = "'" + p131ids.Replace(",", "','") + "'";
                List <Lebi_ProPerty> p131s = B_Lebi_ProPerty.GetList("taobaoid in (" + p131ids + ")", "");
                p131ids = "";
                foreach (Lebi_ProPerty p in p131s)
                {
                    if (p131ids == "")
                    {
                        p131ids = p.id.ToString();
                    }
                    else
                    {
                        p131ids += "," + p.id.ToString();
                    }
                }
            }
            if (p132ids != "")
            {
                p132ids = "'" + p132ids.Replace(",", "','") + "'";
                List <Lebi_ProPerty> p132s = B_Lebi_ProPerty.GetList("taobaoid in (" + p132ids + ")", "");
                p132ids = "";
                foreach (Lebi_ProPerty p in p132s)
                {
                    if (p132ids == "")
                    {
                        p132ids = p.id.ToString();
                    }
                    else
                    {
                        p132ids += "," + p.id.ToString();
                    }
                }
            }
            pro.ProPerty131 = p131ids;
            pro.ProPerty132 = p132ids;
            pro.Pro_Type_id = t.id;
            B_Lebi_Product.Add(pro);
            pro.id = B_Lebi_Product.GetMaxId();

            return(pro);
        }
Exemple #24
0
        public string CreateTree(int pid, int deep)
        {
            string str = "";
            //的道所有的更节点
            // List<Lebi_Pro_Type> types = B_Lebi_Pro_Type.GetList("Parentid=" + pid + "", "Sort desc");
            List <Lebi_Pro_Type> types = EX_Product.Types(pid);
            //将根节点进行遍历
            string style = "";

            if (deep > 0)
            {
                style = "style=\"display:none;\"";
            }
            string showids = Shop.Tools.CookieTool.GetCookieString("showTypeids").Replace("%2C", ",");
            string image   = "";

            foreach (Lebi_Pro_Type t in types)
            {
                image = AdminImage("plus.gif");
                bool showson = false;
                if (showids.Contains("," + t.id + ",") || showids.Contains("," + t.Parentid + ","))
                {
                    style = "";
                }
                if (showids.Contains("," + t.id + ","))
                {
                    image   = AdminImage("minus.gif");
                    showson = true;
                }
                int count = B_Lebi_Pro_Type.Counts("Parentid=" + t.id + "");
                //隐藏规则
                //name = "<input type=\"hidden\" value=\"" + 1 + "\" /><input type=\"hidden\" value=\"" + ds.Tables[0].Rows[i]["pid"] + "\" /> <input type=\"hidden\" value=\"" + ds.Tables[0].Rows[i]["id"] + "\" /><input type=\"hidden\" value=\"," + ds.Tables[0].Rows[i]["pid"] + ",\" />";
                //操作
                string caozuo = "<a href=\"javascript:Edit(" + t.id + ",0)\">" + Tag("添加子类") + "</a> |  <a href=\"javascript:Edit(0," + t.id + ")\">" + Tag("编辑") + "</a> | <a href=\"javascript:Del(" + t.id + ")\">" + Tag("删除") + "</a>";

                //str += "<tr onclick='javascript:selectrow(\"check" + t.id + "\");' name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                str += "<tr class=\"list\" ondblclick=\"Edit(0," + t.id + ")\" name=\"tr" + t.Parentid + "\" " + style + " id=\"tr" + t.id + "\">";
                str += "<td style=\"text-align:center\"><input type='checkbox' id=\"check" + t.id + "\" value='" + t.id + "' name='id' del=\"del\" /></td>";
                str += "<td>" + t.id + "</td>";
                str += "<td>" + deepstr(deep);
                if (count > 0)
                {
                    str += "<img src=\"" + image + "\" name=\"img" + t.Parentid + "\" id=\"img" + t.id + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" onclick=\"ShowProductTypeChild('" + findpath(t.id) + "'," + t.id + "," + (deep + 1) + ")\" title=\"" + Tag("展开") + "\" />&nbsp;&nbsp;";
                }
                else
                {
                    str += "<img src=\"" + AdminImage("minus.gif") + "\" style=\"cursor: pointer; text-align: center; vertical-align:absmiddle\" />&nbsp;&nbsp;";
                }
                if (t.ImageSmall != "")
                {
                    str += "<img src=\"" + t.ImageSmall + "\" height=\"16\" />&nbsp;";
                }
                str += Language.Content(t.Name, CurrentLanguage.Code) + "&nbsp;<a href=\"" + Shop.Bussiness.ThemeUrl.GetURL("P_ProductCategory", t.id.ToString(), "", CurrentLanguage.Code) + "\" target=\"_blank\"><img src=\"" + PageImage("icon/newWindow.png") + "\" style=\"vertical-align:absmiddle\" /></a></td>";

                str += "<td>" + Shop.Tools.Utils.GetUnicodeSubString(shuxinglianjie(ProPertystring(t.ProPerty132), ProPertystring(t.ProPerty133)), 100, "...") + "</td>";
                str += "<td>" + Shop.Tools.Utils.GetUnicodeSubString(ProPertystring(t.ProPerty131), 100, "...") + "</td>";

                str += "<td><a href=\"default.aspx?Pro_Type_id=" + t.id + "&Type_id_ProductType=320,321,322,323\">" + EX_Product.TypeProductCount(t.id) + "</a></td>";
                str += "<td>" + t.Sort + "</td>";
                str += "<td>" + (t.IsShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                str += "<td>" + (t.IsIndexShow == 1 ? "" + Tag("是") + "" : "" + Tag("否") + "") + "</td>";
                str += "<td>" + caozuo + "</td></tr>";
                if (showson)
                {
                    str += CreateTree(t.id, deep + 1);
                }
                //CreateSunNode(int.Parse(ds.Tables[0].Rows[i]["id"].ToString()), ",0", ss);
            }
            return(str);
        }
Exemple #25
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            id        = Rint_Para("0");    //商品分类
            pid       = Rint_Para("1");    //品牌
            cid       = Rstring_Para("2"); //属性
            list      = Rstring_Para("3"); //列表或网格
            sort      = Rstring_Para("4"); //排序
            tid       = Rint_Para("5");    //商品标签
            transport = Rint_Para("7");    //配送 0全部 1商城 2商家
            stock     = Rint_Para("8");    //是否有库存 1只显示有货
            pageindex = RequestTool.RequestInt("page", 1);
            keyword   = Rstring("keyword");
            pro_type  = B_Lebi_Pro_Type.GetModel(id);
            if (pro_type == null)
            {
                pro_type = new Lebi_Pro_Type();
            }
            if (Lang(pro_type.Url) != "")  //如果存在自定义URL 跳转至自定义URL by kingdge 2014-10-30
            {
                Response.Redirect(Lang(pro_type.Url));
                Response.End();
                return;
            }
            property = EX_Product.ProductType_ProPerty(pro_type);
            if (property == null)
            {
                property = new Lebi_Pro_Type(); property.ProPerty132 = "0";
            }
            if (property.ProPerty132 == "")
            {
                property.ProPerty132 = "0";
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type.id > 0)
            {
                CategoryPath = Categorypath(id);
                for (int i = 0; i <= CategoryPath.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + CategoryPath[i, 0] + "", CategoryPath[i, 2]) + "\"><span>" + CategoryPath[i, 1] + "</span></a>";
                    if (i < CategoryPath.GetUpperBound(0))
                    {
                        path += "<em>&raquo;</em>";
                    }
                }
            }
            else if (tid == 0)
            {
                path += "<a href=\"" + URL("P_ProductCategory", "0") + "\"><span>" + Tag("商品列表") + "</span></a>";
            }
            if (tid > 0)
            {
                tag = B_Lebi_Pro_Tag.GetModel(tid);
                if (tag != null)
                {
                    path += "<em>&raquo;</em><a href=\"" + URL("P_ProductCategory", "" + id + ",$,$,$,$," + tid + "") + "\"><span>" + Lang(tag.Name) + "</span></a>";
                }
            }
            where = ProductWhere + " and Type_id_ProductType <> 323";
            if (pid > 0)
            {
                where += " and Brand_id=" + pid + "";
                brand  = B_Lebi_Brand.GetModel(pid);
                path  += "<em>&raquo;</em><a href=\"" + URL("P_ProductCategory", "" + id + "," + pid + ",$,$,$,$") + "\"><span>" + Lang(brand.Name) + "</span></a>";
            }
            if (cid != "")
            {
                where += " and " + Categorywhere(cid);
                string _cidlast = "";
                if (cid.IndexOf("$") > -1)
                {
                    string[] cidarr = cid.Split('$');
                    for (int i = 0; i < cidarr.Count(); i++)
                    {
                        if (cidarr[i].IndexOf("|") > -1)
                        {
                            string[] _cids = cidarr[i].Split('|');
                            _cidlast = _cids[1];
                            Lebi_ProPerty ProPerty = B_Lebi_ProPerty.GetModel(int.Parse(_cidlast));
                            if (ProPerty != null)
                            {
                                path += "<em>&raquo;</em><a href=\"" + URL("P_ProductCategory", "" + id + "," + pid + "," + ProPerty.parentid + "|" + ProPerty.id + ",$,$,$") + "\"><span>" + Lang(ProPerty.Name) + "</span></a>";
                            }
                        }
                    }
                }
                else
                {
                    if (cid.IndexOf("|") > -1)
                    {
                        string[] _cids = cid.Split('|');
                        _cidlast = _cids[1];
                        Lebi_ProPerty ProPerty = B_Lebi_ProPerty.GetModel(int.Parse(_cidlast));
                        if (ProPerty != null)
                        {
                            path += "<em>&raquo;</em><a href=\"" + URL("P_ProductCategory", "" + id + "," + pid + "," + ProPerty.parentid + "|" + ProPerty.id + ",$,$,$") + "\"><span>" + Lang(ProPerty.Name) + "</span></a>";
                        }
                    }
                }
            }
            if (id > 0)
            {
                where += " and " + CategoryWhere(id);
                //where += " and (Pro_Type_id in (" + Categorywhereforid(id) + ")";
                //if (DataBase.DBType == "sqlserver")
                //{
                //    where += " or Charindex('," + id + ",',','+Pro_Type_id_other+',')>0)";
                //}
                //if (DataBase.DBType == "access")
                //{
                //    where += " or Instr(','+Pro_Type_id_other+',','," + id + ",')>0)";
                //}
            }
            if (tid > 0)
            {
                if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "sqlserver")
                {
                    where += " and Charindex('," + tid + ",',','+Pro_Tag_id+',')>0";
                }
                else if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "access")
                {
                    where += " and Instr(','+Pro_Tag_id+',','," + tid + ",')>0";
                }
                else if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "mysql")
                {
                    where += " and Instr(','+Pro_Tag_id+',','," + tid + ",')>0";
                }
            }
            if (transport == 1)
            {
                where += " and IsSupplierTransport  = 0";
            }
            else if (transport == 2)
            {
                where += " and IsSupplierTransport  = 1";
            }
            if (stock == 1)
            {
                where += " and Count_Stock > 0";
            }
            if (keyword != "")
            {
                //增加空格划词搜索 by kingdge 2013-09-18
                string wherekeyword = "";
                if (keyword.IndexOf(" ") > -1)
                {
                    string[] keywordsArr;
                    keywordsArr = keyword.Split(new char[1] {
                        ' '
                    });
                    foreach (string keywords in keywordsArr)
                    {
                        if (keywords != "")
                        {
                            if (wherekeyword == "")
                            {
                                wherekeyword = "Name like lbsql{'%" + keywords + "%'}";
                            }
                            else
                            {
                                wherekeyword += " and Name like lbsql{'%" + keywords + "%'}";
                            }
                        }
                    }
                }
                else
                {
                    wherekeyword = "Name like lbsql{'%" + keyword + "%'}";
                }
                where += " and ((" + wherekeyword + ") or Number like lbsql{'%" + keyword + "%'} or Code like lbsql{'%" + keyword + "%'})";
            }

            if (sort == "1")
            {
                order = " Count_Sales_Show desc"; ordertmp = "a";
            }
            else if (sort == "1a")
            {
                order = " Count_Sales_Show asc"; ordertmp = "";
            }
            else if (sort == "2")
            {
                order = " Price desc"; ordertmp = "a";
            }
            else if (sort == "2a")
            {
                order = " Price asc"; ordertmp = "";
            }
            else if (sort == "3")
            {
                order = " Count_Comment desc"; ordertmp = "a";
            }
            else if (sort == "3a")
            {
                order = " Count_Comment asc"; ordertmp = "";
            }
            else if (sort == "4")
            {
                order = " Time_Add desc"; ordertmp = "a";
            }
            else if (sort == "4a")
            {
                order = " Time_Add asc"; ordertmp = "";
            }
            else if (sort == "5")
            {
                order = " Count_Views_Show desc"; ordertmp = "a";
            }
            else if (sort == "5a")
            {
                order = " Count_Views_Show asc"; ordertmp = "";
            }
            else if (sort == "6")
            {
                order = " Count_Stock desc"; ordertmp = "a";
            }
            else if (sort == "6a")
            {
                order = " Count_Stock asc"; ordertmp = "";
            }
            else
            {
                order = " Sort desc,id desc"; ordertmp = "";
            }
            products    = B_Lebi_Product.GetList(where, order, PageSize, pageindex);
            recordCount = B_Lebi_Product.Counts(where);
            //id={0}&pid={1}&cid={2}&list={3}&sort={4}&tid={5}&page={6}
            string url = URL("P_ProductCategory", id + "," + pid + "," + cid + "," + list + "," + sort + "," + tid + ",{0}," + transport + "," + stock + "," + keyword + "", Lang(pro_type.Url));

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage = URL("P_ProductCategory", id + "," + pid + "," + cid + "," + list + "," + sort + "," + tid + "," + (pageindex + 1) + "," + transport + "," + stock + "," + keyword + "", Lang(pro_type.Url));
        }