Пример #1
0
        /// <summary>
        /// 删除自定义结点
        /// </summary>
        public void UserNode_Del()
        {
            if (!EX_Admin.Power("node_del", "删除自定义结点"))
            {
                EX_Admin.NoPower();
                return;
            }
            string ids      = RequestTool.RequestString("ids");
            string PageCode = RequestTool.RequestString("PageCode");

            if (ids != "")
            {
                List <Lebi_Node> nodes = B_Lebi_Node.GetList("id in (lbsql{" + ids + "})", "");
                foreach (Lebi_Node node in nodes)
                {
                    B_Lebi_Node.Delete("id=" + node.id + " or parentid=" + node.id + "");
                    B_Lebi_Page.Delete("Node_id=" + node.id + "");
                }

                string action      = Tag("删除自定义结点");
                string description = "";
                Log.Add(action, "Node", ids, CurrentAdmin, description);
            }
            if (PageCode == "P_Help")
            {
                Lebi_Theme_Page themepage = B_Lebi_Theme_Page.GetModel("Code='P_Help'");
                if (themepage.Type_id_PublishType == 122)
                {
                    PageStatic.Greate_Help(themepage);
                }
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Пример #2
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_Article'");
     id          = Rint_Para("0");
     parentnode  = Node("Info");
     pageindex   = RequestTool.RequestInt("page", 1);
     node        = B_Lebi_Node.GetModel(id);
     nodes       = B_Lebi_Node.GetList("parentid=" + parentnode.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "Sort desc,id desc");
     if (node == null)
     {
         node = nodes.FirstOrDefault();
     }
     path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_Article", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a>";
     if (node != null)
     {
         path += "<em>&raquo;</em><a href=\"" + URL("P_Article", node.id) + "\"><span>" + node.Name + "</span></a>";
     }
     if (node == null)
     {
         node = new Lebi_Node();
     }
     string where = "Node_id=" + node.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'";
     pages        = B_Lebi_Page.GetList(where, "Sort desc,id desc", PageSize, pageindex);
     recordCount  = B_Lebi_Page.Counts(where);
     PageString   = Shop.Bussiness.Pager.GetPaginationStringForWeb("?id=" + id + "&page={0}", pageindex, PageSize, recordCount, CurrentLanguage);
     FootPage     = PageString;
     NextPage     = "?id=" + id + "&page=" + (pageindex + 1) + "";
 }
Пример #3
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_About'");
     id          = Rint_Para("0");
     node        = Node("About");
     page        = B_Lebi_Page.GetModel(id);
     pages       = B_Lebi_Page.GetList("Node_id=" + node.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "Sort desc");
     if (page == null)
     {
         page = pages.FirstOrDefault();
     }
     else
     {
         page.Count_Views += 1;
         B_Lebi_Page.Update(page);
     }
     path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_About", "") + "\"><span>" + Tag(node.Name) + "</span></a>";
     if (page != null)
     {
         path += "<em>&raquo;</em><a href=\"" + URL("P_About", page.id) + "\"><span>" + page.Name + "</span></a>";
     }
     if (page == null)
     {
         page = new Lebi_Page();
     }
 }
Пример #4
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();
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("image_del", "删除图库"))
            {
                PageNoPower();
            }
            PageSize = RequestTool.getpageSize(25);
            int Node_id = RequestTool.RequestInt("Node_id", 0);

            node = B_Lebi_Node.GetModel(Node_id);
            if (node == null)
            {
                Response.Write("参数错误");
                Response.End();
            }
            pnode = B_Lebi_Node.GetModel(node.parentid);
            if (pnode == null)
            {
                pnode = new Lebi_Node();
            }
            string where = "Node_id=" + node.id + "";
            int recordCount = B_Lebi_Page.Counts(where);

            pages      = B_Lebi_Page.GetList(where, "Sort desc,id desc", PageSize, page);
            PageString = Pager.GetPaginationString("?page={0}", page, PageSize, recordCount);
        }
Пример #6
0
        /// <summary>
        /// 导航子类
        /// </summary>
        public void NavSon()
        {
            int nodeid = RequestTool.RequestInt("nodeid", 0);
            List <Lebi_Page> models      = B_Lebi_Page.GetList("Node_id=" + nodeid + " and Language='" + CurrentLanguage.Code + "'", "Sort desc,id desc");
            StringBuilder    builderTree = new StringBuilder();

            foreach (Lebi_Page model in models)
            {
                // builderTree.Append(string.Format("<option value=\"{0}\">{1}</option>  \r\n", ThemeUrl.u , model.Name));
            }
        }
