示例#1
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()));
                        }
                    }
                }
            }
        }
示例#2
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()));
         }
     }
 }