Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="userAnswer"></param>
        /// <returns></returns>
        public bool SaveAnswer(int userID, UserAnswer userAnswer)
        {
            userAnswer.UserAnswerHandler = new UserAnswerImpliementation(this);
            var UserAnswers = GetUserAnswer(userID);

            if (UserAnswers.Where(x => x.Question == userAnswer.Question && x.UserID == userID).ToList().Count > 0)
            {
                userAnswer.Update();
            }
            else
            {
                userAnswer.Save();
            }


            return(true);
        }
Esempio n. 2
0
 public bool Clear(UserAnswer userAnswer)
 {
     userAnswer.UserAnswerHandler = new UserAnswerImpliementation(this);
     return(userAnswer.Clear());
 }