Esempio n. 1
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_LimitBuy'");
            list = Rstring_Para("0");
            sort = Rstring_Para("1");
            pageindex = RequestTool.RequestInt("page", 1);
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a class=\"text\"><span>" + Tag("限时抢购") + "</span></a>";
            where = ProductWhere + " and Type_id_ProductType = 321";
            if (sort == "1") { order = " Count_Sales desc"; ordertmp = "a"; }
            else if (sort == "1a") { order = " Count_Sales 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 = " Count_Sales desc"; ordertmp = "a"; }
            products = B_Lebi_Product.GetList(where, order, PageSize, pageindex);
            recordCount = B_Lebi_Product.Counts(where);

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple("?page={0}&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage = "?page=" + (pageindex + 1) + "&sort=" + sort + "&list=" + list + "";
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_edit", "编辑商品"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel(id);
            int          SonCount = B_Lebi_Product.Counts("Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "a.Product_id = " + pro.id;
            }
            else
            {
                sql = "a.Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where " + sql + " and (a.Count - a.Count_Shipped)!=0 and b.IsInvalid = 0 and b.IsCompleted = 0 and b.Type_id_OrderType = 211";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }
            //where += " and IsShipped=0";
            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Esempio n. 3
0
        /// <summary>
        /// 下载商品
        /// </summary>
        public void Taobao_Product()
        {
            List <Lebi_Product> ps = Shop.LebiAPI.Service.Instanse.Taobao_Product();

            if (ps == null)
            {
                Response.Write("{\"msg\":\"系统异常\"}");
            }
            else
            {
                List <Lebi_Product> parents = (from m in ps
                                               where m.Product_id == 0
                                               select m).ToList();
                foreach (Lebi_Product p in parents)
                {
                    if (B_Lebi_Product.Counts("taobaoid='" + p.taobaoid + "'") == 0)
                    {
                        int                 pid   = p.id;
                        Lebi_Product        model = DoOneProduct(p);
                        List <Lebi_Product> sons  = (from m in ps
                                                     where m.Product_id == pid
                                                     select m).ToList();
                        foreach (Lebi_Product son in sons)
                        {
                            son.Product_id = model.id;
                            DoOneProduct(son);
                        }
                    }
                }
                Response.Write("{\"msg\":\"OK\"}");
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userlevelid = RequestTool.RequestInt("userlevelid");
            userid      = RequestTool.RequestInt("userid");
            typeid      = RequestTool.RequestInt("typeid");
            showall     = RequestTool.RequestInt("showall");
            key         = RequestTool.RequestString("key");
            user        = B_Lebi_User.GetModel(userid);
            userlevel   = B_Lebi_UserLevel.GetModel(userlevelid);
            if (user == null)
            {
                user = new Lebi_User();
            }
            if (userlevel == null)
            {
                userlevel = new Lebi_UserLevel();
            }
            string where = "Product_id=0 and (IsDel!=1 or IsDel is null)";
            if (key != "")
            {
                where += " and (Name like '%" + key + "%' or Number like '%" + key + "%' or Code like '%" + key + "%')";
            }
            if (typeid > 0)
            {
                string tids = EX_Product.TypeIds(typeid);
                where += " and Pro_Type_id in (" + tids + ")";
            }

            PageSize = RequestTool.getpageSize(10);
            int recordCount = B_Lebi_Product.Counts(where);

            PageString = Pager.GetPaginationStringForJS("reloadproducts({0}," + typeid + ",'" + key + "'," + user.id + "," + userlevel.id + ");", page, PageSize, recordCount);
            products   = B_Lebi_Product.GetList(where, "", PageSize, page);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_product_list", "商品列表"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            int          SonCount = B_Lebi_Product.Counts("Supplier_id = " + CurrentSupplier.id + " and Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "Product_id = " + pro.id;
            }
            else
            {
                sql = "Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where b.Supplier_id = " + CurrentSupplier.id + " and " + sql + " and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }

            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Esempio n. 6
0
        /// <summary>
        /// 要生成的商品的数据
        /// </summary>
        /// <returns></returns>
        public int P_Product_Count()
        {
            string   ids   = RequestTool.RequestString("Pro_Type_id");
            DateTime time1 = RequestTool.RequestTime("time1");
            DateTime time2 = RequestTool.RequestTime("time2");
            int      c     = B_Lebi_Product.Counts("Pro_Type_id in (lbsql{" + ids + "}) and Time_Add>='" + time1 + "' and Time_Add<='" + time2 + "'");

            return(c);
        }
Esempio n. 7
0
        /// <summary>
        /// 商品页面
        /// </summary>
        /// <param name="lang"></param>
        /// <param name="model"></param>
        /// <param name="theme"></param>
        /// <param name="urlpath"></param>
        private void P_Product(List <Lebi_Language> langs, Lebi_Theme_Page page, string urlpath)
        {
            string   url;
            string   ids   = RequestTool.RequestString("Pro_Type_id");
            DateTime time1 = RequestTool.RequestTime("time1");
            DateTime time2 = RequestTool.RequestTime("time2");

            string file      = "";
            int    pageindex = RequestTool.RequestInt("pageindex", 0);
            int    pagesize  = RequestTool.RequestInt("pagesize", 0);

            string where = "Time_Add>='" + time1 + "' and Time_Add<='" + time2 + "'";
            if (ids != "")
            {
                where += " and Pro_Type_id in (lbsql{" + ids + "})";
            }
            List <Lebi_Product> models = B_Lebi_Product.GetList(where, "", pagesize, pageindex);
            int count     = B_Lebi_Product.Counts(where);
            int pagecount = Pager.GetPageCount(pagesize, count);
            int per       = 100;

            if (pagecount > 0)
            {
                per = Convert.ToInt32(pageindex * 100 / pagecount);
            }
            List <Lebi_Site> sites = GetSites();
            Lebi_Site        site;

            foreach (Lebi_Product model in models)
            {
                foreach (Lebi_Language lang in langs)
                {
                    site = GetSite(sites, lang.Site_id);
                    file = site.Path + "/" + lang.Path + "/" + page.StaticPath + "/" + page.StaticPageName;
                    file = file.Replace("{0}", model.id.ToString());
                    file = RegexTool.ReplaceRegValue(file, @"{.*?}", "");
                    file = ThemeUrl.CheckPath(file);

                    url = page.PageName + "?" + page.PageParameter;
                    url = url.Replace("{0}", model.id.ToString());
                    url = urlpath + "/" + site.Path + "/" + lang.Path + "/" + url;
                    url = RegexTool.ReplaceRegValue(url, @"{.*?}", "");
                    url = ThemeUrl.CheckURL(url);
                    try
                    {
                        HtmlEngine.Instance.CreatHtml(url, file);
                    }
                    catch (System.Net.WebException)
                    {
                        //Log.Add(url + "---------" + file);
                        continue;
                    }
                }
            }
            Response.Write("{\"msg\":\"OK\",\"per\":\"" + per + "\"}");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_edit", "编辑商品"))
            {
                WindowNoPower();
            }
            Number = RequestTool.RequestString("Number");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel("Number = lbsql{'" + Number + "'}");
            int          SonCount = B_Lebi_Product.Counts("Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "Product_Number = lbsql{'" + Number + "'}";
            }
            else
            {
                sql = "Product_Number in (select Lebi_Product.Number from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            pros = B_Lebi_Order_Product.GetList("" + sql + " and Order_id in(select Lebi_Order.id from Lebi_Order where Lebi_Order_Product.Order_id = Lebi_Order.id and Lebi_Order.Type_id_OrderType=211 and Lebi_Order.IsCompleted = 1)", "");
        }
Esempio n. 9
0
 public static int TypeProductCount(int supplier_id, int id)
 {
     string where = "Product_id=0 and Supplier_id = " + supplier_id + "";
     if (id > 0)
     {
         if (DataBase.DBType == "sqlserver")
         {
             where += " and Charindex('," + id + ",',','+Supplier_ProductType_ids+',')>0";
         }
         if (DataBase.DBType == "access")
         {
             where += " and Instr(','+Supplier_ProductType_ids+',','," + id + ",')>0";
         }
     }
     else
     {
         where += " and Supplier_ProductType_ids = ''";
     }
     return(B_Lebi_Product.Counts(where));
     //return TypeIds(id);
 }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_list", "商品列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            sp                  = new SearchProduct(CurrentAdmin, CurrentLanguage.Code);
            PageSize            = RequestTool.getpageSize(25);
            key                 = RequestTool.RequestString("key");
            Type_id_ProductType = RequestTool.RequestInt("Type_id_ProductType", 320);
            //Pro_Type_id = RequestTool.RequestString("Pro_Type_id");
            //status = RequestTool.RequestInt("status", 0);
            //brand = RequestTool.RequestInt("brand", 0);
            //tag = RequestTool.RequestInt("tag", 0);
            //dateFrom = RequestTool.RequestString("dateFrom");
            //dateTo = RequestTool.RequestString("dateTo");
            OrderBy = RequestTool.RequestString("OrderBy");
            //lang = RequestTool.RequestString("lang");
            //if (lang == "")
            //    lang = "CN";
            string where = "Product_id=0 and (IsDel!=1 or IsDel is null)";
            //if (Pro_Type_id != "")
            //    where += " and Pro_Type_id in (" + Shop.Bussiness.EX_Product.Categoryid(Pro_Type_id) + ")";
            //if (status > 0)
            //    where += " and Type_id_ProductStatus=" + status + "";
            //if (tag > 0)
            //    where += " and Pro_Tag_id=" + tag + "";
            //if (brand > 0)
            //    where += " and Brand_id=" + brand + "";
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'} or id like lbsql{'%" + key + "%'})";
            }
            //if (dateFrom != "" && dateTo != "")
            //    where += " and (datediff(d,Time_Add,'" + dateFrom + "')<=0 and datediff(d,Time_Add,'" + dateTo + "')>=0)";

            where += sp.SQL;
            if (domain3admin && CurrentAdmin.Site_ids != "")
            {
                string[] arr      = CurrentAdmin.Site_ids.Split(',');
                string   sonwhere = "";
                foreach (string sid in arr)
                {
                    if (sonwhere == "")
                    {
                        sonwhere = "','+Site_ids+',' like '%," + sid + ",%'";
                    }
                    else
                    {
                        sonwhere += " or ','+Site_ids+',' like '%," + sid + ",%'";
                    }
                }
                where += " and (" + sonwhere + " or Site_ids='')";
            }
            if (CurrentAdmin.Pro_Type_ids != "")
            {
                string[] ids      = CurrentAdmin.Pro_Type_ids.Split(',');
                string   sonwhere = "";
                foreach (string id in ids)
                {
                    sonwhere += " or Path like '%," + id + ",%'";
                }
                sonwhere = "select id from Lebi_Pro_Type where id in (" + CurrentAdmin.Pro_Type_ids + ")" + sonwhere;
                where   += " and (Pro_Type_id in (" + sonwhere + ") or Pro_Type_id=0)";
            }
            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " Count_Stock desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " Count_Stock asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else if (OrderBy == "SortDesc")
            {
                orderstr = " Sort desc";
            }
            else if (OrderBy == "SortAsc")
            {
                orderstr = " Sort asc";
            }
            else
            {
                orderstr = " id desc";
            }
            models = B_Lebi_Product.GetList(where, orderstr, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&OrderBy=" + OrderBy + "&key=" + key + "&" + sp.URL, page, PageSize, recordCount);
            //Response.Write(where);
        }
Esempio n. 11
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            pcode = "P_ShopIndex";
            LoadTheme(themecode, siteid, languagecode, pcode);
            id        = RequestTool.RequestInt("id", 0);          //商家ID
            cid       = RequestTool.RequestInt("cid", 0);         //商品分类
            list      = RequestTool.RequestString("list");        //列表或网格
            sort      = RequestTool.RequestString("sort");        //排序
            key       = RequestTool.RequestSafeString("keyword"); //关键词
            pageindex = RequestTool.RequestInt("page", 1);
            parentcid = 0;
            supplier  = B_Lebi_Supplier.GetModel("id = " + id);
            if (supplier == null)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            int Supplier_id = supplier.User_id;

            if (cid != 0)
            {
                producttype = B_Lebi_Supplier_ProductType.GetModel(cid);
                if (producttype.parentid > 0)
                {
                    parentcid = producttype.parentid;
                }
                else
                {
                    parentcid = cid;
                }
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a>";

            where = ProductWhere + " and Supplier_id = " + id + "";
            if (cid > 0)
            {
                if (DataBase.DBType == "sqlserver")
                {
                    where += " and Charindex('," + cid + ",',','+Supplier_ProductType_ids+',')>0";
                }
                if (DataBase.DBType == "access")
                {
                    where += " and Instr(','+Supplier_ProductType_ids+',','," + cid + ",')>0";
                }
            }
            if (key != "")
            {
                where += " and Name like '%" + key + "%'";
            }
            if (sort == "")
            {
                sort = "1";
            }
            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
            {
                order = " Count_Sales_Show desc"; ordertmp = "a";
            }
            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_ShopIndex", id + "," + cid + "," + list + "," + sort + ",{0}," + key + "");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage = URL("P_ShopIndex", id + "," + cid + "," + list + "," + sort + "," + (pageindex + 1) + "," + key + "");
            string supplierservicepannelcon = supplier.ServicePanel;

            supplierservicepannel = B_ServicePanel.GetModel(supplierservicepannelcon);

            headcontent = supplier.head;
            longbar     = supplier.longbar;
            shortbar    = supplier.shortbar;
            if (CurrentSite.IsMobile == 0)  //只针对PC站点 lebi.kingdge 2015-12-30
            {
                //跳转至设置的皮肤页面
                Lebi_Supplier_Skin skin = B_Lebi_Supplier_Skin.GetModel(supplier.Supplier_Skin_id);
                if (skin != null)
                {
                    string filename = HttpContext.Current.Request.Url.AbsolutePath.ToString().ToLower();
                    if (!filename.Contains("default" + skin.id + ".aspx"))
                    {
                        string tourl = Shop.Bussiness.Site.Instance.WebPath + "/" + CurrentLanguage.Path + "/shop/default" + skin.id + ".aspx?id=" + supplier.id + "&cid=" + cid + "&list=" + list + "&sort=" + sort + "&page=" + pageindex;
                        tourl = ThemeUrl.CheckPath(tourl);
                        Response.Redirect(tourl);
                        //Response.Write(tourl);
                    }
                }
            }
        }
Esempio n. 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_list", "商品列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            sp           = new SearchProduct(CurrentAdmin, CurrentLanguage.Code);
            PageSize     = RequestTool.getpageSize(25);
            key          = RequestTool.RequestSafeString("key");
            OrderBy      = RequestTool.RequestString("OrderBy");
            mode         = RequestTool.RequestString("mode");
            string where = "Product_id=0 and (IsDel!=1 or IsDel is null)";
            if (mode == "recycle")
            {
                where = "IsDel=1";
            }
            if (key != "")
            {
                where += " and (";
                where += " Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'} or id like lbsql{'%" + key + "%'}";
                List <Lebi_Product> parents = B_Lebi_Product.GetList("Number like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'} or id like lbsql{'%" + key + "%'}", "");
                if (parents.Count > 0)
                {
                    foreach (Lebi_Product parent in parents)
                    {
                        where += " or id =" + parent.Product_id + "";
                    }
                }
                where += " )";
            }
            where += sp.SQL;
            if (mode != "recycle")
            {
                if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
                {
                    string[] arr      = EX_Admin.Project().Site_ids.Split(',');
                    string   sonwhere = "";
                    foreach (string sid in arr)
                    {
                        if (sonwhere == "")
                        {
                            sonwhere = "','+Site_ids+',' like '%," + sid + ",%'";
                        }
                        else
                        {
                            sonwhere += " or ','+Site_ids+',' like '%," + sid + ",%'";
                        }
                    }
                    where += " and (" + sonwhere + " or Site_ids='')";
                }
                if (!string.IsNullOrEmpty(EX_Admin.Project().Pro_Type_ids))
                {
                    string[] ids      = EX_Admin.Project().Pro_Type_ids.Split(',');
                    string   sonwhere = "";
                    foreach (string id in ids)
                    {
                        sonwhere += " or Path like '%," + id + ",%'";
                    }
                    sonwhere = "select id from Lebi_Pro_Type where id in (" + EX_Admin.Project().Pro_Type_ids + ")" + sonwhere;
                    where   += " and (Pro_Type_id in (" + sonwhere + "))";
                }
                if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
                {
                    where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
                }
            }
            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " (Count_Stock+Count_Freeze) desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " (Count_Stock+Count_Freeze) asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else if (OrderBy == "SortDesc")
            {
                orderstr = " Sort desc";
            }
            else if (OrderBy == "SortAsc")
            {
                orderstr = " Sort asc";
            }
            else
            {
                orderstr = " id desc";
            }
            models = B_Lebi_Product.GetList(where, orderstr, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&OrderBy=" + OrderBy + "&key=" + key + "&mode=" + mode + "&" + sp.URL, page, PageSize, recordCount);
            //Response.Write(where);
        }
Esempio n. 13
0
 public int CountSon(int pid)
 {
     return(B_Lebi_Product.Counts("Product_id=" + pid + " and (IsDel!=1 or IsDel is null) and Product_id<>0"));
 }
Esempio n. 14
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            pcode = "P_ShopProductCategory";
            LoadTheme(themecode, siteid, languagecode, pcode);
            id        = Rint_Para("0");    //商家ID
            cid       = Rint_Para("1");    //商品分类
            list      = Rstring_Para("2"); //列表或网格
            sort      = Rstring_Para("3"); //排序
            key       = Rstring_Para("5"); //关键词
            pageindex = RequestTool.RequestInt("page", 1);
            parentcid = 0;
            supplier  = B_Lebi_Supplier.GetModel("id = " + id);
            if (supplier == null)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            int Supplier_id = supplier.User_id;

            if (cid != 0)
            {
                producttype = B_Lebi_Supplier_ProductType.GetModel(cid);
                if (producttype.parentid > 0)
                {
                    parentcid = producttype.parentid;
                }
                else
                {
                    parentcid = cid;
                }
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a>";
            if (key != "")
            {
                path += " > " + key;
            }

            where = "Type_id_ProductStatus = 101 and Product_id=0 and Supplier_id = " + id + "";
            if (cid > 0)
            {
                if (DataBase.DBType == "sqlserver")
                {
                    where += " and Charindex('," + cid + ",',','+Supplier_ProductType_ids+',')>0";
                }
                if (DataBase.DBType == "access")
                {
                    where += " and Instr(','+Supplier_ProductType_ids+',','," + cid + ",')>0";
                }
            }
            if (key != "")
            {
                where += " and Name like '%" + key + "%'";
            }
            if (sort == "")
            {
                sort = "1";
            }
            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
            {
                order = " Count_Sales_Show desc"; ordertmp = "a";
            }
            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_ShopProductCategory", id + "," + cid + "," + list + "," + sort + ",{0}," + key + "");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
            string supplierservicepannelcon = supplier.ServicePanel;

            supplierservicepannel = B_ServicePanel.GetModel(supplierservicepannelcon);

            headcontent = supplier.head;
            longbar     = supplier.longbar;
            shortbar    = supplier.shortbar;
        }
Esempio n. 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_batch_edit", "批量编辑"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize    = RequestTool.getpageSize(25);
            key         = RequestTool.RequestString("key");
            Pro_Type_id = RequestTool.RequestString("Pro_Type_id");
            status      = RequestTool.RequestInt("status", 0);
            brand       = RequestTool.RequestInt("brand", 0);
            tag         = RequestTool.RequestInt("tag", 0);
            dateFrom    = RequestTool.RequestString("dateFrom");
            dateTo      = RequestTool.RequestString("dateTo");
            OrderBy     = RequestTool.RequestString("OrderBy");
            lang        = RequestTool.RequestString("lang");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            Type_id_ProductType = RequestTool.RequestInt("Type_id_ProductType", 320);
            if (lang == "")
            {
                lang = "CN";
            }
            string where = "Product_id=0";
            if (Pro_Type_id != "")
            {
                where += " and Pro_Type_id in (" + Shop.Bussiness.EX_Product.Categoryid(Pro_Type_id) + ")";
            }
            if (status > 0)
            {
                where += " and Type_id_ProductStatus=" + status + "";
            }
            if (Type_id_ProductType > 0)
            {
                where += " and Type_id_ProductType=" + Type_id_ProductType + "";
            }
            if (tag > 0)
            {
                if (DataBase.DBType == "sqlserver")
                {
                    where += " and Charindex('" + tag + "',Pro_Tag_id)>0";
                }
                if (DataBase.DBType == "access")
                {
                    where += " and Instr(Pro_Tag_id,'" + tag + "')>0";
                }
            }
            if (brand > 0)
            {
                where += " and Brand_id=" + brand + "";
            }
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'})";
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and (datediff(d,Time_Add,'" + FormatDate(lbsql_dateFrom) + "')<=0 and datediff(d,Time_Add,'" + FormatDate(lbsql_dateTo) + "')>=0)";
            }

            if (CurrentAdmin.Pro_Type_ids != "")
            {
                string[] ids      = CurrentAdmin.Pro_Type_ids.Split(',');
                string   sonwhere = "";
                foreach (string id in ids)
                {
                    sonwhere += " or Path like '%," + id + ",%'";
                }
                sonwhere = "select id from Lebi_Pro_Type where id in (" + CurrentAdmin.Pro_Type_ids + ")" + sonwhere;
                where   += " and Pro_Type_id in (" + sonwhere + ")";
            }


            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " Count_Stock desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " Count_Stock asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else if (OrderBy == "SortDesc")
            {
                orderstr = " Sort desc";
            }
            else if (OrderBy == "SortAsc")
            {
                orderstr = " Sort asc";
            }
            else
            {
                orderstr = " id desc";
            }
            SQLDataAccess.SQLPara sp = new SQLDataAccess.SQLPara(where, orderstr, "*");
            models = B_Lebi_Product.GetList(sp, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(sp);

            PageString = Pager.GetPaginationString("?page={0}&brand=" + brand + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&key=" + key + "&lang=" + lang + "&OrderBy=" + OrderBy + "&Pro_Type_id=" + Pro_Type_id + "&status=" + status + "&Type_id_ProductType=" + Type_id_ProductType + "&tag=" + tag, page, PageSize, recordCount);
            userlevels = B_Lebi_UserLevel.GetList("", "Grade asc");
        }
Esempio n. 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     sp           = new SearchProduct(CurrentAdmin, CurrentLanguage.Code);
     ProductCount = B_Lebi_Product.Counts("Product_id=0 " + sp.SQL);
 }
Esempio n. 17
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Search'");
            keyword     = Rstring_Para("0");
            list        = Rstring_Para("1");
            sort        = Rstring_Para("2");
            pageindex   = Rint_Para("3", 1);
            id          = Rint_Para("4");
            pid         = Rint_Para("5");
            path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a class=\"text\"><span>" + Tag("商品搜索") + "</span></a><em>&raquo;</em><a class=\"text\"><span>“" + keyword + "”</span></a>";
            where       = ProductWhere + " and Type_id_ProductType <> 323";
            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 (";
                where += " (" + wherekeyword + ") or Number like lbsql{'%" + keyword + "%'} or Code like lbsql{'%" + keyword + "%'}";
                if (keyword.Length >= 3)
                {
                    List <Lebi_Product> parents = B_Lebi_Product.GetList("(IsDel!=1 or IsDel is null) and Product_id >0 and Name like lbsql{'%" + keyword + "%'} or Number like lbsql{'%" + keyword + "%'} or Code like lbsql{'%" + keyword + "%'}", "");
                    if (parents.Count > 0)
                    {
                        string ids = "";
                        foreach (Lebi_Product parent in parents)
                        {
                            ids += parent.Product_id + ",";
                        }
                        ids = ids.Substring(0, ids.Length - 1);
                        if (ids != "")
                        {
                            where += " or id in(" + ids + ")";
                        }
                    }
                }
                where += " )";
            }
            if (id > 0)
            {
                where += " and " + CategoryWhere(id);
            }
            if (pid > 0)
            {
                where += " and Brand_id=" + pid + "";
            }
            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 = "";
            }
            LB.DataAccess.SQLPara sp = new LB.DataAccess.SQLPara(where, order, "*");
            products    = B_Lebi_Product.GetList(sp, PageSize, pageindex);
            recordCount = B_Lebi_Product.Counts(sp);
            string url = URL("P_Search", keyword + "," + list + "," + sort + ",{0}");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage = URL("P_Search", keyword + "," + list + "," + sort + "," + (pageindex + 1) + "");
        }
Esempio n. 18
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            pcode = "P_ShopProductCategory";
            LoadTheme(themecode, siteid, languagecode, pcode);
            id        = RequestTool.RequestInt("id", 0);          //商家ID
            cid       = RequestTool.RequestInt("cid", 0);         //商品分类
            list      = RequestTool.RequestString("list");        //列表或网格
            sort      = RequestTool.RequestString("sort");        //排序
            keyword   = RequestTool.RequestSafeString("keyword"); //关键词
            pageindex = RequestTool.RequestInt("page", 1);
            parentcid = 0;
            supplier  = B_Lebi_Supplier.GetModel("id = " + id);
            if (supplier == null)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            int Supplier_id = supplier.User_id;

            if (cid != 0)
            {
                producttype = B_Lebi_Supplier_ProductType.GetModel(cid);
                if (producttype.parentid > 0)
                {
                    parentcid = producttype.parentid;
                }
                else
                {
                    parentcid = cid;
                }
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a><em>&raquo;</em><a href=\"" + URL("P_ShopProductCategory", "" + id + "," + cid + "," + list + "," + sort + ",1," + keyword + "") + "\"><span>" + Tag("商品列表") + "</span></a>";

            where = ProductWhere + " and Type_id_ProductType = 320 and Supplier_id = " + id + "";
            if (cid > 0)
            {
                where += " and " + ShopCategoryWhere(cid);
            }
            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 + "%'})";
                path  += "<em>&raquo;</em><a class=\"text\"><span>“" + keyword + "”</span></a>";
            }
            if (sort == "")
            {
                sort = "1";
            }
            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
            {
                order = " Count_Sales_Show desc"; ordertmp = "a";
            }
            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_ShopProductCategory", id + "," + cid + "," + list + "," + sort + ",{0}," + keyword + "");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage = URL("P_ShopProductCategory", id + "," + cid + "," + list + "," + sort + "," + (pageindex + 1) + "," + keyword + "");
            string supplierservicepannelcon = supplier.ServicePanel;

            supplierservicepannel = B_ServicePanel.GetModel(supplierservicepannelcon);

            headcontent = supplier.head;
            longbar     = supplier.longbar;
            shortbar    = supplier.shortbar;
            //跳转至设置的皮肤页面
            Lebi_Supplier_Skin skin = B_Lebi_Supplier_Skin.GetModel(supplier.Supplier_Skin_id);

            if (skin != null)
            {
                string filename = HttpContext.Current.Request.Url.AbsolutePath.ToString().ToLower();
                if (!filename.Contains("default" + skin.id + ".aspx") && filename.Contains("default.aspx"))
                {
                    string tourl = Shop.Bussiness.Site.Instance.WebPath + "/" + CurrentLanguage.Path + "/shop/default" + skin.id + ".aspx?id=" + supplier.id + "&cid=" + cid + "&list=" + list + "&sort=" + sort + "&page=" + pageindex + "&keyword=" + keyword;
                    tourl = ThemeUrl.CheckPath(tourl);
                    Response.Redirect(tourl);
                    //Response.Write(tourl);
                }
            }
        }
