Esempio n. 1
0
        private void urlrewrite_name_validate(HttpContext context)
        {
            string new_name = MXRequest.GetString("param");
            string old_name = MXRequest.GetString("old_name");

            if (string.IsNullOrEmpty(new_name))
            {
                context.Response.Write("{ \"info\":\"名称不可为空!\", \"status\":\"n\" }");
                return;
            }
            if (new_name.ToLower() == old_name.ToLower())
            {
                context.Response.Write("{ \"info\":\"该名称可使用\", \"status\":\"y\" }");
                return;
            }
            BLL.url_rewrite bll = new BLL.url_rewrite();
            if (bll.Exists(new_name))
            {
                context.Response.Write("{ \"info\":\"该名称已被使用,请更换!\", \"status\":\"n\" }");
                return;
            }
            context.Response.Write("{ \"info\":\"该名称可使用\", \"status\":\"y\" }");
            return;
        }
 private void urlrewrite_name_validate(HttpContext context)
 {
     string new_name = MXRequest.GetString("param");
     string old_name = MXRequest.GetString("old_name");
     if (string.IsNullOrEmpty(new_name))
     {
         context.Response.Write("{ \"info\":\"名称不可为空!\", \"status\":\"n\" }");
         return;
     }
     if (new_name.ToLower() == old_name.ToLower())
     {
         context.Response.Write("{ \"info\":\"该名称可使用\", \"status\":\"y\" }");
         return;
     }
     BLL.url_rewrite bll = new BLL.url_rewrite();
     if (bll.Exists(new_name))
     {
         context.Response.Write("{ \"info\":\"该名称已被使用,请更换!\", \"status\":\"n\" }");
         return;
     }
     context.Response.Write("{ \"info\":\"该名称可使用\", \"status\":\"y\" }");
     return;
 }