public bool RequestExists(int requestID) { if (this.requests.ContainsKey(requestID)) { return(true); } using (IQueryAdapter queryreactor = ButterflyEnvironment.GetDatabaseManager().GetQueryReactor()) { queryreactor.SetQuery("SELECT user_one_id FROM messenger_friendships WHERE user_one_id = @myID AND user_two_id = @friendID"); queryreactor.AddParameter("myID", this.UserId); queryreactor.AddParameter("friendID", requestID); return(queryreactor.FindsResult()); } }
public bool RequestExists(int requestID) { if (_requests.ContainsKey(requestID)) { return(true); } using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery( "SELECT user_one_id FROM messenger_friendships WHERE user_one_id = @myID AND user_two_id = @friendID"); dbClient.AddParameter("myID", Convert.ToInt32(_userId)); dbClient.AddParameter("friendID", Convert.ToInt32(requestID)); return(dbClient.FindsResult()); } }