Exemple #1
0
 public void AddPrayer(Prayer prayer)
 {
     using (var database = new VersesSQLiteConnection(Path))
     {
         database.AddPrayer(prayer);
     }
 }
Exemple #2
0
 public IEnumerable <Verse> GetMemorizationsForCategory(MemorizationCategory category)
 {
     using (var database = new VersesSQLiteConnection(Path))
     {
         return(database.GetMemorizationsForCategory(category));
     }
 }
Exemple #3
0
 public IEnumerable <Prayer> GetPrayers()
 {
     using (var database = new VersesSQLiteConnection(Path))
     {
         return(database.GetAllPrayers());
     }
 }
Exemple #4
0
 public bool UpdatePrayer(Prayer prayer)
 {
     using (var database = new VersesSQLiteConnection(Path))
     {
         if (database.PrayerExists(prayer.Id))
         {
             database.UpdatePrayer(prayer);
             return(true);
         }
         return(false);
     }
 }
Exemple #5
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 #6
0
        public bool UpdatePrayer(string prayerTitle)
        {
            using (var database = new VersesSQLiteConnection(Path))
            {
                if (database.PrayerExists(prayerTitle))
                {
                    var prayer = database.GetPrayer(prayerTitle);
                    database.UpdatePrayer(prayer);

                    return(true);
                }
                return(false);
            }
        }
Exemple #7
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 #8
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 #9
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 #10
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);
            }
        }