Пример #7
0
        /// <summary>
        /// 文章查看页面
        /// </summary>
        /// <param name="lang"></param>
        /// <param name="model"></param>
        /// <param name="theme"></param>
        /// <param name="urlpath"></param>
        private void P_ArticleDetails(List <Lebi_Language> langs, Lebi_Theme_Page model, string urlpath)
        {
            string   url;
            string   file    = "";
            DateTime time1   = RequestTool.RequestTime("time1");
            DateTime time2   = RequestTool.RequestTime("time2");
            string   nodeids = RequestTool.RequestString("node");

            if (nodeids == null)
            {
                return;
            }
            int pageindex = RequestTool.RequestInt("pageindex", 0);
            int pagesize  = RequestTool.RequestInt("pagesize", 0);

            string where = "Time_Add>='" + time1 + "' and Time_Add<='" + time2 + "'";
            if (nodeids != "")
            {
                where += " and Node_id in (" + nodeids + ") ";
            }
            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 = RegexTool.ReplaceRegValue(file, @"{.*?}", "");
                        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 + "\"}");
        }
Пример #8
0
        /// <summary>
        /// 文章阅读一次
        /// </summary>
        public void PageView()
        {
            int       id    = RequestTool.RequestInt("id");
            Lebi_Page model = B_Lebi_Page.GetModel(id);

            if (model != null)
            {
                model.Count_Views++;
                B_Lebi_Page.Update(model);
            }
            Response.Write("{\"msg\":\"NO\"}");
        }
Пример #9
0
        public string GetTreeString(int parentID, int deep)
        {
            string           str   = "";
            List <Lebi_Node> nodes = B_Lebi_Node.GetList("parentid=" + parentID + "", "Sort desc");

            if (nodes.Count > 0)
            {
                foreach (Lebi_Node node in nodes)
                {
                    str += "<tr class=\"list\" onDblClick=\"Node_Edit(0," + node.id + ")\">";
                    str += "<td><strong>";
                    str += node.Code;
                    str += "</strong></td>";

                    str += "<td>" + node.Sort + "</td>";
                    if (deep == 0)
                    {
                        str += "<td><strong>" + node.Name + "</strong></td>";
                    }
                    else
                    {
                        str += "<td>" + GetDeep("<label class=\"subFlag\">┗</label>" + node.Name, deep) + "</td>";
                    }
                    str += "<td>";
                    str += NodePage.NodeType(node.TypeFlag);
                    str += "</td>";
                    str += "<td>";
                    str += (node.IsLanguages == 1?"Yes":"No");
                    str += "</td>";
                    str += "<td>";
                    str += B_Lebi_Page.Counts("node_id=" + node.id + "").ToString();
                    str += "</td>";

                    str += "<td>";
                    //str += "<a href=\"#\" onclick=\"UpdateNode(" + node.ParentNodeID + ",0);\">" + Tag("创建同级结点") + "</a>";
                    //str += "<span class=\"editSep\">|</span>";

                    str += "<a href=\"#\" onclick=\"Node_Edit(0," + node.id + ");\">" + Tag("修改") + "</a>";
                    str += " | ";
                    str += "<a href=\"#\" onclick=\"Node_Del(" + node.id + ");\">" + Tag("删除") + "</a>";
                    if (node.haveson == 1)
                    {
                        str += " | ";
                        str += "<a href=\"#\" onclick=\"Node_Edit(" + node.id + ",0);\">" + Tag("创建子结点") + "</a>";
                    }
                    str += "</td>";
                    str += "</tr>";
                    str += GetTreeString(node.id, deep + 1);
                }
                //str += "</ul>  \r\n";
            }
            return(str);
        }
Пример #10
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     pageindex = RequestTool.RequestInt("page", 1);
     LoadTheme(themecode, siteid, languagecode, pcode);
     CurrentPage  = B_Lebi_Theme_Page.GetModel("Code='P_News'");
     node         = Node("News");
     path         = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_News", "") + "\"><span>" + Tag(node.Name) + "</span></a>";
     string where = "Node_id=" + node.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'";
     pages        = B_Lebi_Page.GetList(where, "Sort desc,id desc", PageSize, pageindex);
     recordCount  = B_Lebi_Page.Counts(where);
     PageString   = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}", pageindex, PageSize, recordCount, CurrentLanguage);
     FootPage     = PageString;
     NextPage     = "?page=" + (pageindex + 1) + "";
 }
