示例#1
0
        /// <summary>
        /// Gets an instance of SurveyQuestionAnswer.
        /// </summary>
        /// <param name="answerGuid"> answerGuid </param>
        private void GetSurveyQuestionAnswer(
            Guid questionGuid, Guid responseGuid)
        {
            bool found = false;

            using (IDataReader reader = DBQuestionAnswer.GetOne(responseGuid, questionGuid))
            {
                if (reader.Read())
                {
                    this.answerGuid   = new Guid(reader["AnswerGuid"].ToString());
                    this.questionGuid = new Guid(reader["QuestionGuid"].ToString());
                    this.responseGuid = new Guid(reader["ResponseGuid"].ToString());
                    this.answer       = reader["Answer"].ToString();
                    this.answeredDate = Convert.ToDateTime(reader["AnsweredDate"]);
                    found             = true;
                }
            }

            if (!found)
            {
                this.answerGuid   = new Guid();
                this.questionGuid = questionGuid;
                this.responseGuid = responseGuid;
            }
        }
示例#2
0
 /// <summary>
 /// Updates this instance of SurveyQuestionAnswer. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBQuestionAnswer.Update(
                AnswerGuid,
                QuestionGuid,
                ResponseGuid,
                Answer
                ));
 }
示例#3
0
 /// <summary>
 /// Updates this instance of SurveyQuestionAnswer. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBQuestionAnswer.Update(
                this.answerGuid,
                this.questionGuid,
                this.responseGuid,
                this.answer
                ));
 }
示例#4
0
        /// <summary>
        /// Persists a new instance of SurveyQuestionAnswer. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            this.answerGuid = Guid.NewGuid();

            int rowsAffected = DBQuestionAnswer.Add(
                this.answerGuid,
                this.questionGuid,
                this.responseGuid,
                this.answer);

            return(rowsAffected > 0);
        }
示例#5
0
        /// <summary>
        /// Persists a new instance of SurveyQuestionAnswer. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            AnswerGuid = Guid.NewGuid();

            int rowsAffected = DBQuestionAnswer.Add(
                AnswerGuid,
                QuestionGuid,
                ResponseGuid,
                Answer
                );

            return(rowsAffected > 0);
        }