Exemple #1
0
 public bool UpdateVerse(Verse verse)
 {
     using (var database = new VersesSQLiteConnection(Path))
     {
         if (database.VerseExists(verse.Title))
         {
             database.UpdateVerse(verse);
             return(true);
         }
         return(false);
     }
 }
Exemple #2
0
        public bool UpdateVerse(string verseTitle)
        {
            using (var database = new VersesSQLiteConnection(Path))
            {
                if (database.VerseExists(verseTitle))
                {
                    var verse = database.GetVerse(verseTitle);
                    database.UpdateVerse(verse);

                    return(true);
                }
                return(false);
            }
        }
Exemple #3
0
        public bool AddVerse(Verse verse)
        {
            var title = verse.Title;

            using (var database = new VersesSQLiteConnection(Path))
            {
                if (database.VerseExists(title))
                {
                    return(false);
                }
                database.AddVerse(verse);
                return(true);
            }
        }
Exemple #4
0
        public bool UpdateVerseMemorizationEnabled(string verseTitle, bool enabled)
        {
            using (var database = new VersesSQLiteConnection(Path))
            {
                if (database.VerseExists(verseTitle))
                {
                    var verse = database.GetVerse(verseTitle);
                    verse.Memorizable = true;

                    database.UpdateVerse(verse);
                    return(true);
                }
                return(false);
            }
        }
Exemple #5
0
        public bool MoveVerseToCategory(int verseId, MemorizationCategory category)
        {
            using (var database = new VersesSQLiteConnection(Path))
            {
                if (database.VerseExists(verseId))
                {
                    var verse = database.GetVerse(verseId);
                    verse.Category = category;
                    database.UpdateVerse(verse);

                    return(true);
                }
                return(false);
            }
        }