Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UPSurveyAnswer"/> class.
 /// </summary>
 /// <param name="question">The question.</param>
 /// <param name="root">The root.</param>
 public UPSurveyAnswer(UPQuestionnaireQuestion question, UPSurvey root)
     : this(null, null, question, root)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UPSurveyPath"/> class.
 /// </summary>
 /// <param name="survey">The survey.</param>
 public UPSurveyPath(UPSurvey survey)
 {
     this.Survey        = survey;
     this.Questionnaire = this.Survey.Questionnaire;
     this.Build();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UPSurveyAnswer"/> class.
        /// </summary>
        /// <param name="recordIdentification">The record identification.</param>
        /// <param name="data">The data.</param>
        /// <param name="question">The question.</param>
        /// <param name="root">The root.</param>
        public UPSurveyAnswer(string recordIdentification, Dictionary <string, object> data, UPQuestionnaireQuestion question, UPSurvey root)
        {
            this.RecordIdentification = recordIdentification;
            this.Question             = question;
            this.Root = root;
            if (this.Question.Multiple)
            {
                this.singleAnswerDictionary = new Dictionary <string, UPSurveyAnswerSingle>();
                this.AddAnswer(data, recordIdentification);
            }

            this.AnswerText = data[Constants.QuestionnaireAnswer] as string;
            if (this.Question.AnswersFromCatalog && this.Question.Questionnaire.Manager.SaveCatalogValuesAsText)
            {
                this.AnswerText = this.Question.AnswerIdForText(this.AnswerText) ?? string.Empty;
            }

            this.AnswerNumber = data[Constants.QuestionnaireAnswerNumber] as string;
        }