예제 #1
0
        private void navigation_validate(HttpContext context)
        {
            string navname  = OSRequest.GetString("param");
            string old_name = OSRequest.GetString("old_name");

            if (string.IsNullOrEmpty(navname))
            {
                context.Response.Write("{ \"info\":\"该导航菜单ID不可为空!\", \"status\":\"n\" }");
                return;
            }
            if (navname.ToLower() == old_name.ToLower())
            {
                context.Response.Write("{ \"info\":\"该导航菜单ID可使用\", \"status\":\"y\" }");
                return;
            }
            //检查保留的名称开头
            if (navname.ToLower().StartsWith("channel_"))
            {
                context.Response.Write("{ \"info\":\"该导航菜单ID系统保留,请更换!\", \"status\":\"n\" }");
                return;
            }
            BLL.contents.article_category bll = new BLL.contents.article_category();
            if (bll.Exists(navname))
            {
                context.Response.Write("{ \"info\":\"该导航菜单ID已被占用,请更换!\", \"status\":\"n\" }");
                return;
            }
            context.Response.Write("{ \"info\":\"该导航菜单ID可使用\", \"status\":\"y\" }");
            return;
        }
예제 #2
0
 private void navigation_validate(HttpContext context)
 {
     string navname = OSRequest.GetString("param");
     string old_name = OSRequest.GetString("old_name");
     if (string.IsNullOrEmpty(navname))
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID不可为空!\", \"status\":\"n\" }");
         return;
     }
     if (navname.ToLower() == old_name.ToLower())
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID可使用\", \"status\":\"y\" }");
         return;
     }
     //检查保留的名称开头
     if (navname.ToLower().StartsWith("channel_"))
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID系统保留,请更换!\", \"status\":\"n\" }");
         return;
     }
     BLL.contents.article_category bll = new BLL.contents.article_category();
     if (bll.Exists(navname))
     {
         context.Response.Write("{ \"info\":\"该导航菜单ID已被占用,请更换!\", \"status\":\"n\" }");
         return;
     }
     context.Response.Write("{ \"info\":\"该导航菜单ID可使用\", \"status\":\"y\" }");
     return;
 }