Ejemplo n.º 1
0
        public List <Verse> GetMemorizationsForCategory(MemorizationCategory category)
        {
            var verses = (from t in Table <Verse> ()
                          where t.Category == category && t.Memorizable select t).ToList();

            return(verses);
        }
Ejemplo n.º 2
0
 public IEnumerable <Verse> GetMemorizationsForCategory(MemorizationCategory category)
 {
     using (var database = new VersesSQLiteConnection(Path))
     {
         return(database.GetMemorizationsForCategory(category));
     }
 }
Ejemplo n.º 3
0
        void ButtonHandler(MemorizationCategory category)
        {
            var path   = DatabaseSetupHelper.GetDatabasePath("verses.db3");
            var db     = new DatabaseHelper(path);
            var verses = db.GetVerses().ToList();

            NavigationController.PushViewController(new MemorizationDialogViewController(verses, category), true);
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
            void MoveVerseToCategory(MemorizationCategory category)
            {
                var elements = section.Elements;

                foreach (MemorizationElement element in elements)
                {
                    var verse = element.VerseForElement;

                    if (element.ElementIsSelected && verse.Category != category)
                    {
                        verse.Category = category;

                        if (category == MemorizationCategory.Review)
                        {
                            verse.Memorized = true;
                        }

                        var dbPath = DatabaseSetupHelper.GetDatabasePath("verses.db3");
                        var db     = new DatabaseHelper(dbPath);
                        db.UpdateVerse(verse);
                    }
                }
            }
 public MemorizationDialogViewController(List <Verse> verses, MemorizationCategory category) : base(null, false)
 {
     data = verses;
     memorizationCategory = category;
 }