using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Validate_Name 的摘要说明
/// </summary>
namespace AjaxServer
{
    public class Validate_Name
    {
        [AjaxPro.AjaxMethod]
        public string CheckName(string name)
        {
            //在此调用业务逻辑
            bool result = BLL(name);
            return result == true ? "用户已存在,请换个用户名" : "用户不存在,你可以使用该用户名";
        }
        /// <summary>
        /// 业务逻辑
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        protected bool BLL(string name)
        {
            BLL.UserInfo user = new BLL.UserInfo();
            if (user.IsExist(name))
                return true;
            else
                return false;
        }
        public Validate_Name()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
    }
}