Пример #11
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);
        }
Пример #12
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;
            }
        }
Пример #13
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);
        }
Пример #14
0
        /// <summary>
        /// 删除店铺幻灯图片
        /// </summary>
        public void indeximage_Del()
        {
            if (!EX_Admin.Power("indeximage_del", "删除店铺幻灯"))
            {
                AjaxNoPower();
                return;
            }

            string id = RequestTool.RequestSafeString("ids");

            if (id == "")
            {
                Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}");
                return;
            }
            B_Lebi_Page.Delete("id in (lbsql{" + id + "}) and Supplier_id=" + CurrentSupplier.id + "");
            Log.Add("删除店铺幻灯", "Page", id.ToString(), CurrentSupplier, id.ToString());
            Response.Write("{\"msg\":\"OK\"}");
        }
Пример #15
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 + "\"}");
        }
Пример #16
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_NewsDetails'");
            int id = Rint_Para("0");

            node = Node("News");
            page = B_Lebi_Page.GetModel(id);
            if (page == null)
            {
                PageError();
            }
            else
            {
                page.Count_Views += 1;
                B_Lebi_Page.Update(page);
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_News", "") + "\"><span>" + Tag(node.Name) + "</span></a><em>&raquo;</em><a href=\"" + URL("P_NewsDetails", page.id) + "\"><span>" + page.Name + "</span></a>";
        }
Пример #17
0
        /// <summary>
        /// 关于我们页面
        /// </summary>
        private void P_About(List <Lebi_Language> langs, Lebi_Theme_Page model, string urlpath)
        {
            string    url;
            string    file      = "";
            int       pageindex = RequestTool.RequestInt("pageindex", 0);
            int       pagesize  = RequestTool.RequestInt("pagesize", 0);
            Lebi_Node node      = NodePage.GetNodeByCode("About");

            string where = "Node_id=" + node.id + "";
            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 = RegexTool.ReplaceRegValue(file, @"{.*?}", "");
                        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);
                    }
                }
            }
        }
Пример #18
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_ArticleDetails'");
            id          = Rint_Para("0");
            parentnode  = Node("Info");
            nodes       = B_Lebi_Node.GetList("Parentid=" + parentnode.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "Sort desc");
            page        = B_Lebi_Page.GetModel(id);
            if (page == null)
            {
                node = nodes.FirstOrDefault();
                page = NodePage.GetPageByNode(node);
                if (page == null)
                {
                    PageError();
                }
            }
            else
            {
                page.Count_Views += 1;
                B_Lebi_Page.Update(page);
                node = B_Lebi_Node.GetModel(page.Node_id);
            }

            string where = "Node_id=" + node.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'";
            PreviousPage = B_Lebi_Page.GetModel(where + " and Sort>=" + page.Sort + " and id>" + page.id + " order by Sort asc,id asc");
            NextPage     = B_Lebi_Page.GetModel(where + " and Sort<=" + page.Sort + " and id<" + page.id + " order by Sort desc,id desc");
            if (PreviousPage == null)
            {
                PreviousPage = new Lebi_Page();
            }
            if (NextPage == null)
            {
                NextPage = new Lebi_Page();
            }

            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_Article", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a><em>&raquo;</em><a href=\"" + URL("P_Article", node.id) + "\"><span>" + node.Name + "</span></a><em>&raquo;</em><a href=\"" + URL("P_ArticleDetails", page.id) + "\"><span>" + page.Name + "</span></a>";
        }
Пример #19
0
        /// <summary>
        /// 删除页面
        /// </summary>
        public void Page_Del()
        {
            if (!EX_Admin.Power("page_del", "删除结点内容"))
            {
                AjaxNoPower();
                return;
            }
            string id = RequestTool.RequestString("ids");

            if (id == "")
            {
                Response.Write("{\"msg" + Tag("参数错误") + "\"}");
                return;
            }
            B_Lebi_Page.Delete("id in (lbsql{" + id + "})");
            //删除图片
            ImageHelper.LebiImagesDelete("page", id);
            string action      = Tag("删除结点内容");
            string description = id;

            Log.Add(action, "Page", id, CurrentAdmin, description);
            Response.Write("{\"msg\":\"OK\"}");
        }
