示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_property", "属性规格"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            Lebi_ProPerty check = B_Lebi_ProPerty.GetModel(pid);

            if (check == null)
            {
                pid = B_Lebi_ProPerty.GetList("Supplier_id = " + CurrentSupplier.id + " and parentid = 0", "").FirstOrDefault().id;
            }
            PageSize     = RequestTool.getpageSize(25);
            pid          = RequestTool.RequestInt("pid", 0);
            key          = RequestTool.RequestString("key");
            pmodel       = B_Lebi_ProPerty.GetModel(pid);
            string where = "parentid=" + pid;
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'})";
            }
            models = B_Lebi_ProPerty.GetList(where, "Sort desc", PageSize, page);
            int recordCount = B_Lebi_ProPerty.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}&pid=" + pid + "&key=" + key + "", page, PageSize, recordCount);
            tmodel     = B_Lebi_Type.GetModel(pmodel.Type_id_ProPertyType);
        }
示例#2
0
        public string Getpro133List(Lebi_ProPerty pmodel)
        {
            string str = "";
            List <Lebi_ProPerty>      ps    = B_Lebi_ProPerty.GetList("Supplier_id = " + CurrentSupplier.id + " and parentid=" + pmodel.id + "", "Sort desc");
            List <Lebi_Language_Code> langs = Language.Languages();
            KeyValue kv;

            try
            {
                kv = (from m in ProPerty133
                      where m.K == pmodel.id.ToString()
                      select m).ToList().FirstOrDefault();
            }
            catch
            {
                kv = new KeyValue();
            }
            if (kv == null)
            {
                kv = new KeyValue();
            }
            foreach (Lebi_Language_Code lang in langs)
            {
                str += lang.Code + " <input type=\"text\" name=\"Property133_" + pmodel.id + lang.Code + "\" shop=\"true\" value=\"" + Language.Content(kv.V, lang.Code) + "\"" + " class=\"input\"  /> ";
            }
            return(str);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (id == 0)
            {
                if (!EX_Admin.Power("property_add", "添加属性规格"))
                {
                    WindowNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("property_edit", "编辑属性规格"))
                {
                    WindowNoPower();
                }
            }
            int tid = RequestTool.RequestInt("tid", 131);

            model = B_Lebi_ProPerty.GetModel(id);
            if (model == null)
            {
                model = new Lebi_ProPerty();
                model.Type_id_ProPertyType = tid;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_property", "属性规格"))
            {
                WindowNoPower();
            }
            int pid = RequestTool.RequestInt("pid", 0);
            int id  = RequestTool.RequestInt("id", 0);

            model = B_Lebi_ProPerty.GetModel(id);
            Lebi_ProPerty check = B_Lebi_ProPerty.GetModel(pid);

            if (check == null)
            {
                pid = B_Lebi_ProPerty.GetList("Supplier_id = " + CurrentSupplier.id + " and parentid = 0", "").FirstOrDefault().id;
            }
            pmodel = B_Lebi_ProPerty.GetModel(pid);
            if (pmodel == null)
            {
                pmodel = new Lebi_ProPerty();
                Response.Write("参数错误");
                Response.End();
            }
            if (model == null)
            {
                model = new Lebi_ProPerty();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_property", "属性规格"))
            {
                WindowNoPower();
            }
            int id  = RequestTool.RequestInt("id", 0);
            int tid = RequestTool.RequestInt("tid", 131);

            model = B_Lebi_ProPerty.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (model == null)
            {
                model = new Lebi_ProPerty();
                model.Type_id_ProPertyType = tid;
            }
        }
示例#6
0
 /// <summary>
 /// 返回商品的自定义文字属性
 /// </summary>
 /// <returns></returns>
 public void GetProWords()
 {
     ProPertys = new List <KeyValue>();
     try
     {
         List <KeyValue> kvs = Common.KeyValueToList(product.ProPerty133);
         foreach (KeyValue kv in kvs)
         {
             Lebi_ProPerty pro = B_Lebi_ProPerty.GetModel("id=" + kv.K + "");
             KeyValue      rkv = new KeyValue();
             rkv.K = Lang(pro.Name);
             rkv.V = Lang(kv.V);
             ProPertys.Add(rkv);
         }
     }
     catch
     {
         ProPertys = new List <KeyValue>();
     }
 }
示例#7
0
        public string Getpro132List(Lebi_ProPerty pmodel)
        {
            string str = "";
            List <Lebi_ProPerty> ps = B_Lebi_ProPerty.GetList("parentid=" + pmodel.id + "", "Sort desc");

            foreach (Lebi_ProPerty p in ps)
            {
                string sel = "";
                if (("," + model.ProPerty132 + ",").Contains("," + p.id + ","))
                {
                    sel = "checked";
                }
                str += " <label><input type=\"checkbox\" name=\"Property132\" shop=\"true\" " + sel + " value=\"" + p.id + "\"" + " />";
                if (p.ImageUrl != "")
                {
                    str += "<img src=\"" + Image(p.ImageUrl, 16, 16) + "\">";
                }
                str += Language.Content(p.Name, CurrentLanguage.Code) + "</label>";
            }
            return(str);
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("property_add", "添加属性规格") || !EX_Admin.Power("property_edit", "编辑属性规格"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize     = RequestTool.getpageSize(25);
            pid          = RequestTool.RequestInt("pid", 0);
            key          = RequestTool.RequestString("key");
            pmodel       = B_Lebi_ProPerty.GetModel(pid);
            string where = "parentid=" + pid;
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'})";
            }
            models = B_Lebi_ProPerty.GetList(where, "Sort desc", PageSize, page);
            int recordCount = B_Lebi_ProPerty.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&pid=" + pid + "&key=" + key + "", page, PageSize, recordCount);
            tmodel     = B_Lebi_Type.GetModel(pmodel.Type_id_ProPertyType);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("property_add", "添加属性规格") || !EX_Admin.Power("property_edit", "编辑属性规格"))
            {
                WindowNoPower();
            }
            int pid = RequestTool.RequestInt("pid", 0);
            int id  = RequestTool.RequestInt("id", 0);

            model  = B_Lebi_ProPerty.GetModel(id);
            pmodel = B_Lebi_ProPerty.GetModel(pid);
            if (pmodel == null)
            {
                pmodel = new Lebi_ProPerty();
                Response.Write("参数错误");
                Response.End();
            }
            if (model == null)
            {
                model = new Lebi_ProPerty();
            }
        }
示例#10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_ProPerty model)
 {
     D_Lebi_ProPerty.Instance.Update(model);
 }
示例#11
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_ProPerty model)
 {
     return(D_Lebi_ProPerty.Instance.Add(model));
 }
