#region 验证账户是否重复
/// <summary>
/// 验证账号是否重复
/// </summary>
/// <param name="_name">需要验证的账户名</param>
/// <returns>true:存在,false:不存在</returns>
public bool VilidationUserName(string _name)
{
string sql = "select * from 表 where UserName = @UserName";
SqlParameter[] paras = {
new SqlParameter("@UserName",SqlDbType.VarChar)
};
paras[0].Value = _name;
DataTable dt = SqlHelper.ExecuteDataTable(SqlHelper.connstr, CommandType.Text, sql, paras);
try
{
if (dt.Rows.Count > 0)
{
return true;
}
else
{
return false;
}
}
catch
{
return false;
}
}
#endregion
/// <summary>
/// 验证账号是否重复
/// </summary>
/// <param name="_name">需要验证的账户名</param>
/// <returns>true:存在,false:不存在</returns>
public bool VilidationUserName(string _name)
{
return dal.VilidationUserName(_name);
}