예제 #1
0
        private void ApplyChangesButton_Click(object sender, System.EventArgs e)
        {
            // Create a new regular expression entry in the database
            RegularExpressionData regularExpressionData = new RegularExpressionData();

            RegularExpressionData.RegularExpressionsRow regularExpression = regularExpressionData.RegularExpressions.NewRegularExpressionsRow();
            regularExpression.RegularExpressionId = int.Parse(RegExDropDownList.SelectedValue);
            regularExpression.RegExpression       = RegularExpressionTextbox.Text;
            regularExpression.RegExMessage        = ErrorMessageTextbox.Text.Length > 0 ?
                                                    ErrorMessageTextbox.Text : null;
            regularExpression.Description = RegExDescriptionTextbox.Text;
            regularExpressionData.RegularExpressions.AddRegularExpressionsRow(regularExpression);
            new RegularExpression().UpdateRegularExpression(regularExpressionData);

            MessageLabel.Visible = true;
            ((PageBase)Page).ShowNormalMessage(MessageLabel, ((PageBase)Page).GetPageResource("RegExUpdatedMessage"));
            ResetUIState();
        }
예제 #2
0
        private void CreateNewRegExButton_Click(object sender, System.EventArgs e)
        {
            if (!ValidateFields())
            {
                return;
            }

            // Create a new regular expression entry in the database
            RegularExpressionData regularExpressionData = new RegularExpressionData();

            RegularExpressionData.RegularExpressionsRow regularExpression = regularExpressionData.RegularExpressions.NewRegularExpressionsRow();
            regularExpression.RegExpression = RegularExpressionTextbox.Text;
            regularExpression.RegExMessage  = ErrorMessageTextbox.Text.Length > 0 ?
                                              ErrorMessageTextbox.Text : null;
            regularExpression.Description = RegExDescriptionTextbox.Text;
            regularExpressionData.RegularExpressions.AddRegularExpressionsRow(regularExpression);
            new RegularExpression().AddRegularExpression(regularExpressionData, NSurveyUser.Identity.UserId);

            MessageLabel.Visible = true;
            ((PageBase)Page).ShowNormalMessage(MessageLabel, ((PageBase)Page).GetPageResource("RegExAddedMessage"));
            ResetUIState();
        }