示例#12
0
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_ProPerty SafeBindForm(Lebi_ProPerty model)
 {
     return(D_Lebi_ProPerty.Instance.SafeBindForm(model));
 }
示例#13
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);
            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);
                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 (DataBase.DBType == "sqlserver")
                {
                    where += " and Charindex('," + tid + ",',','+Pro_Tag_id+',')>0";
                }
                if (DataBase.DBType == "access")
                {
                    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 (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 + "", Lang(pro_type.Url));

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
        }
示例#14
0
        public override string ThemePageMeta(string code, string tag)
        {
            string str           = "";
            string Page_Title    = "";
            string Page_Keywords = "";

            if (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)
                            {
                                Page_Title    += Lang(ProPerty.Name) + " - ";
                                Page_Keywords += Lang(ProPerty.Name) + ",";
                            }
                        }
                    }
                }
                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)
                        {
                            Page_Title    += Lang(ProPerty.Name) + " - ";
                            Page_Keywords += Lang(ProPerty.Name) + ",";
                        }
                    }
                }
            }
            if (pid > 0)
            {
                Lebi_Brand brand = B_Lebi_Brand.GetModel(pid);
                Page_Title    += Lang(brand.Name) + " - ";
                Page_Keywords += Lang(brand.Name) + ",";
            }
            if (pro_type.id > 0)
            {
                string[,] parr = Categorypath(id);
                for (int i = parr.GetUpperBound(0); i >= 0; i--)
                {
                    Page_Title    += parr[i, 1];
                    Page_Keywords += parr[i, 1];
                    if (i < parr.GetUpperBound(0))
                    {
                        Page_Title    += " - ";
                        Page_Keywords += ",";
                    }
                }
            }
            if (tid > 0)
            {
                Lebi_Pro_Tag Tag = B_Lebi_Pro_Tag.GetModel(tid);
                Page_Title += Lang(Tag.Name) + " - ";
            }
            switch (tag.ToLower())
            {
            case "description":
                if (Lang(pro_type.SEO_Description) == "")
                {
                    str = Page_Keywords;
                }
                else
                {
                    str = Lang(pro_type.SEO_Description) + ",";
                }
                break;

            case "keywords":
                if (Lang(pro_type.SEO_Keywords) == "")
                {
                    str = Page_Keywords;
                }
                else
                {
                    str = Lang(pro_type.SEO_Keywords) + ",";
                }
                break;

            default:
                if (Lang(pro_type.SEO_Title) == "")
                {
                    str = Page_Title;
                }
                else
                {
                    str = Lang(pro_type.SEO_Title);
                }
                break;
            }
            return(ThemePageMeta(code, tag, str));
        }
示例#15
0
        /// <summary>
        /// 生成规格选项
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string Get_guige(Lebi_Product model)
        {
            string res = "";

            if (model.ProPerty134 != "")
            {
                List <Lebi_ProPerty> ps134 = B_Lebi_ProPerty.GetList("id in (" + model.ProPerty134 + ")", "Sort desc");
                string Msige = Language.DefaultCurrency().Msige;
                foreach (Lebi_ProPerty p in ps134)
                {
                    res += "<dl class=\"clearfix\"><dt>" + Lang(p.Name) + ":</dt><dd>";
                    res += "<input type=\"hidden\" name=\"Property134\" propertyid=\"" + p.id + "\" value=\"" + Lang(p.Name) + "\" />";
                    List <Lebi_ProPerty> ps134list = B_Lebi_ProPerty.GetList("parentid = " + p.id + "", "Sort desc");
                    if (ps134list.Count > 0)
                    {
                        Lebi_ProPerty ps134listfirst = ps134list.FirstOrDefault();
                        res += "<select id=\"Property134_" + p.id + "\" selectname=\"Property134\">";
                        foreach (Lebi_ProPerty pl in ps134list)
                        {
                            if (pl.Price > 0)
                            {
                                res += "<option propertypriceid=\"" + pl.id + "\" value=\"" + Lang(pl.Name) + Msige + pl.Price + "\">" + Lang(pl.Name) + " " + Msige + pl.Price + "</option>";
                            }
                            else
                            {
                                res += "<option propertypriceid=\"" + pl.id + "\" value=\"" + Lang(pl.Name) + "\">" + Lang(pl.Name) + "</option>";
                            }
                        }
                        res += "</select>";
                    }
                    else
                    {
                        res += "<input type=\"text\" id=\"Property134_" + p.id + "\" class=\"input\" value=\"\" />";
                    }
                    res += "</dd></dl>";
                }
            }
            //return "model.ProPerty134" + model.ProPerty134;
            List <ProductProperty> rmodels = new List <ProductProperty>();

            if (model.Product_id == 0)
            {
                //无同款子商品
                return(res);
            }
            List <Lebi_Product> pros = B_Lebi_Product.GetList("(IsDel!=1 or IsDel is null) and Product_id=" + model.Product_id + "", "");

            if (pros.Count == 0)
            {
                return(res);
            }
            Lebi_Product pmodel = B_Lebi_Product.GetModel(model.Product_id);

            if (pmodel == null)
            {
                return(res);
            }
            string property = EX_Product.ProductType_ProPertystr(model.Pro_Type_id, 131, model.Supplier_id);

            if (property == "")
            {
                return(res);
            }
            List <Lebi_ProPerty> pps = B_Lebi_ProPerty.GetList("id in (" + property + ")", "Sort desc");
            List <Lebi_ProPerty> ps  = B_Lebi_ProPerty.GetList("parentid in (" + property + ")", "Sort desc");
            //分析当前商品的规格
            //将当前商品的规格与主父规格进行对应
            List <Lebi_ProPerty> Currentpps = new List <Lebi_ProPerty>();//保存当时商品的父规则值

            string[] temps = model.ProPerty131.Split(',');
            foreach (string k in temps)
            {
                Lebi_ProPerty p = (from m in ps
                                   where m.id == Convert.ToInt32(k)
                                   select m).ToList().FirstOrDefault();
                if (p != null)
                {
                    Lebi_ProPerty kv = (from m in pps
                                        where m.id == p.parentid
                                        select m).ToList().FirstOrDefault();
                    kv.Sort = p.id;//临时征用排序字段,存放规格
                    Currentpps.Add(kv);
                }
            }

            foreach (Lebi_ProPerty pp in Currentpps)
            {
                List <Lebi_ProPerty> cps = (from m in ps
                                            where m.parentid == pp.id
                                            select m).ToList();
                if (cps.Count == 0)
                {
                    continue;
                }
                bool showimage = true;
                if (cps.FirstOrDefault().ImageUrl == "")
                {
                    showimage = false;
                }
                if (pp.id == model.ProPertyMain)
                {
                    //res += "<dl class=\"choose-image clearfix\"><dt>" + Lang(pp.Name) + ":</dt><dd>";
                    if (!showimage)
                    {
                        res += "<dl class=\"choose-text clearfix\"><dt>" + Lang(pp.Name) + ":</dt><dd>";
                    }
                    else
                    {
                        res += "<dl class=\"choose-image clearfix\"><dt>" + Lang(pp.Name) + ":</dt><dd>";
                    }
                    foreach (Lebi_ProPerty p in cps)
                    {
                        //计算对应的商品
                        string       propertystr = ("," + model.ProPerty131 + ",").Replace("," + pp.Sort + ",", "," + p.id + ",");
                        Lebi_Product pro         = (from m in pros
                                                    where ("," + m.ProPerty131 + ",") == propertystr
                                                    select m).ToList().FirstOrDefault();
                        if (pro == null)
                        {
                            continue;
                        }
                        if (showimage)
                        {
                            if (pro.Type_id_ProductStatus == 100 || (EX_Product.ProductStock(pro) < 1 && SYS.IsNullStockSale != "1"))//下架 无库存
                            {
                                if (pp.Sort == p.id)
                                {
                                    res += "<div><a class=\"spva-imgonout\"><img src=\"" + Image(model.ImageOriginal) + "\" width=\"50\" title=\"" + Lang(p.Name) + "\" alt=\"" + Lang(p.Name) + "\"/><span></span></a></div>";
                                }
                                else
                                {
                                    res += "<div><a class=\"spva-imgout\" href=\"" + URL("P_Product", pro.id) + "\"><img src=\"" + Image(pro.ImageOriginal) + "\" width=\"50\" title=\"" + Lang(p.Name) + "\" alt=\"" + Lang(p.Name) + "\"/><span></span></a></div>";
                                }
                                continue;
                            }
                            if (pp.Sort == p.id)
                            {
                                res += "<div><a class=\"spva-imgon\" href=\"" + URL("P_Product", model.id) + "\"><img src=\"" + Image(model.ImageOriginal) + "\" width=\"50\" title=\"" + Lang(p.Name) + "\" alt=\"" + Lang(p.Name) + "\"/><span></span></a></div>";
                            }
                            else
                            {
                                res += "<div><a class=\"spva-img\" href=\"" + URL("P_Product", pro.id) + "\"><img src=\"" + Image(pro.ImageOriginal) + "\" width=\"50\" title=\"" + Lang(p.Name) + "\" alt=\"" + Lang(p.Name) + "\"/><span></span></a></div>";
                            }
                        }
                        else
                        {
                            if (pro.Type_id_ProductStatus == 100 || (EX_Product.ProductStock(pro) < 1 && SYS.IsNullStockSale != "1"))//下架 无库存
                            {
                                if (pp.Sort == p.id)
                                {
                                    res += "<div><a class=\"spvaonout\">" + Lang(p.Name) + "<span></span></a></div>";
                                }
                                else
                                {
                                    res += "<div><a class=\"spvaout\" href=\"" + URL("P_Product", pro.id) + "\">" + Lang(p.Name) + "<span></span></a></div>";
                                }
                                continue;
                            }
                            if (pp.Sort == p.id)
                            {
                                res += "<div><a class=\"spvaon\" href=\"" + URL("P_Product", model.id) + "\">" + Lang(p.Name) + "<span></span></a></div>";
                            }
                            else
                            {
                                res += "<div><a class=\"spva\" href=\"" + URL("P_Product", pro.id) + "\">" + Lang(p.Name) + "<span></span></a></div>";
                            }
                        }
                    }
                }
                else
                {
                    if (!showimage)
                    {
                        res += "<dl class=\"choose-text clearfix\"><dt>" + Lang(pp.Name) + ":</dt><dd>";
                    }
                    else
                    {
                        res += "<dl class=\"choose-image clearfix\"><dt>" + Lang(pp.Name) + ":</dt><dd>";
                    }
                    foreach (Lebi_ProPerty p in cps)
                    {
                        //计算对应的商品
                        string       propertystr = ("," + model.ProPerty131 + ",").Replace("," + pp.Sort + ",", "," + p.id + ",");
                        Lebi_Product pro         = (from m in pros
                                                    where ("," + m.ProPerty131 + ",") == propertystr
                                                    select m).ToList().FirstOrDefault();
                        if (pro == null)
                        {
                            continue;
                        }
                        string tt     = "";
                        string aclass = "";
                        if (p.ImageUrl == "")
                        {
                            tt = Lang(p.Name);
                        }
                        else
                        {
                            tt = "<img src=\"" + p.ImageUrl + "\" width=\"50\"\" />";
                        }

                        if (pro.Type_id_ProductStatus == 100 || (EX_Product.ProductStock(pro) < 1 && SYS.IsNullStockSale != "1"))//下架 无库存
                        {
                            if (pp.Sort == p.id)
                            {
                                if (cps.FirstOrDefault().ImageUrl == "")
                                {
                                    aclass = "spvaonout";
                                }
                                else
                                {
                                    aclass = "spva-imgonout";
                                }
                                res += "<div><a class=\"" + aclass + "\" title=\"" + Lang(p.Name) + "\">" + tt + "<span></span></a></div>";
                            }
                            else
                            {
                                if (cps.FirstOrDefault().ImageUrl == "")
                                {
                                    aclass = "spvaout";
                                }
                                else
                                {
                                    aclass = "spva-imgout";
                                }
                                res += "<div><a class=\"" + aclass + "\" href=\"" + URL("P_Product", pro.id) + "\" title=\"" + Lang(p.Name) + "\">" + tt + "<span></span></a></div>";
                            }
                            continue;
                        }

                        if (pp.Sort == p.id)
                        {
                            if (!showimage)
                            {
                                aclass = "spvaon";
                            }
                            else
                            {
                                aclass = "spva-imgon";
                            }
                            res += "<div><a class=\"" + aclass + "\" href=\"" + URL("P_Product", model.id) + "\" title=\"" + Lang(p.Name) + "\">" + tt + "<span></span></a></div>";
                        }
                        else
                        {
                            if (!showimage)
                            {
                                aclass = "spva";
                            }
                            else
                            {
                                aclass = "spva-img";
                            }
                            res += "<div><a class=\"" + aclass + "\" href=\"" + URL("P_Product", pro.id) + "\" title=\"" + Lang(p.Name) + "\">" + tt + "<span></span></a></div>";
                        }
                    }
                }
                res += "</dd></dl>";
            }
            return(res);
        }