Esempio n. 19
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));
        }
Esempio n. 20
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Brand'");
            id          = Rint_Para("0");
            cid         = Rstring_Para("1");
            list        = Rstring_Para("2");
            sort        = Rstring_Para("3");
            pageindex   = RequestTool.RequestInt("page", 1);
            brand       = B_Lebi_Brand.GetModel(id);
            if (brand == null)
            {
                Response.Redirect(URL("P_BrandList", ""));
                Response.End();
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_BrandList", "") + "\"><span>" + Tag("品牌列表") + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Lang(brand.Name) + "</span></a>";
            //where = "Type_id_ProductStatus = 101 and Product_id=0 and Type_id_ProductType <> 323";
            where = ProductWhere + " and Type_id_ProductType <> 323";
            if (id > 0)
            {
                where += " and Brand_id = " + id + "";
            }
            if (cid != "")
            {
                where += " and " + Categorywhere(cid);
            }
            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);

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple("?page={0}&id=" + id + "&cid=" + cid + "&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id + "&cid=" + cid + "&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage = "?page=" + (pageindex + 1) + "&id=" + id + "&cid=" + cid + "&sort=" + sort + "&list=" + list + "";
        }
Esempio n. 21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_product_list", "商品列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            sp       = new SearchProduct(CurrentSupplier, CurrentLanguage.Code);
            PageSize = RequestTool.getpageSize(25);
            key      = RequestTool.RequestString("key");
            //Pro_Type_id = RequestTool.RequestString("Pro_Type_id");
            status = RequestTool.RequestInt("status", 0);
            //brand = RequestTool.RequestInt("brand", 0);
            //tag = RequestTool.RequestInt("tag", 0);
            //dateFrom = RequestTool.RequestString("dateFrom");
            //dateTo = RequestTool.RequestString("dateTo");
            //OrderBy = RequestTool.RequestString("OrderBy");
            //lang = RequestTool.RequestString("lang");
            //if (lang == "")
            //    lang = "CN";
            string where = "(IsDel!=1 or IsDel is null) and Product_id=0 and Supplier_id = " + CurrentSupplier.id + "";
            //if (Pro_Type_id != "")
            //    where += " and Pro_Type_id in (" + Shop.Bussiness.EX_Product.Categoryid(Pro_Type_id) + ")";
            if (status > 0)
            {
                where += " and Type_id_ProductStatus=" + status + "";
            }
            //if (tag > 0)
            //    where += " and Pro_Tag_id=" + tag + "";
            //if (brand > 0)
            //    where += " and Brand_id=" + brand + "";
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'})";
            }
            //if (dateFrom != "" && dateTo != "")
            //    where += " and (datediff(d,Time_Add,'" + dateFrom + "')<=0 and datediff(d,Time_Add,'" + dateTo + "')>=0)";

            where += sp.SQL;
            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " Count_Stock desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " Count_Stock asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else
            {
                orderstr = " id desc";
            }

            models = B_Lebi_Product.GetList(where, orderstr, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}&key=" + key + "&" + sp.URL, page, PageSize, recordCount);
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_batch_edit", "批量编辑"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize    = RequestTool.getpageSize(25);
            key         = RequestTool.RequestString("key");
            Pro_Type_id = RequestTool.RequestString("Pro_Type_id");
            status      = RequestTool.RequestInt("status", 0);
            brand       = RequestTool.RequestInt("brand", 0);
            tag         = RequestTool.RequestInt("tag", 0);
            dateFrom    = RequestTool.RequestString("dateFrom");
            dateTo      = RequestTool.RequestString("dateTo");
            OrderBy     = RequestTool.RequestString("OrderBy");
            lang        = RequestTool.RequestString("lang");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            Type_id_ProductType = RequestTool.RequestInt("Type_id_ProductType", 320);
            if (lang == "")
            {
                lang = "CN";
            }
            string where = "Product_id=0 and (IsDel!=1 or IsDel is null)";
            if (Pro_Type_id != "")
            {
                where += " and Pro_Type_id in (" + Shop.Bussiness.EX_Product.Categoryid(Pro_Type_id) + ")";
            }
            if (status > 0)
            {
                where += " and Type_id_ProductStatus=" + status + "";
            }
            if (Type_id_ProductType > 0)
            {
                where += " and Type_id_ProductType=" + Type_id_ProductType + "";
            }
            if (tag > 0)
            {
                if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "sqlserver")
                {
                    where += " and Charindex('" + tag + "',Pro_Tag_id)>0";
                }
                else if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "access")
                {
                    where += " and Instr(Pro_Tag_id,'" + tag + "')>0";
                }
                else if (LB.DataAccess.DB.BaseUtilsInstance.DBType == "mysql")
                {
                    where += " and Instr(Pro_Tag_id,'" + tag + "')>0";
                }
            }
            if (brand > 0)
            {
                where += " and Brand_id=" + brand + "";
            }
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'})";
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_Add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
            }

            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                string[] arr      = EX_Admin.Project().Site_ids.Split(',');
                string   sonwhere = "";
                foreach (string sid in arr)
                {
                    if (sonwhere == "")
                    {
                        sonwhere = "','+Site_ids+',' like '%," + sid + ",%'";
                    }
                    else
                    {
                        sonwhere += " or ','+Site_ids+',' like '%," + sid + ",%'";
                    }
                }
                where += " and (" + sonwhere + " or Site_ids='')";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Pro_Type_ids))
            {
                string[] ids      = EX_Admin.Project().Pro_Type_ids.Split(',');
                string   sonwhere = "";
                foreach (string id in ids)
                {
                    sonwhere += " or Path like '%," + id + ",%'";
                }
                sonwhere = "select id from Lebi_Pro_Type where id in (" + EX_Admin.Project().Pro_Type_ids + ")" + sonwhere;
                where   += " and (Pro_Type_id in (" + sonwhere + ") or Pro_Type_id=0)";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            //if (!string.IsNullOrEmpty(OrderBy))
            //{
            //    if (OrderBy.Contains("Desc"))
            //    {
            //        orderstr = " " + OrderBy.Substring(0, OrderBy.Length - 4) + " desc";
            //    }
            //    else
            //    {
            //        orderstr = " " + OrderBy.Substring(0, OrderBy.Length - 3) + " asc";
            //    }
            //}
            //else
            //{
            //    orderstr = " id desc";
            //}
            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " Count_Stock desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " Count_Stock asc";
            }
            else if (OrderBy == "Price_MarketDesc")
            {
                orderstr = " Price_Market desc";
            }
            else if (OrderBy == "Price_MarketAsc")
            {
                orderstr = " Price_Market asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else if (OrderBy == "SortDesc")
            {
                orderstr = " Sort desc";
            }
            else if (OrderBy == "SortAsc")
            {
                orderstr = " Sort asc";
            }
            else
            {
                orderstr = " id desc";
            }
            LB.DataAccess.SQLPara sp = new LB.DataAccess.SQLPara(where, orderstr, "*");
            models = B_Lebi_Product.GetList(sp, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(sp);

            PageString = Pager.GetPaginationString("?page={0}&brand=" + brand + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&key=" + key + "&lang=" + lang + "&OrderBy=" + OrderBy + "&Pro_Type_id=" + Pro_Type_id + "&status=" + status + "&Type_id_ProductType=" + Type_id_ProductType + "&tag=" + tag, page, PageSize, recordCount);
            userlevels = B_Lebi_UserLevel.GetList("", "Grade asc");
        }
Esempio n. 23
0
 public int CountSon(int pid)
 {
     return(B_Lebi_Product.Counts("Product_id=" + pid + " and Product_id<>0"));
 }
Esempio n. 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_list", "商品列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            sp           = new SearchProduct(CurrentAdmin, CurrentLanguage.Code);
            PageSize     = RequestTool.getpageSize(25);
            key          = RequestTool.RequestSafeString("key");
            OrderBy      = RequestTool.RequestString("OrderBy");
            string where = "Product_id=0 and IsDel=1";
            if (key != "")
            {
                where += " and (";
                where += " Name like lbsql{'%" + key + "%'} or Number like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'} or id like lbsql{'%" + key + "%'}";
                List <Lebi_Product> parents = B_Lebi_Product.GetList("Number like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'} or id like lbsql{'%" + key + "%'}", "");
                if (parents.Count > 0)
                {
                    foreach (Lebi_Product parent in parents)
                    {
                        where += " or id =" + parent.Product_id + "";
                    }
                }
                where += " )";
            }
            where += sp.SQL;
            if (OrderBy == "StatusDesc")
            {
                orderstr = " Type_id_ProductStatus desc";
            }
            else if (OrderBy == "StatusAsc")
            {
                orderstr = " Type_id_ProductStatus asc";
            }
            else if (OrderBy == "ViewsDesc")
            {
                orderstr = " Count_Views desc";
            }
            else if (OrderBy == "ViewsAsc")
            {
                orderstr = " Count_Views asc";
            }
            else if (OrderBy == "SalesDesc")
            {
                orderstr = " Count_Sales desc";
            }
            else if (OrderBy == "SalesAsc")
            {
                orderstr = " Count_Sales asc";
            }
            else if (OrderBy == "CountDesc")
            {
                orderstr = " (Count_Stock+Count_Freeze) desc";
            }
            else if (OrderBy == "CountAsc")
            {
                orderstr = " (Count_Stock+Count_Freeze) asc";
            }
            else if (OrderBy == "Price_CostDesc")
            {
                orderstr = " Price_Cost desc";
            }
            else if (OrderBy == "Price_CostAsc")
            {
                orderstr = " Price_Cost asc";
            }
            else if (OrderBy == "PriceDesc")
            {
                orderstr = " Price desc";
            }
            else if (OrderBy == "PriceAsc")
            {
                orderstr = " Price asc";
            }
            else if (OrderBy == "FreezeDesc")
            {
                orderstr = " Count_Freeze desc";
            }
            else if (OrderBy == "FreezeAsc")
            {
                orderstr = " Count_Freeze asc";
            }
            else if (OrderBy == "SortDesc")
            {
                orderstr = " Sort desc";
            }
            else if (OrderBy == "SortAsc")
            {
                orderstr = " Sort asc";
            }
            else
            {
                orderstr = " id desc";
            }
            models = B_Lebi_Product.GetList(where, orderstr, PageSize, page);
            int recordCount = B_Lebi_Product.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&OrderBy=" + OrderBy + "&key=" + key + "&" + sp.URL, page, PageSize, recordCount);
            //Response.Write(where);
        }