private async Task <List <string> > GetAllTablesAsync() { string sqlText = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG = 'chat-hub-db'"; List <string> listOfTableNames = await SQLQueryExecutor.ExecuteQuery(sqlText, Configuration); return(listOfTableNames); }
public async Task <List <ChatMessage> > GetAllChatMessagesThatHaveNotBeenSeenByYou(string yourPhoneNum) { string sql = "SELECT " + "*" + " FROM " + "[" + yourPhoneNum + "] " + "WHERE " + ApplicationConstants.SEEN_COLUMN + "=" + "'no';"; List <ChatMessage> listOfChatMsgsHaveNotBeenSeen = await SQLQueryExecutor.ExecuteQueryToReturnChatMessages(sql, Configuration); return(listOfChatMsgsHaveNotBeenSeen); }
public async Task <List <string> > GetIDsOfYourMessagesSeenByFriend(string friendPhoneNum, string yourPhoneNum) { string sql = "SELECT " + ApplicationConstants.MSG_ID + " FROM " + "[" + friendPhoneNum + "] " + "WHERE " + ApplicationConstants.MSG_PHONE_NUM_WRITER + "=" + "'" + yourPhoneNum + "' " + "AND " + ApplicationConstants.SEEN_COLUMN + "=" + "'yes';"; List <string> listOfIDs = await SQLQueryExecutor.ExecuteGetSeenMessagesQuery(sql, Configuration); return(listOfIDs); }
public async Task <bool> IsUserTableInDatabase(string userPhoneNum) { string sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES " + "WHERE TABLE_NAME ='" + userPhoneNum + "';"; List <string> tableNames = await SQLQueryExecutor.ExecuteQuery(sql, Configuration); if (tableNames.Count > 0) { System.Diagnostics.Debug.WriteLine("tableNames count > 0"); return(true); } else { System.Diagnostics.Debug.WriteLine("tableNames count = 0"); return(false); } }