/// <summary> /// /// </summary> /// <param name="metadataSurveyId"></param> private void UpdateMetadataSurvey(int metadataSurveyId) { MetadataSurvey biz = new MetadataSurvey(); biz.Get(metadataSurveyId); biz[MetadataSurvey.SurveyType] = SurveyType.Value; biz.Save(); }
/// <summary> /// Creates a new MetadataSurvey /// </summary> private void Save() { BOL.MetadataSurvey survey = new MetadataSurvey(); CICHelper.SetBOValues(this.Controls, survey, -1); survey.Save(); int metaSurveyId = (int)survey[survey.PrimaryKeyName]; // register update client script Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "reloadSurveys", "closeAndReloadSurveys('" + metaSurveyId + "');", true); }
protected void CreateNewSurvey(object sender, EventArgs e) { // Create new Survey Record MetadataSurvey biz = new MetadataSurvey(); CICHelper.SetBOValues(CreateSurveyLayer.Controls, biz, 0); biz.Save(); // Rebind list of Surveys and set selcted as new Survey BuildSurveyList(); SurveyList.Value = biz[MetadataSurvey.MetadataSurveyId].ToString(); // Reset Values In New Survey Layer CICHelper.ClearCaisisInputControlValues(CreateSurveyLayer); // Bind Grid BindQuestionsGrid(sender, e); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void AddNewQuestionnaire(object sender, EventArgs e) { if (!string.IsNullOrEmpty(NewQuestionnaireName.Text)) { MetadataSurvey biz = new MetadataSurvey(); biz[MetadataSurvey.SurveyCategory] = ELIGIBILITY_SURVEY_CATEGORY; biz[MetadataSurvey.SurveyType] = NewQuestionnaireName.Text; biz.Save(); // reset field NewQuestionnaireName.Text = string.Empty; // build verions BindProtocolVersions(); // set active survey BuildEligibilityQuestionnaire((int)biz[MetadataSurvey.MetadataSurveyId]); } }
/// <summary> /// Saves the metadata for Survey and its questions and responses /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SaveQuestions(object sender, EventArgs e) { int metaSurveyId = int.Parse(SurveyList.Value); // update survey if needed if (surveyDirty) { MetadataSurvey biz = new MetadataSurvey(); biz.Get(metaSurveyId); CICHelper.SetBOValues(SurveyFields.Controls, biz, -1); biz.Save(); // rebuild survey list to reflect updated title,etc... BuildSurveyList(); // select survey SurveyList.Value = metaSurveyId.ToString(); } // Rebind Grid BindQuestionsGrid(sender, e); }