Пример #1
0
    protected void btnSaveChallenge_Click(object sender, EventArgs e)
    {
        bool sw = false;

        if (!string.IsNullOrEmpty(challengeComponent.Challenge.ChallengeReference))
        {
            if (!string.IsNullOrEmpty(txtCustomDataTemplate.Text))
            {
                if (!string.IsNullOrEmpty(challengeCustomDataComponent.ChallengeCustomData.ChallengeReference))
                {
                    challengeCustomDataComponent.ChallengeCustomData.CustomDataTemplate = txtCustomDataTemplate.Text;
                }
                else
                {
                    challengeCustomDataComponent.ChallengeCustomData.ChallengeReference = challengeComponent.Challenge.ChallengeReference;
                    challengeCustomDataComponent.ChallengeCustomData.Language           = Language;
                    challengeCustomDataComponent.ChallengeCustomData.CustomDataTemplate = txtCustomDataTemplate.Text;
                    sw = true;
                }
                challengeCustomDataComponent.Save();
            }

            if (!string.IsNullOrEmpty(TxtScoring.Text))
            {
                if (!string.IsNullOrEmpty(challengeCustomDataComponent.ChallengeCustomData.ChallengeReference))
                {
                    challengeCustomDataComponent.ChallengeCustomData.Scoring = TxtScoring.Text;
                }
                else
                {
                    if (!sw)
                    {
                        challengeCustomDataComponent.ChallengeCustomData.ChallengeReference = challengeComponent.Challenge.ChallengeReference;
                        challengeCustomDataComponent.ChallengeCustomData.Language           = Language;
                        challengeCustomDataComponent.ChallengeCustomData.Scoring            = TxtScoring.Text;
                    }
                }
                challengeCustomDataComponent.Save();
            }
        }
    }
Пример #2
0
    //Save RadEditorTemplate text in the field EligibilityTemplate
    private void SaveChallengeCustomData()
    {
        if (Settings.Contains("ChallengeReference"))
        {
            if (challengeCustomDataComponent.ChallengeCustomData.ChallengeCustomDatalId == Guid.Empty)
            {
                challengeCustomDataComponent.ChallengeCustomData.Language           = Language;
                challengeCustomDataComponent.ChallengeCustomData.ChallengeReference = Settings["ChallengeReference"].ToString();
            }

            if (RadEditorTemplate.Text != string.Empty)
            {
                challengeCustomDataComponent.ChallengeCustomData.EligibilityTemplate = RadEditorTemplate.Text;
                challengeCustomDataComponent.Save();
            }
        }
    }