예제 #1
0
파일: WebPage.cs 프로젝트: plz821/entCMS
 /// <summary>
 /// 获取当前栏目的路径(当前位置)
 /// </summary>
 /// <returns></returns>
 public string GetNavStr(string delimiter = " &gt ")
 {
     if (string.IsNullOrEmpty(NodeCode))
     {
         throw new ArgumentNullException("栏目无效!");
     }
     if (string.IsNullOrEmpty(delimiter))
     {
         delimiter = " &gt ";
     }
     return(NewsCatalogService.GetInstance().GetNavStr(NodeCode, delimiter));
 }
예제 #2
0
파일: WebPage.cs 프로젝트: plz821/entCMS
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="addTags"></param>
        /// <returns></returns>
        public string GetNodeUrl(string node, bool addTags)
        {
            cmsNewsCatalog c = NewsCatalogService.GetInstance().Get(node);

            return(getNodeUrl(c, addTags));
        }
예제 #3
0
파일: WebPage.cs 프로젝트: plz821/entCMS
 /// <summary>
 /// 获取某栏目的子栏目集合
 /// </summary>
 /// <returns></returns>
 public List <cmsNewsCatalog> GetChildNodes(string nodeCode, bool isLike)
 {
     return(NewsCatalogService.GetInstance().GetChildList(nodeCode, isLike, true));
 }
예제 #4
0
파일: WebPage.cs 프로젝트: plz821/entCMS
 /// <summary>
 /// 获取某栏目下的第一个子栏目
 /// </summary>
 /// <param name="parentCode"></param>
 /// <returns></returns>
 private cmsNewsCatalog getFirstNode(string parentCode)
 {
     return(NewsCatalogService.GetInstance().GetFirstChildNode(parentCode));
 }
예제 #5
0
파일: Ajax.ashx.cs 프로젝트: plz821/entCMS
        private void DoCatalogActions(string action)
        {
            NewsCatalogService ncs = NewsCatalogService.GetInstance();

            if (action.Equals("CatalogOrder"))
            {
                string code  = Request["Code"];
                string order = Request["Order"];

                int r = ncs.ChangeOrder(code, int.Parse(order));
                if (r > 0)
                {
                    json = "{\"result\":1}";
                }
                else
                {
                    json = "{\"result\":0, \"msg\":\"服务器发生错误,排序失败!\"}";
                }
            }
            else if (action.Equals("CatalogNavigate"))
            {
                string code = Request["Code"];

                int r = ncs.Nav(code);
                if (r > 0)
                {
                    json = "{\"result\":1}";
                }
                else
                {
                    json = "{\"result\":0, \"msg\":\"服务器发生错误,状态改变失败!\"}";
                }
            }
            else if (action.Equals("CatalogEnable"))
            {
                string code = Request["Code"];

                int r = ncs.Enable(code);
                if (r > 0)
                {
                    json = "{\"result\":1}";
                }
                else
                {
                    json = "{\"result\":0, \"msg\":\"服务器发生错误,状态改变失败!\"}";
                }
            }
            else if (action.Equals("CatalogDelete"))
            {
                string code = Request["Code"];

                List <cmsNewsCatalog> ls = ncs.GetChildList(code, null);
                if (ls.Count > 0)
                {
                    json = "{\"result\":0, \"msg\":\"本栏目下有子栏目,不能被删除!\"}";
                }
                else
                {
                    int r = ncs.Delete(code);
                    if (r > 0)
                    {
                        json = "{\"result\":1}";
                    }
                    else
                    {
                        json = "{\"result\":0, \"msg\":\"服务器发生错误,删除失败!\"}";
                    }
                }
            }
        }
예제 #6
0
 private void InitControls()
 {
     lblPosition.Text = NewsCatalogService.GetInstance().GetNavStr(NodeCode, " >> ");
 }