/// <summary> /// Removes user name entry along with password from userNameTable /// </summary> public void DeleteEntry() { string query = String.Format( "DELETE FROM {0} WHERE id=\"{1}\"", DatabaseOperations.userNameTable, GetCurrentUserID() ); dbOperations.ExecuteNonQueryCommand(query); }
/// <summary> /// Adds record to database entriesTable. /// Note - content column should be encrypted /// </summary> /// <param name="index">Index of content.</param> /// <param name="content">Content to be written to the database, /// if security is a concern content should be encrypted.</param> /// <param name="time">Time of entry in clipboarder.</param> public void SetTextContent(EncryptedTextContent contentToAdd) { string command = String.Format( "INSERT INTO {0}('indexNumber', 'content', 'time', 'byUser') VALUES({1},\'{2}\',\'{3}\',\'{4}\');", DatabaseOperations.textEntriesTable, contentToAdd.index, contentToAdd.encryptedText, contentToAdd.time, user.id); dbOperations.ExecuteNonQueryCommand(command); }