/// <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; } }
/// <summary> /// Updates this instance of SurveyQuestionAnswer. Returns true on success. /// </summary> /// <returns>bool</returns> private bool Update() { return(DBQuestionAnswer.Update( AnswerGuid, QuestionGuid, ResponseGuid, Answer )); }
/// <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 )); }
/// <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); }
/// <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); }