Example #1
0
        private CharacterTable ConvertToCharacterTable(Character character)
        {
            CharacterTable characterTable = new CharacterTable()
            {
                Id          = character.Id,
                Name        = character.Name,
                Description = character.Description,
                Modified    = character.Modified,
                Comics      = character.Comics.ToString(),
                Path        = character.Thumbnail.Path,
                Extension   = character.Thumbnail.Extension,
            };

            return(characterTable);
        }
Example #2
0
        //Delete Data Operation

        public bool RemoveTable(Character character)
        {
            try
            {
                CharacterTable characterTable = ConvertToCharacterTable(character);
                using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, "Characters.db")))
                {
                    connection.Delete(characterTable);
                    return(true);
                }
            }
            catch (SQLiteException)
            {
                return(false);
            }
        }
Example #3
0
        private Character ConvertToCharacter(CharacterTable characterTable)
        {
            Character character = new Character()
            {
                Id          = characterTable.Id,
                Name        = characterTable.Name,
                Description = characterTable.Description,
                Modified    = characterTable.Modified,
                Comics      = characterTable.Comics.ToString(),
                Thumbnail   = new Image()
                {
                    Path      = characterTable.Path,
                    Extension = characterTable.Extension
                }
            };

            return(character);
        }