每篇新闻的访问量
#region 修改访问量
/// <summary>
/// 修改访问量
/// </summary>
/// <param name="id">新闻ID</param>
/// <param name="traffic">访问量</param>
/// <returns></returns>
public bool UpdateTraffic(string id)
{
bool flag = false;
string sql = "update news set traffic=traffic+1 where id=@id";
SqlParameter[] paras = new SqlParameter[] {
new SqlParameter("@id", id)
};
int res = sqlhelper.ExecuteNonQuery(sql, paras, CommandType.Text);
if (res > 0)
{
flag = true;
}
return flag;
}
#endregion