コード例 #1
0
        protected override void BeforePostback()
        {
            base.BeforePostback();
            lblAssessmentName.Text = gAssessment.GetAssessmentName(gAssessmentID);
            if (cmbAssessmentItems.DataSource == null)
            {
                cmbAssessmentItems.DataTextField  = nameof(ClsListAssessmentItem.Text);
                cmbAssessmentItems.DataValueField = nameof(ClsListAssessmentItem.ItemID);
                List <ClsListAssessmentItem> listAI = gAssessment.GetAssessmentItemListFromCache(gAssessmentID, true);
                if (listAI != null && listAI.Count > 0)
                {
                    listAI = listAI.FindAll(o => o.TypeID != Convert.ToInt32(Constants.enAssessmentItemType.PAGE_BREAK));
                }
                cmbAssessmentItems.DataSource = listAI;
                cmbAssessmentItems.DataBind();
                if (cmbAssessmentItems.Items.FindByValue("-1") == null)
                {
                    cmbAssessmentItems.Items.Insert(0, new ListItem("Please select...", "-1"));
                }

                cmbAssessmentItems.Enabled = true;
            }
            BindControlsToDataSources();
            if (gPageMode == Constants.enPageMode.UPDATE_DATA)
            {
                //fill the question information
                DataAccess.AssessmentItem objAssessment = gAssessment.GetAssessmentItemByItemIDFromCache(AssessmentItemID);
                FillControls(objAssessment);
                CheckIfTypeIsMultipleChoice();
                //fill choices
                ListChoice = gAssessment.GetAssessmentItemChoicesByItemIDFromCache(AssessmentItemID, true);
                ListSubAI  = gAssessment.GetSubAssessmentItemsByParentID(AssessmentItemID);
                Prepare_Choice_Section();
            }
        }
コード例 #2
0
 protected override void BeforePostback()
 {
     base.BeforePostback();
     lblAssessmentName.Text = gAssessment.GetAssessmentName(gAssessmentID);
     BindGrid();
 }