Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("usernode_add", "添加自定义结点"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            int Node_id = RequestTool.RequestInt("Node_id", 0);

            UserNode = B_Lebi_Node.GetModel(Node_id);
            lang     = RequestTool.RequestString("lang");
            key      = RequestTool.RequestString("key");
            if (UserNode == null)
            {
                code = RequestTool.RequestString("code");
                if (code == "")
                {
                    code = "UserNode";
                }
                UserNode = NodePage.GetNodeByCode(code);
            }
            if (UserNode.Code == "Help")
            {
                PageCode = "P_Help";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id  = RequestTool.RequestInt("id", 0);
            int pid = RequestTool.RequestInt("pid", 0);

            model = B_Lebi_Node.GetModel(id);
            if (model == null)
            {
                if (!EX_Admin.Power("usernode_add", "添加自定义结点"))
                {
                    WindowNoPower();
                }
                model = new Lebi_Node();
                model.Type_id_PublishType = 120;
                model.haveson             = 1;
            }
            else
            {
                if (!EX_Admin.Power("usernode_edit", "编辑自定义结点"))
                {
                    WindowNoPower();
                }
                pid = model.parentid;
            }
            PNode = B_Lebi_Node.GetModel(pid);
            if (PNode == null)
            {
                PNode = new Lebi_Node();
            }
            string code = RequestTool.RequestString("code");

            Topnode = NodePage.GetNodeByCode(code);
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id  = RequestTool.RequestInt("id", 0);
            int pid = RequestTool.RequestInt("pid", 0);

            model = B_Lebi_Node.GetModel(id);
            if (model == null)
            {
                if (!EX_Admin.Power("usernode_add", "添加自定义结点"))
                {
                    WindowNoPower();
                }
                model = new Lebi_Node();
            }
            else
            {
                if (!EX_Admin.Power("usernode_edit", "编辑自定义结点"))
                {
                    WindowNoPower();
                }
                pid = model.parentid;
            }
            PNode = B_Lebi_Node.GetModel(pid);
            if (PNode == null)
            {
                PNode = new Lebi_Node();
            }
            UserNode = NodePage.GetNodeByCode("UserNode");
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("usernode_add", "添加自定义结点"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            string code = RequestTool.RequestString("code");

            Topnode = NodePage.GetNodeByCode(code);
        }
        /// <summary>
        /// 文章分类
        /// </summary>
        /// <returns></returns>
        public string Article()
        {
            Lebi_Node        node  = NodePage.GetNodeByCode("Info");
            List <Lebi_Node> nodes = B_Lebi_Node.GetList("parentid=" + node.id + "", "");
            string           str   = "<tr><th>" + Tag("类别") + ":</th><td>";

            foreach (Lebi_Node n in nodes)
            {
                str += "<input type=\"checkbox\" name=\"node\" value=\"" + n.id + "\" shop=\"true\" >" + n.Name + "</br>";
            }
            str += "</td></tr>";
            return(str);
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int Page_id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Page.GetModel(Page_id);
            node  = NodePage.GetNodeByCode("shopindeximages");
            if (node == null)
            {
                PageReturnMsg = PageErrorMsg();
            }
            if (model == null)
            {
                model             = new Lebi_Page();
                model.Supplier_id = CurrentSupplier.id;
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PageSize = RequestTool.getpageSize(25);

            node = NodePage.GetNodeByCode("shopindeximages");
            if (node == null)
            {
                PageReturnMsg = PageErrorMsg();
            }

            string where = "Node_id=" + node.id + " and Supplier_id=" + CurrentSupplier.id;
            int recordCount = B_Lebi_Page.Counts(where);

            pages      = B_Lebi_Page.GetList(where, "Sort desc,id desc", PageSize, page);
            PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}", page, PageSize, recordCount);
        }
Example #8
0
        /// <summary>
        /// 新闻详情页面
        /// </summary>
        /// <param name="lang"></param>
        /// <param name="model"></param>
        /// <param name="theme"></param>
        /// <param name="urlpath"></param>
        private void P_NewsDetails(List <Lebi_Language> langs, Lebi_Theme_Page model, string urlpath)
        {
            string    url;
            Lebi_Node pnode     = NodePage.GetNodeByCode("News");
            DateTime  time1     = RequestTool.RequestTime("time1");
            DateTime  time2     = RequestTool.RequestTime("time2");
            int       pageindex = RequestTool.RequestInt("pageindex", 0);
            int       pagesize  = RequestTool.RequestInt("pagesize", 0);
            string    file      = "";

            string where = "Node_id=" + pnode.id + "  and Time_Add>='" + time1 + "' and Time_Add<='" + time2 + "'";
            List <Lebi_Page> pages = B_Lebi_Page.GetList(where, "", pagesize, pageindex);
            int count     = B_Lebi_Page.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_Page page in pages)
            {
                foreach (Lebi_Language lang in langs)
                {
                    if (page.Language.ToLower().Contains(lang.Code.ToLower()))
                    {
                        site = GetSite(sites, lang.Site_id);
                        file = site.Path + "/" + lang.Path + "/" + model.StaticPath + "/" + model.StaticPageName;
                        file = file.Replace("{0}", page.id.ToString());
                        file = ThemeUrl.CheckPath(file);

                        url = model.PageName + "?" + model.PageParameter;
                        url = url.Replace("{0}", page.id.ToString());
                        url = urlpath + "/" + site.Path + "/" + lang.Path + "/" + url;
                        url = ThemeUrl.CheckURL(url);
                        HtmlEngine.Instance.CreatHtml(url, file);
                    }
                }
            }
            Response.Write("{\"msg\":\"OK\",\"per\":\"" + per + "\"}");
        }
Example #9
0
        /// <summary>
        /// 帮助中心页面
        /// </summary>
        /// <param name="lang"></param>
        /// <param name="model"></param>
        /// <param name="theme"></param>
        /// <param name="urlpath"></param>
        private void P_Help(List <Lebi_Language> langs, Lebi_Theme_Page model, string urlpath)
        {
            string    url;
            Lebi_Node pnode     = NodePage.GetNodeByCode("Help");
            string    file      = "";
            int       pageindex = RequestTool.RequestInt("pageindex", 0);
            int       pagesize  = RequestTool.RequestInt("pagesize", 0);

            string where = "parentid=" + pnode.id + "";
            List <Lebi_Node> nodes = B_Lebi_Node.GetList(where, "", pagesize, pageindex);
            int count     = B_Lebi_Node.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_Node node in nodes)
            {
                foreach (Lebi_Language lang in langs)
                {
                    if (node.Language.ToLower().Contains(lang.Code.ToLower()))
                    {
                        site = GetSite(sites, lang.Site_id);
                        file = site.Path + "/" + lang.Path + "/" + model.StaticPath + "/" + model.StaticPageName;
                        file = file.Replace("{0}", node.id.ToString());
                        file = RegexTool.ReplaceRegValue(file, @"{.*?}", "");
                        file = ThemeUrl.CheckPath(file);

                        url = model.PageName + "?" + model.PageParameter;
                        url = url.Replace("{0}", node.id.ToString());
                        url = urlpath + "/" + site.Path + "/" + lang.Path + "/" + url;
                        url = RegexTool.ReplaceRegValue(url, @"{.*?}", "");
                        url = ThemeUrl.CheckURL(url);
                        HtmlEngine.Instance.CreatHtml(url, file);
                    }
                }
            }
            Response.Write("{\"msg\":\"OK\",\"per\":\"" + per + "\"}");
        }
