Пример #1
0
 /// <summary>
 /// fill the jump box, if paging is available
 /// </summary>
 private void AddPagesInJumpBoxDataSource(JumpBoxQuesitonCollection questionList)
 {
     foreach (DataRow Row in this._QuestionnaireDataSet.Tables[TableNames.PagesTable].Rows)
     {
         if (Convert.ToInt32(Row[PagesTableColumns.PageNumber]) > 0)
         {
             questionList.Add(new JumpBoxQuestion(Row[PagesTableColumns.PageNumber].ToString(), Constants.PageText + Row[PagesTableColumns.PageNumber].ToString()));
         }
     }
 }
Пример #2
0
        /// <summary>
        /// fill the jump box, if paging is not available
        /// </summary>
        private void AddQuestionsINJumpBoxDataSource(JumpBoxQuesitonCollection questionList)
        {
            DataTable TempDataTable = GetSortedTempQuestionTable();
            string QuestionKey = Constants.QuestionPrefix + "%";
            string DataValue = string.Empty;

            bool Required = false;

            TempDataTable.DefaultView.RowFilter = QuestionTableColumns.QuestionKey + " like '" + QuestionKey + "'";

            foreach (DataRowView Row in TempDataTable.DefaultView)
            {
                //string Type = Questionnarie.GetAnswerType(Row[QuestionTableColumns.AnswerType].ToString()).ToString();
                string Type = Row[QuestionTableColumns.AnswerType].ToString();

                //get data value
                if (Row[QuestionTableColumns.DataValue] != null)
                {
                    DataValue = Row[QuestionTableColumns.DataValue].ToString();
                }
                else
                {
                    DataValue = string.Empty;

                }

                //get value of required field
                Required = Convert.ToBoolean(Row[QuestionTableColumns.Required]);

                AnswerType AnsType = Questionnarie.GetAnswerType(Type);

                if (AnsType == AnswerType.Aggregate | AnsType == AnswerType.Calculate | string.IsNullOrEmpty(Row[QuestionTableColumns.QuestionText].ToString().Trim()))
                {
                    // Do Nothing

                }
                else
                {
                    if (Convert.ToBoolean(Row[QuestionTableColumns.Visible]))
                    {
                        // if question is mandatory and datavalue is empty
                        if (this._AutoTrackMandatoryQuestions & string.IsNullOrEmpty(DataValue) & Required)
                        {
                            questionList.Add(new JumpBoxQuestion(Row[QuestionTableColumns.QuestionKey].ToString(), Constants.MarkForMandatoryQuestion + Row[QuestionTableColumns.QuestionNo].ToString()));
                        }
                        else
                        {
                            questionList.Add(new JumpBoxQuestion(Row[QuestionTableColumns.QuestionKey].ToString(), Row[QuestionTableColumns.QuestionNo].ToString()));
                        }
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// fill the jumb box on the basis of paging
        /// </summary>
        private void AddJumpBoxquestions()
        {
            try
            {
                this._JumpBoxDataSource = new JumpBoxQuesitonCollection();

                // add mandatory question

                #region -- change no 5 --

                //add interviewer question only if it exists
                if (this.IsInterviewerQuestionExists == true)
                {
                    this._JumpBoxDataSource.Add(new JumpBoxQuestion(MandatoryQuestionsKey.INTERVIEWER, this.GetTranslatedValue(MandatoryQuestionsKey.INTERVIEWER)));
                }
                #endregion

                this._JumpBoxDataSource.Add(new JumpBoxQuestion(MandatoryQuestionsKey.Area, this.GetTranslatedValue(KeyForMultiLanguage.AreaName)));

                if (this.DisplayGPsQuestion)
                {
                    this._JumpBoxDataSource.Add(new JumpBoxQuestion(MandatoryQuestionsKey.GPS, this.GetTranslatedValue(KeyForMultiLanguage.GPS)));
                }

                this._JumpBoxDataSource.Add(new JumpBoxQuestion(MandatoryQuestionsKey.TimePeriod, this.GetTranslatedValue(KeyForMultiLanguage.TimePeriod)));
                this._JumpBoxDataSource.Add(new JumpBoxQuestion(MandatoryQuestionsKey.SorucePublisher, this.GetTranslatedValue(KeyForMultiLanguage.Source)));

                // add other questions or pages
                if (this.Paging)
                {
                    this.AddPagesInJumpBoxDataSource(this._JumpBoxDataSource);
                }
                else
                {
                    this.AddQuestionsINJumpBoxDataSource(this._JumpBoxDataSource);
                }
            }
            catch (Exception ex)
            {
            }
        }