Пример #1
0
 public void ClearReadItem()
 {
     _readItemItem = null;
 }
Пример #2
0
 public void SetReadItem(ReadItem readItemItem)
 {
     _readItemItem = readItemItem;
 }
Пример #3
0
        public static void InsertNewReadingItem(ReadItem item)
        {
            try
            {
                using (SQLiteConnection sqLiteConnection = new SQLiteConnection(ConnectionString))
                {
                    sqLiteConnection.Open();
                    using (SQLiteCommand insertCommand = new SQLiteCommand(sqLiteConnection))
                    {
                        insertCommand.CommandText =
                            "INSERT INTO READING_LIST (MANGA_ID, READ_STARTING_CHAPTER, READ_CURRENT_CHAPTER, READ_ONLINE_URL, " +
                            "READ_IS_FINISHED, READ_LAST_TIME, READ_NOTE) VALUES (?, ?, ?, ?, ?, ?, ?)";
                        insertCommand.Parameters.AddWithValue(null, GetMangaId(item.Title));
                        insertCommand.Parameters.AddWithValue(null, item.StartingChapter);
                        insertCommand.Parameters.AddWithValue(null, item.CurrentChapter);
                        insertCommand.Parameters.AddWithValue(null, item.OnlineUrl);
                        insertCommand.Parameters.AddWithValue(null, item.FinishedReading);
                        insertCommand.Parameters.AddWithValue(null, item.LastRead);
                        insertCommand.Parameters.AddWithValue(null, item.PersonalNote);
                        insertCommand.ExecuteNonQuery();
                    }
                    sqLiteConnection.Close();
                }
            }

            catch (Exception ex)
            {
                ErrorHandler.HandleException(ex);
            }
        }