Beispiel #1
0
        public async Task <bool> SaveMotivationLineAsync(MotivationLine newMotivationLine)
        {
            if (newMotivationLine.ID == 0)//Add new motivationline
            {
                int result = await database.InsertAsync(newMotivationLine);

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

                if (result == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Beispiel #2
0
        public async Task <bool> DeleteMotivationLineAsync(MotivationLine motivationLineToDelete)
        {
            int result = await database.DeleteAsync(motivationLineToDelete);

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