示例#16
0
        public string GetproList(Lebi_ProPerty pmodel)
        {
            string str = "<div class=\"input-group\">";
            List <Lebi_ProPerty> ps = B_Lebi_ProPerty.GetList("parentid=" + pmodel.id + "", "Sort desc");

            if (pmodel.Type_id_ProPertyType == 132)
            {
                foreach (Lebi_ProPerty p in ps)
                {
                    string sel = "";
                    if (("," + model.ProPerty132 + ",").Contains("," + p.id + ","))
                    {
                        sel = "checked";
                    }
                    if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                    {
                        str += "<label class=\"custom-control custom-checkbox m-r-20\"><input type=\"checkbox\" id=\"Property132" + p.id + "\" name=\"Property132\" value=\"" + p.id + "\" class=\"custom-control-input\" shop=\"true\" " + sel + "><span class=\"custom-control-label\">";
                        if (p.ImageUrl != "")
                        {
                            str += "<img src=\"" + Image(p.ImageUrl, 16, 16) + "\">";
                        }
                        str += Language.Content(p.Name, CurrentLanguage.Code) + "</span></label>";
                    }
                    else
                    {
                        str += " <label><input type=\"checkbox\" name=\"Property132\" shop=\"true\" " + sel + " value=\"" + p.id + "\"" + " />";
                        if (p.ImageUrl != "")
                        {
                            str += "<img src=\"" + Image(p.ImageUrl, 16, 16) + "\">";
                        }
                        str += Language.Content(p.Name, CurrentLanguage.Code) + "</label>";
                    }
                }
            }
            else if (pmodel.Type_id_ProPertyType == 133)
            {
                List <Lebi_Language_Code> langs = Language.Languages();
                KeyValue kv;
                try
                {
                    kv = (from m in ProPerty133
                          where m.K == pmodel.id.ToString()
                          select m).ToList().FirstOrDefault();
                }
                catch
                {
                    kv = new KeyValue();
                }
                if (kv == null)
                {
                    kv = new KeyValue();
                }
                foreach (Lebi_Language_Code lang in langs)
                {
                    string val = "";
                    if (kv != null && kv.V != null)
                    {
                        val = kv.V;
                    }
                    if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                    {
                        str += "<div class=\"input-group-prepend\"><span class=\"input-group-text\">" + lang.Code + "</span></div><input type=\"text\" name=\"Property133_" + pmodel.id + lang.Code + "\" shop=\"true\" value=\"" + Language.Content(val, lang.Code) + "\"" + " class=\"form-control form-contorl-sm m-r-20\" style=\"width:70px\"  /> ";
                    }
                    else
                    {
                        str += lang.Code + " <input type=\"text\" name=\"Property133_" + pmodel.id + lang.Code + "\" shop=\"true\" value=\"" + Language.Content(val, lang.Code) + "\"" + " class=\"input\"  /> ";
                    }
                }
            }
            else if (pmodel.Type_id_ProPertyType == 134)
            {
                foreach (Lebi_ProPerty p in ps)
                {
                    string sel = "";
                    if (("," + model.ProPerty134 + ",").Contains("," + p.id + ","))
                    {
                        sel = "checked";
                    }
                    if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                    {
                        str += "<label class=\"custom-control custom-checkbox m-r-20\"><input type=\"checkbox\" id=\"Property134" + p.id + "\" name=\"Property134\" value=\"" + p.id + "\" class=\"custom-control-input\" shop=\"true\" " + sel + "><span class=\"custom-control-label\">";
                        if (p.ImageUrl != "")
                        {
                            str += "<img src=\"" + Image(p.ImageUrl, 16, 16) + "\">";
                        }
                        str += Language.Content(p.Name, CurrentLanguage.Code) + "</span></label>";
                    }
                    else
                    {
                        str += " <label><input type=\"checkbox\" name=\"Property134\" shop=\"true\" " + sel + " value=\"" + p.id + "\"" + " />";
                        if (p.ImageUrl != "")
                        {
                            str += "<img src=\"" + Image(p.ImageUrl, 16, 16) + "\">";
                        }
                        str += Language.Content(p.Name, CurrentLanguage.Code) + "</label>";
                    }
                }
            }
            str += "</div>";
            return(str);
        }
