Exemplo n.º 1
0
        public async Task <bool> SaveJokeLineAsync(JokeLine newJokeLine)
        {
            if (newJokeLine.ID == 0)//Add new jokeLine
            {
                int result = await database.InsertAsync(newJokeLine);

                if (result == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else// Update this jokeLine, it already exists
            {
                int result = await database.UpdateAsync(newJokeLine);

                if (result == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Exemplo n.º 2
0
        public async Task <bool> DeleteJokeLineAsync(JokeLine jokeLineToDelete)
        {
            int result = await database.DeleteAsync(jokeLineToDelete);

            if (result == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }