/// <summary> /// 供应商皮肤下拉框选项 /// </summary> public void GetSupplierSkinOptions() { int gid = RequestTool.RequestInt("groupid"); int id = RequestTool.RequestInt("id"); string str = "<option value=\"0\">┌ " + Tag("默认皮肤") + "</option>"; Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(gid); if (group != null) { if (group.Supplier_Skin_ids != "") { string sel = ""; List <Lebi_Supplier_Skin> models = B_Lebi_Supplier_Skin.GetList("id in (" + group.Supplier_Skin_ids + ")", ""); foreach (Lebi_Supplier_Skin model in models) { sel = ""; if (id == model.id) { sel = "selected"; } str += "<option value=\"" + model.id + "\" " + sel + ">" + model.Name + "</option>"; } } } Response.Write(str); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (id == 0) { if (!EX_Admin.Power("supplier_skin_add", "添加店铺皮肤")) { PageReturnMsg = PageNoPowerMsg(); } } else { if (!EX_Admin.Power("supplier_skin_edit", "编辑店铺皮肤")) { PageReturnMsg = PageNoPowerMsg(); } } model = B_Lebi_Supplier_Skin.GetModel(id); if (model == null) { model = new Lebi_Supplier_Skin(); } SkinContent = GetSkinStr(model); }
//public string GetSkins(int id) //{ // string str = ""; // List<Lebi_Supplier_Skin> skins = B_Lebi_Supplier_Skin.GetList("IsShow=1", "Sort desc"); // foreach (Lebi_Supplier_Skin skin in skins) // { // string sel = ""; // if (id == skin.id) // sel = "selected"; // str += "<option value=\"" + skin.id + "\" " + sel + ">" + skin.Name + "</option>"; // } // return str; //} public List <Lebi_Supplier_Skin> GetSkins() { try { List <Lebi_Supplier_Skin> skins = B_Lebi_Supplier_Skin.GetList("IsShow=1 and IsPublic=1 and id in (" + CurrentSupplierGroup.Supplier_Skin_ids + ",0," + model.Supplier_Skin_id + ")", "Sort desc"); return(skins); } catch { return(new List <Lebi_Supplier_Skin>()); } }
public string Skins(string ids) { string str = ""; List <Lebi_Supplier_Skin> models = B_Lebi_Supplier_Skin.GetList("IsShow=1", "Sort desc"); foreach (Lebi_Supplier_Skin model in models) { string sel = ""; if (("," + ids + ",").Contains("," + model.id + ",")) { sel = "checked"; } str += "<label><input name=\"Supplier_Skin_ids\" type=\"checkbox\" shop=\"true\" " + sel + " value=\"" + model.id + "\">" + model.Name + "</label>"; } return(str); }
public void Skin_Del() { if (!EX_Admin.Power("supplier_skin_del", "删除店铺皮肤")) { AjaxNoPower(); return; } string id = RequestTool.RequestString("ids"); if (id == "") { Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}"); return; } B_Lebi_Supplier_Skin.Delete("id in (lbsql{" + id + "})"); Log.Add("删除店铺皮肤", "Supplier_Skin", id.ToString(), CurrentAdmin, id.ToString()); Response.Write("{\"msg\":\"OK\"}"); }
/// <summary> /// 编辑、添加店铺模板 /// </summary> public void Skin_Edit() { int id = RequestTool.RequestInt("id", 0); Lebi_Supplier_Skin model = B_Lebi_Supplier_Skin.GetModel(id); if (model == null) { model = new Lebi_Supplier_Skin(); } B_Lebi_Supplier_Skin.BindForm(model); //if (model.IsPage == 1) // model.Code = ""; if (model.id == 0) { if (!EX_Admin.Power("supplier_skin_add", "添加店铺皮肤")) { AjaxNoPower(); return; } B_Lebi_Supplier_Skin.Add(model); id = B_Lebi_Supplier_Skin.GetMaxId(); Log.Add("添加店铺皮肤", "Supplier_Skin", id.ToString(), CurrentAdmin, model.Name); } else { if (!EX_Admin.Power("supplier_skin_edit", "编辑店铺皮肤")) { AjaxNoPower(); return; } B_Lebi_Supplier_Skin.Update(model); Log.Add("编辑店铺皮肤", "Supplier_Skin", id.ToString(), CurrentAdmin, model.Name); } //生成页面 string SkinContent = Request["Content"]; string SkinPath = model.Path.TrimEnd('/') + "/index.html"; GreatSkin(SkinPath, SkinContent); string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}"; Response.Write(result); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_skin", "编辑皮肤")) { PageReturnMsg = PageNoPowerMsg(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Supplier.GetModel("User_id = " + CurrentSupplier.User_id + ""); if (model == null) { model = new Lebi_Supplier(); } Lebi_Supplier_Skin skin = B_Lebi_Supplier_Skin.GetModel(id); if (skin != null) { model.Supplier_Skin_id = skin.id; model.head = skin.head; model.shortbar = skin.shortbar; model.longbar = skin.longbar; } }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("supplier_skin_list", "店铺皮肤列表")) { PageReturnMsg = PageNoPowerMsg(); } PageSize = RequestTool.getpageSize(25); key = RequestTool.RequestString("key"); type = RequestTool.RequestString("type"); string where = "1=1"; if (key != "") { where += " and Name like lbsql{'%" + key + "%'}"; } if (type != "") { where += " and type=lbsql{'" + type + "'}"; } models = B_Lebi_Supplier_Skin.GetList(where, "Sort desc", PageSize, page); int recordCount = B_Lebi_Supplier_Skin.Counts(where); PageString = Pager.GetPaginationString("?page={0}&key=" + key, page, PageSize, recordCount); }
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\">»</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); } } } }
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\">»</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a><em>»</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>»</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); } } }