示例#17
0
        public string Get_guigeforwap(Lebi_Product model)
        {
            string res = "";

            if (model.ProPerty134 != "")
            {
                List <Lebi_ProPerty> ps134 = B_Lebi_ProPerty.GetList("id in (" + model.ProPerty134 + ")", "Sort desc");
                string Msige = Language.DefaultCurrency().Msige;
                if (ps134.Count > 0)
                {
                    foreach (Lebi_ProPerty p in ps134)
                    {
                        res += "<dd class=\"clearfix\"><em>" + Lang(p.Name) + ":</em><em><input type=\"hidden\" name=\"Property134\" propertyid=\"" + p.id + "\" value=\"" + Lang(p.Name) + Msige + p.Price + ":\" />";
                        List <Lebi_ProPerty> ps134list = B_Lebi_ProPerty.GetList("parentid = " + p.id + "", "Sort desc");
                        if (ps134list.Count > 0)
                        {
                            res += "<select id=\"Property134_" + p.id + "\" >";
                            foreach (Lebi_ProPerty pl in ps134list)
                            {
                                if (pl.Price > 0)
                                {
                                    res += "<option propertypriceid=\"" + pl.id + "\" value=\"" + Lang(pl.Name) + Msige + pl.Price + "\">" + Lang(pl.Name) + " " + Msige + pl.Price + "</option>";
                                }
                                else
                                {
                                    res += "<option propertypriceid=\"" + pl.id + "\" value=\"" + Lang(pl.Name) + "\">" + Lang(pl.Name) + "</option>";
                                }
                            }
                            res += "</select>";
                        }
                        else
                        {
                            res += "<input type=\"text\" id=\"Property134_" + p.id + "\" class=\"input\" value=\"\" />";
                        }
                        res += "</em></dd>";
                    }
                }
            }
            List <ProductProperty> rmodels = new List <ProductProperty>();

            if (model.Product_id == 0)
            {
                //无同款子商品
                return(res);
            }
            List <Lebi_Product> pros = B_Lebi_Product.GetList("(IsDel!=1 or IsDel is null) and Product_id=" + model.Product_id + "", "");

            if (pros.Count == 0)
            {
                return(res);
            }
            Lebi_Product pmodel = B_Lebi_Product.GetModel(model.Product_id);

            if (pmodel == null)
            {
                return(res);
            }
            string property = EX_Product.ProductType_ProPertystr(model.Pro_Type_id, 131);

            if (property == "")
            {
                return(res);
            }
            List <Lebi_ProPerty> pps = B_Lebi_ProPerty.GetList("id in (" + property + ")", "Sort desc");
            List <Lebi_ProPerty> ps  = B_Lebi_ProPerty.GetList("parentid in (" + property + ")", "Sort desc");
            //分析当前商品的规格
            //将当前商品的规格与主父规格进行对应
            List <Lebi_ProPerty> Currentpps = new List <Lebi_ProPerty>();//保存当前商品的父规则值

            string[] temps = model.ProPerty131.Split(',');
            foreach (string k in temps)
            {
                Lebi_ProPerty p = (from m in ps
                                   where m.id == Convert.ToInt32(k)
                                   select m).ToList().FirstOrDefault();
                if (p != null)
                {
                    Lebi_ProPerty kv = (from m in pps
                                        where m.id == p.parentid
                                        select m).ToList().FirstOrDefault();
                    kv.Sort = p.id;//临时征用排序字段,存放规格
                    Currentpps.Add(kv);
                }
            }
            foreach (Lebi_ProPerty pp in Currentpps)
            {
                List <Lebi_ProPerty> cps = (from m in ps
                                            where m.parentid == pp.id
                                            select m).ToList();
                if (cps.Count == 0)
                {
                    continue;
                }


                res += "<dd class=\"cartOption\"><em>" + Lang(pp.Name) + ":</em><em><select name=\"select_same_goods_\" onChange=\"window.location=$(this).val();\">";

                foreach (Lebi_ProPerty p in cps)
                {
                    //计算对应的商品
                    string       propertystr = ("," + model.ProPerty131 + ",").Replace("," + pp.Sort + ",", "," + p.id + ",");
                    Lebi_Product pro         = (from m in pros
                                                where ("," + m.ProPerty131 + ",") == propertystr
                                                select m).ToList().FirstOrDefault();
                    if (pro == null)
                    {
                        continue;
                    }
                    if (pp.Sort == p.id)
                    {
                        res += " <option value=\"" + URL("P_Product", pro.id) + "\" selected>" + Lang(p.Name) + "</option>";
                    }
                    else
                    {
                        res += " <option value=\"" + URL("P_Product", pro.id) + "\">" + Lang(p.Name) + "</option>";
                    }
                }

                res += "</select></em><em></em></dd>";
            }
            return(res);
        }
