コード例 #1
0
        /// <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();
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
ファイル: Survey_Edit.aspx.cs プロジェクト: aomiit/caisis
        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);
        }
コード例 #4
0
        /// <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]);
            }
        }
コード例 #5
0
        /// <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);
        }