Пример #20
0
        /// <summary>
        /// 编辑页面
        /// </summary>
        public void Page_Edit()
        {
            int       id    = RequestTool.RequestInt("id", 0);
            Lebi_Page model = B_Lebi_Page.GetModel(id);

            if (model == null)
            {
                model = new Lebi_Page();
            }
            B_Lebi_Page.BindForm(model);
            model.Language_ids = RequestTool.RequestSafeString("Language_ids");
            model.Language     = Language.LanuageidsToCodes(model.Language_ids);
            if (model.id == 0)
            {
                if (!EX_Admin.Power("page_add", "添加结点内容"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Add(model);
                id = B_Lebi_Page.GetMaxId();
                string action      = Tag("添加结点内容");
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentAdmin, description);
            }
            else
            {
                if (!EX_Admin.Power("page_edit", "编辑结点内容"))
                {
                    AjaxNoPower();
                    return;
                }
                B_Lebi_Page.Update(model);
                string action      = Tag("编辑结点内容");
                string description = model.Name;
                Log.Add(action, "Page", id.ToString(), CurrentAdmin, description);
            }
            //=========================================
            //处理静态页面
            Lebi_Node       node = B_Lebi_Node.GetModel(model.Node_id);
            Lebi_Theme_Page themepage;

            if (node.Code == "About")
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_About'");
            }
            else if (node.Code == "News")
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_NewsDetails'");
            }
            else if (node.Code == "Help")
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_Help'");
            }
            else
            {
                themepage = B_Lebi_Theme_Page.GetModel("Code='P_ArticleDetails'");
            }
            if (themepage.Type_id_PublishType == 122)//静态发布页面
            {
                if (node.Code == "Help")
                {
                    PageStatic.Greate_Help(themepage);
                }
                else
                {
                    PageStatic.Greate_InfoPage(model, themepage);
                }
            }
            ImageHelper.LebiImagesUsed(model.ImageOriginal, "page", id);
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + id + "\"}");
        }
Пример #21
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());
        }
Пример #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("page_add", "添加结点内容"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            PageSize = RequestTool.getpageSize(25);
            node     = B_Lebi_Node.GetModel(Node_id);
            if (node == null)
            {
                string NodeCode = RequestTool.RequestString("code");
                node = B_Lebi_Node.GetModel("Code=lbsql{'" + NodeCode + "'}");
                if (node == null)
                {
                    PageReturnMsg = PageErrorMsg();
                }
            }

            pnode = B_Lebi_Node.GetModel(node.parentid);
            if (pnode == null)
            {
                pnode = new Lebi_Node();
            }
            lang     = RequestTool.RequestString("lang");
            key      = RequestTool.RequestString("key");
            dateFrom = RequestTool.RequestString("dateFrom");
            dateTo   = RequestTool.RequestString("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            string where = "Node_id=" + node.id + "";
            if (key != "")
            {
                where += " and Name like lbsql{'%" + key + "%'}";
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_Add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
            }
            if (lang != "")
            {
                where += " and Language like lbsql{'%" + lang + "%'}";
            }
            if (site.SiteCount > 1 && CurrentAdmin.Site_ids != "")
            {
                string sonwhere         = "";
                List <Lebi_Language> ls = B_Lebi_Language.GetList("Site_id in (" + CurrentAdmin.Site_ids + ")", "");
                foreach (Lebi_Language l in ls)
                {
                    if (sonwhere == "")
                    {
                        sonwhere = "','+Language_ids+',' like '%," + l.id + ",%'";
                    }
                    else
                    {
                        sonwhere += " or ','+Language_ids+',' like '%," + l.id + ",%'";
                    }
                }
                if (sonwhere != "")
                {
                    where += " and (" + sonwhere + " or Language_ids='')";
                }
            }
            int recordCount = B_Lebi_Page.Counts(where);

            pages      = B_Lebi_Page.GetList(where, "Sort desc,id desc", PageSize, page);
            PageString = Pager.GetPaginationString("?page={0}&Node_id=" + node.id + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&lang=" + lang + "&key=" + key, page, PageSize, recordCount);
        }
Пример #23
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_Help'");
     id          = Rint_Para("0");
     pageid      = Rint_Para("1");
     type        = Rstring("type");
     parentnode  = Node("Help");
     nodes       = B_Lebi_Node.GetList("Parentid=" + parentnode.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "Sort desc");
     if (id == 0 && type != "")
     {
         node = new Lebi_Node();
         if (type == "agreement")
         {
             Name    = Tag("注册协议");
             Content = Lang(SYS.ServiceP).Replace("\n", "<br/>");
         }
         node.Name = Name;
         path      = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_Help", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Tag(Name) + "</span></a>";
     }
     else
     {
         node = B_Lebi_Node.GetModel(id);
         if (node == null)
         {
             node = nodes.FirstOrDefault();
             if (node == null)
             {
                 node = new Lebi_Node();
                 //PageError();
             }
             else
             {
                 id = node.id;
             }
         }
         //else
         //{
         //    if (node.id == id)
         //    {
         //        node = nodes.FirstOrDefault();
         //    }
         //}
         pages = B_Lebi_Page.GetList("Node_id=" + node.id + "", "id desc");
         if (pages == null)
         {
             pages = new List <Lebi_Page>();
         }
         path = "<a href=\"" + CurrentLanguage.Path + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_Help", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a>";
         page = B_Lebi_Page.GetModel("id=" + pageid + "");
         if (page == null)
         {
             page = pages.FirstOrDefault();
             if (pages.FirstOrDefault() == null)
             {
                 pageid = 0;
             }
             else
             {
                 pageid = page.id;
             }
         }
         else
         {
             path += "<em>&raquo;</em><a href=\"" + URL("P_Help", node.id) + "\"><span>" + node.Name + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + page.Name + "</span></a>";
         }
         //Help_Content.pages = pages;
     }
 }