示例#18
0
        public string GetproList(Lebi_ProPerty pmodel)
        {
            string str = "";

            List <Lebi_ProPerty> ps = B_Lebi_ProPerty.GetList("parentid=" + pmodel.id + "", "Sort desc");

            if (pmodel.Type_id_ProPertyType == 132)
            {
                foreach (Lebi_ProPerty p in ps)
                {
                    string sel = "";
                    if (("," + model.ProPerty132 + ",").Contains("," + p.id + ","))
                    {
                        sel = "checked";
                    }
                    str += " <label><input type=\"checkbox\" name=\"Property132\" shop=\"true\" " + sel + " value=\"" + p.id + "\"" + " />";
                    if (p.ImageUrl != "")
                    {
                        str += "<img src=\"" + Image(p.ImageUrl, 16, 16) + "\">";
                    }
                    str += Language.Content(p.Name, CurrentLanguage.Code) + "</label>";
                }
            }
            else if (pmodel.Type_id_ProPertyType == 133)
            {
                List <Lebi_Language_Code> langs = Language.Languages();
                KeyValue kv;
                try
                {
                    kv = (from m in ProPerty133
                          where m.K == pmodel.id.ToString()
                          select m).ToList().FirstOrDefault();
                }
                catch
                {
                    kv = new KeyValue();
                }
                if (kv == null)
                {
                    kv = new KeyValue();
                }
                foreach (Lebi_Language_Code lang in langs)
                {
                    string val = "";
                    if (kv != null && kv.V != null)
                    {
                        val = kv.V;
                    }
                    str += lang.Code + " <input type=\"text\" name=\"Property133_" + pmodel.id + lang.Code + "\" shop=\"true\" value=\"" + Language.Content(val, lang.Code) + "\"" + " class=\"input\"  /> ";
                }
            }
            else if (pmodel.Type_id_ProPertyType == 134)
            {
                foreach (Lebi_ProPerty p in ps)
                {
                    string sel = "";
                    if (("," + model.ProPerty134 + ",").Contains("," + p.id + ","))
                    {
                        sel = "checked";
                    }
                    str += " <label><input type=\"checkbox\" name=\"Property134\" shop=\"true\" " + sel + " value=\"" + p.id + "\"" + " />";
                    if (p.ImageUrl != "")
                    {
                        str += "<img src=\"" + Image(p.ImageUrl, 16, 16) + "\">";
                    }
                    str += Language.Content(p.Name, CurrentLanguage.Code) + "</label>";
                }
            }
            return(str);
        }