/// <summary> /// 用于判断一个IP是否参加过这次活动 /// </summary> /// <param name="IP"></param> /// <returns></returns> public int GetRoteInfoCountByIP(int AID, String IP) { String sql = "SELECT COUNT(RU.RUID) FROM RoteUser AS RU INNER JOIN RoteInfo AS RI ON RI.RUID=RU.RUID AND RI.RIP=@RIP AND AID=@AID"; return(Convert.ToInt32(DataBaseOpen.QueryOne(sql, new SqlParameter[] { new SqlParameter("@RIP", IP), new SqlParameter("@AID", AID) }))); }
public int GetCount(int AID = 0) { String sql = "SELECT COUNT(RUID) FROM RoteUser" + (AID == 0 ? "" : " WHERE AID=" + AID); return(Convert.ToInt32(DataBaseOpen.QueryOne(sql))); }