Example #10
0
        public List <shopindeximage> Getindeximages(int top)
        {
            List <shopindeximage> indeximgaes = new List <shopindeximage>();
            Lebi_Node             node        = NodePage.GetNodeByCode("shopindeximages");

            if (node != null)
            {
                List <Lebi_Page> ps = B_Lebi_Page.GetList("Node_id=" + node.id + " and Supplier_id=" + supplier.id + "", "Sort desc", top, 1);
                foreach (Lebi_Page p in ps)
                {
                    shopindeximage img = new shopindeximage();
                    img.image = p.ImageOriginal;
                    img.title = p.Name;
                    img.url   = p.url;
                    indeximgaes.Add(img);
                }
            }
            return(indeximgaes);
        }
Example #11
0
        /// <summary>
        /// 编辑|添加店铺幻灯图片
        /// </summary>
        public void indeximage_Edit()
        {
            int       id    = RequestTool.RequestInt("id", 0);
            Lebi_Page model = B_Lebi_Page.GetModel(id);
            Lebi_Node node  = NodePage.GetNodeByCode("shopindeximages");

            if (model == null)
            {
                model = new Lebi_Page();
            }
            B_Lebi_Page.SafeBindForm(model);
            model.Supplier_id = CurrentSupplier.id;
            model.Node_id     = node.id;
            if (model.id == 0)
            {
                if (!Power("indeximage_add", "添加店铺幻灯"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Add(model);
                id = B_Lebi_Page.GetMaxId();
                string action      = "添加店铺幻灯";
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentSupplier, description);
            }
            else
            {
                if (!Power("indeximage_edit", "编辑店铺幻灯"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Update(model);
                string action      = Tag("编辑店铺幻灯");
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentSupplier, description);
            }
            //=========================================
            //处理静态页面
            ImageHelper.LebiImagesUsed(model.ImageOriginal, "page", id);
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + id + "\"}");
        }
Example #12
0
        /// <summary>
        /// 编辑自定义结点
        /// </summary>
        public void CustomNode_Edit()
        {
            int       id      = RequestTool.RequestInt("id", 0);
            string    code    = RequestTool.RequestString("parentcode");
            Lebi_Node topnode = NodePage.GetNodeByCode(code);
            Lebi_Node model   = B_Lebi_Node.GetModel(id);

            if (model == null)
            {
                model = new Lebi_Node();
            }
            B_Lebi_Node.BindForm(model);
            if (topnode.IsLanguages == 1)
            {
                model.Name = Language.RequestString("Name");
            }
            if (model.id == 0)
            {
                if (!EX_Admin.Power("usernode_add", "添加自定义结点"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Node.Add(model);
                id = B_Lebi_Node.GetMaxId();
                string action      = Tag("添加自定义结点");
                string description = model.Name;
                Log.Add(action, "Node", model.id.ToString(), CurrentAdmin, description);
            }
            else
            {
                if (!EX_Admin.Power("usernode_edit", "编辑自定义结点"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Node.Update(model);
                string action      = Tag("编辑自定义结点");
                string description = model.Name;
                Log.Add(action, "Node", model.id.ToString(), CurrentAdmin, description);
            }
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + id + "\"}");
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int Node_id = RequestTool.RequestInt("Node_id", 0);
            int Page_id = RequestTool.RequestInt("Page_id", 0);

            page = B_Lebi_Page.GetModel(Page_id);
            if (page != null)
            {
                if (!EX_Admin.Power("page_edit", "编辑结点内容"))
                {
                    PageReturnMsg = PageNoPowerMsg();
                }

                Node_id = page.Node_id;
            }
            else
            {
                if (!EX_Admin.Power("page_add", "添加结点内容"))
                {
                    PageReturnMsg = PageNoPowerMsg();
                }

                page = new Lebi_Page();
            }
            node = B_Lebi_Node.GetModel(Node_id);
            if (node == null)
            {
                node = new Lebi_Node();
            }
            pnode = B_Lebi_Node.GetModel(node.parentid);
            if (pnode == null)
            {
                pnode = new Lebi_Node();
            }
            UserNode = NodePage.GetNodeByCode("UserNode");
        }
Example #14
0
 public Lebi_Node GetNode(string code)
 {
     return(NodePage.GetNodeByCode(code));
 }
Example #15
0
        /// <summary>
        /// 递归生成下拉菜单
        /// </summary>
        /// <param name="depth"></param>
        /// <param name="parentID"></param>
        /// <param name="nodeID"></param>
        /// <returns></returns>
        public string GetMenu(string url)
        {
            StringBuilder    builderTree = new StringBuilder();
            List <Lebi_Node> nodes       = new List <Lebi_Node>();
            Lebi_Node        pnode;

            string[] arr   = url.Split(':');
            string   code  = "";
            string   value = "";

            if (arr.Length > 1)
            {
                code  = arr[0];
                value = arr[1];
            }
            string sel = "";

            //添加自定义文章
            pnode = NodePage.GetNodeByCode("Info", 0);
            if (code == "P_Article" && value == pnode.id.ToString())
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Article\" value=\"\" " + sel + ">" + pnode.Name + "</option>");
            nodes = B_Lebi_Node.GetList("parentid =" + pnode.id + "", "");
            if (nodes.Count > 0)
            {
                foreach (Lebi_Node node in nodes)
                {
                    sel = "";
                    if (code == "P_Article" && value == node.id.ToString())
                    {
                        sel = "selected";
                    }
                    builderTree.Append(string.Format("<option code=\"P_Article\" value=\"{0}\" " + sel + "> |- {1}</option>  \r\n", node.id, node.Name));
                }
            }
            //添加帮助中心
            pnode = NodePage.GetNodeByCode("Help", 0);
            sel   = "";
            if (code == "P_Help" && value == pnode.id.ToString())
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Help\" value=\"\" " + sel + ">" + pnode.Name + "</option>");
            nodes = B_Lebi_Node.GetList("parentid =" + pnode.id + "", "");
            if (nodes.Count > 0)
            {
                foreach (Lebi_Node node in nodes)
                {
                    sel = "";
                    if (code == "P_Help" && value == node.id.ToString())
                    {
                        sel = "selected";
                    }
                    builderTree.Append(string.Format("<option code=\"P_Help\" value=\"{0}\" " + sel + "> |- {1}</option>  \r\n", node.id, node.Name));
                }
            }
            //添加公司介绍
            pnode = NodePage.GetNodeByCode("About", 0);
            sel   = "";
            if (code == "P_About" && value == "0")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_About\" value=\"\" " + sel + ">" + pnode.Name + "</option>");
            List <Lebi_Page> ps = B_Lebi_Page.GetList("Node_id =" + pnode.id + "", "");

            if (ps.Count > 0)
            {
                foreach (Lebi_Page p in ps)
                {
                    sel = "";
                    if (code == "P_About" && value == p.id.ToString())
                    {
                        sel = "selected";
                    }
                    builderTree.Append(string.Format("<option code=\"P_About\" value=\"{0}\" " + sel + "> |- {1}</option>  \r\n", p.id, p.Name));
                }
            }
            //添加商城动态
            pnode = NodePage.GetNodeByCode("News", 0);
            sel   = "";
            if (code == "P_News" && value == pnode.id.ToString())
            {
                sel = "selected";
            }
            builderTree.Append(string.Format("<option code=\"P_News\" value=\"{0}\" " + sel + ">{1}</option>  \r\n", pnode.id, pnode.Name));
            //添加商品专题
            //List<Lebi_Tab> ts = B_Lebi_Tab.GetList("", "Tsort desc");
            //if (ts.Count > 0)
            //{
            //    foreach (Lebi_Tab t in ts)
            //    {
            //        sel = "";
            //        if (code == "P_Tab" && value == t.id.ToString())
            //            sel = "selected";
            //        builderTree.Append(string.Format("<option code=\"P_Tab\" value=\"{0}\" " + sel + ">[" + Tag("商品专题") + "]{1}</option>  \r\n", t.id, Language.Content(t.Tname, CurrentLanguage)));
            //    }

            //}
            sel = "";
            if (code == "P_Index")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Index\" value=\"\" " + sel + ">" + Tag("首页") + "</option>");
            sel = "";
            if (code == "P_Inquiry")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Inquiry\" value=\"\" " + sel + ">" + Tag("留言反馈") + "</option>");
            sel = "";
            if (code == "P_LimitBuy")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_LimitBuy\" value=\"\" " + sel + ">" + Tag("限时抢购") + "</option>");
            sel = "";
            if (code == "P_GroupPurchase")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_GroupPurchase\" value=\"\" " + sel + ">" + Tag("团购") + "</option>");
            sel = "";
            if (code == "P_Exchange")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Exchange\" value=\"\" " + sel + ">" + Tag("积分换购") + "</option>");
            sel = "";
            if (code == "P_AllProductCategories")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_AllProductCategories\" value=\"\" " + sel + ">" + Tag("全部商品分类") + "</option>");
            sel = "";
            if (code == "P_Basket")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Basket\" value=\"\" " + sel + ">" + Tag("购物车") + "</option>");
            sel = "";
            if (code == "P_FriendLink")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_FriendLink\" value=\"\" " + sel + ">" + Tag("友情链接") + "</option>");
            sel = "";
            if (code == "P_ProductCommentIndex")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_ProductCommentIndex\" value=\"\" " + sel + ">" + Tag("商品晒单") + "</option>");
            sel = "";
            if (code == "P_Register")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Register\" value=\"\" " + sel + ">" + Tag("会员注册") + "</option>");
            sel = "";
            if (code == "P_Login")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_Login\" value=\"\" " + sel + ">" + Tag("会员登录") + "</option>");
            sel = "";
            if (code == "P_UserCenter")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_UserCenter\" value=\"\" " + sel + ">" + Tag("会员中心") + "</option>");
            sel = "";
            if (code == "P_BrandList")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_BrandList\" value=\"\" " + sel + ">" + Tag("品牌列表") + "</option>");
            sel = "";
            if (code == "P_SupplierRegister")
            {
                sel = "selected";
            }
            builderTree.Append("<option code=\"P_SupplierRegister\" value=\"\" " + sel + ">" + Tag("供应商注册") + "</option>");
            sel = "";
            if (url.Contains("/"))
            {
                sel = "selected";
            }
            builderTree.Append("<option value=\"0\" " + sel + ">" + Tag("自定义") + "</option>");
            return(builderTree.ToString());
        }