Пример #24
0
        public string GetTreeString(int parentID, int deep)
        {
            string str = "";

            string where = "parentid=" + parentID + "";
            if (lang != "")
            {
                where += " and Language Like lbsql{'%" + lang + "%'}";
            }
            if (key != "")
            {
                where += " and [Name] like lbsql{'%" + key + "%'}";
            }
            if (site.SiteCount > 1 && CurrentAdmin.Site_ids != "")
            {
                string sonwhere         = "";
                List <Lebi_Language> ls = B_Lebi_Language.GetList("Site_id in (" + CurrentAdmin.Site_ids + ")", "");
                foreach (Lebi_Language l in ls)
                {
                    if (sonwhere == "")
                    {
                        sonwhere = "','+Language_ids+',' like '%," + l.id + ",%'";
                    }
                    else
                    {
                        sonwhere += " or ','+Language_ids+',' like '%," + l.id + ",%'";
                    }
                }
                if (sonwhere != "")
                {
                    where += " and (" + sonwhere + " or Language_ids='')";
                }
            }
            List <Lebi_Node> nodes = B_Lebi_Node.GetList(where, "Sort desc");

            if (nodes.Count > 0)
            {
                foreach (Lebi_Node node in nodes)
                {
                    str += "<tr class=\"list\" onDblClick=\"Node_Edit(0," + node.id + ")\">";
                    str += "<td style=\"text-align:center\"><input type=\"checkbox\" name=\"ids\" del=\"true\" value=\"" + node.id + "\" /></td>";
                    str += "<td>" + node.id + "</td>";
                    str += "<td><div class=\"more\" style=\"width: 80px;\" title=\"" + LanguageName(node.Language_ids) + "\">" + LanguageName(node.Language_ids) + "</div></td>";
                    if (deep == 0)
                    {
                        str += "<td><a href=\"" + NodePage.AdminIndexPage(node) + "\" >" + node.Name + "</a></td>";
                    }
                    else
                    {
                        str += "<td>" + GetDeep("<label class=\"subFlag\">┗</label>" + node.Name, deep) + "</td>";
                    }
                    str += "<td>";
                    str += B_Lebi_Page.Counts("node_id=" + node.id + "").ToString();
                    str += "</td>";
                    str += "<td>" + node.ShowMode + "</td>";
                    str += "<td>" + node.Sort + "</td>";
                    str += "<td style=\"text-align:left\">";

                    str += "<a href=\"#\" onclick=\"Node_Edit(0," + node.id + ");\">" + Tag("编辑") + "</a>";


                    if (node.haveson == 1)
                    {
                        str += "<span class=\"editSep\"> | </span>";
                        str += "<a href=\"#\" onclick=\"Node_Edit(" + node.id + ",0);\">" + Tag("创建子分类") + "</a>";
                    }
                    else
                    {
                        str += " | ";
                        str += "<a href=\"" + NodePage.AdminIndexPage(node) + "\" >" + Tag("进入") + "</a>";
                    }

                    str += "</td>";
                    str += "</tr>";
                    str += GetTreeString(node.id, deep + 1);
                }
                //str += "</ul>  \r\n";
            }

            return(str);
        }