private void Save() { int?questionId = null; int surveyId = int.Parse(MetaSurveyId); // save question MetadataSurveyQuestion question = new MetadataSurveyQuestion(); if (!string.IsNullOrEmpty(QuestionId.Value)) { questionId = int.Parse(QuestionId.Value); question.Get(questionId.Value); } else { question[MetadataSurveyQuestion.MetadataSurveyId] = surveyId; } CICHelper.SetBOValues(this.Controls, question, surveyId); question.Save(); questionId = (int)question[MetadataSurveyQuestion.MetadataSurveyQuestionId]; // save responses SurveyQuestionResponsesGrid.Save(questionId.Value); // rebuild form PopulateForm(questionId); ReloadMainPage(surveyId.ToString()); }
private void PopulateResponses(int?questionId) { DataView responses = null; if (questionId.HasValue) { responses = BusinessObject.GetByParentAsDataView <MetadataQuestionResponse>(questionId.Value); } else { responses = new MetadataQuestionResponse[0].AsDataView <MetadataQuestionResponse>(); } SurveyQuestionResponsesGrid.DataSource = responses; SurveyQuestionResponsesGrid.DataBind(); }