Beispiel #1
0
        private void SetupDropdown()
        {
            var isTesting            = SessionVariables.IsTesting;
            var questionCategoryData = QuestionCategoryDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(questionCategoryData, drpCategoryList, StandardDataModel.StandardDataColumns.Name, QuestionCategoryDataModel.DataColumns.QuestionCategoryId);

            if (isTesting)
            {
                drpCategoryList.AutoPostBack = true;
                if (drpCategoryList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtCategoryId.Text.Trim()))
                    {
                        drpCategoryList.SelectedValue = txtCategoryId.Text;
                    }
                    else
                    {
                        txtCategoryId.Text = drpCategoryList.SelectedItem.Value;
                    }
                }
                txtCategoryId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtCategoryId.Text.Trim()))
                {
                    drpCategoryList.SelectedValue = txtCategoryId.Text;
                }
            }
        }
Beispiel #2
0
        private DataTable GetQuestionCategoryData(int questionId)
        {
            //var dt = QuestionCategoryDataManager.GetByQuestion(QuestionId, SessionVariables.RequestProfile);
            QuestionDataModel data = new QuestionDataModel();

            data.QuestionId = questionId;
            var dt       = QuestionDataManager.GetDetails(data, SessionVariables.RequestProfile);
            var fdt      = QuestionCategoryDataManager.GetList(SessionVariables.RequestProfile);
            var resultdt = fdt.Clone();

            foreach (DataRow row in dt.Rows)
            {
                var rows = fdt.Select("QuestionCategoryId = " + row[QuestionCategoryDataModel.DataColumns.QuestionCategoryId]);
                resultdt.ImportRow(rows[0]);
            }
            return(resultdt);
        }
Beispiel #3
0
        private DataTable GetQuestionCategoryList()
        {
            var dt = QuestionCategoryDataManager.GetList(SessionVariables.RequestProfile);

            return(dt);
        }