public override DataSet Clone()
        {
            RegularExpressionData data = (RegularExpressionData)base.Clone();

            data.InitVars();
            return(data);
        }
コード例 #2
0
        /// <summary>
        /// Retrieves all regular expression from the database assigned to a user
        /// </summary>
        public RegularExpressionData GetEditableRegularExpressionsListOfUser(int userId)
        {
            RegularExpressionData dataSet = new RegularExpressionData();

            ArrayList commandParameters = new ArrayList();
            {
                commandParameters.Add(new SqlParameter("@UserId", userId).SqlValue);
            }

            DbConnection.db.LoadDataSet("vts_spRegularExpressionGetEditableListForUser", dataSet, new string[] { "RegularExpressions" }, commandParameters.ToArray());
            return dataSet;
        }
コード例 #3
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();
		}
コード例 #4
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();
		}
コード例 #5
0
 public RegularExpressionsRowChangeEvent(RegularExpressionData.RegularExpressionsRow row, DataRowAction action)
 {
     this.eventRow = row;
     this.eventAction = action;
 }
コード例 #6
0
 public void RemoveRegularExpressionsRow(RegularExpressionData.RegularExpressionsRow row)
 {
     base.Rows.Remove(row);
 }
コード例 #7
0
 public void AddRegularExpressionsRow(RegularExpressionData.RegularExpressionsRow row)
 {
     base.Rows.Add(row);
 }
コード例 #8
0
        /// <summary>
        /// Retrieves regular expression details from the database
        /// </summary>
        public RegularExpressionData GetRegularExpressionById(int regularExpressionId)
        {
            RegularExpressionData dataSet = new RegularExpressionData();

            ArrayList commandParameters = new ArrayList();
            {
                commandParameters.Add(new SqlParameter("@RegularExpressionId", regularExpressionId).SqlValue);
            }

            DbConnection.db.LoadDataSet("vts_spRegularExpressionGetDetails", dataSet, new string[] { "RegularExpressions", "SecurityRights" }, commandParameters.ToArray());
            return dataSet;
        }
コード例 #9
0
 /// <summary>
 /// Retrieves all regular expression from the database
 /// </summary>
 public RegularExpressionData GetAllRegularExpressionsList()
 {
     RegularExpressionData dataSet = new RegularExpressionData();
     DbConnection.db.LoadDataSet("vts_spRegularExpressionGetList", dataSet, new string[] { "RegularExpressions" });
     return dataSet;
 }
コード例 #10
0
 /// <summary>
 /// Adds a new regular expression to the database
 /// </summary>
 public void AddRegularExpression(RegularExpressionData newRegularExpression, int userId)
 {
     SqlConnection sqlConnection = new SqlConnection(DbConnection.NewDbConnectionString);
     DbConnection.db.UpdateDataSet(newRegularExpression, "RegularExpressions", this.GetInsertRegularExpressionCommand(sqlConnection, null, userId), new SqlCommand(), new SqlCommand(), UpdateBehavior.Transactional);
 }
コード例 #11
0
 /// <summary>
 /// Updates regular expressions data
 /// </summary>
 public void UpdateRegularExpression(RegularExpressionData updatedRegularExpression)
 {
     SqlConnection connection = new SqlConnection(DbConnection.NewDbConnectionString);
     SqlCommand insertCommand = new SqlCommand("vts_spRegularExpressionUpdate", connection);
     insertCommand.CommandType = CommandType.StoredProcedure;
     insertCommand.Parameters.Add(new SqlParameter("@RegularExpressionId", SqlDbType.Int, 4, "RegularExpressionId"));
     insertCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.VarChar, 0xff, "Description"));
     insertCommand.Parameters.Add(new SqlParameter("@RegExpression", SqlDbType.VarChar, 0x7d0, "RegExpression"));
     insertCommand.Parameters.Add(new SqlParameter("@RegExMessage", SqlDbType.VarChar, 0x7d0, "RegExMessage"));
     DbConnection.db.UpdateDataSet(updatedRegularExpression, "RegularExpressions", insertCommand, new SqlCommand(), new SqlCommand(), UpdateBehavior.Transactional);
 }
コード例 #12
0
        /// <summary>
        /// Retrieves all regular expression from the database assigned to a user
        /// </summary>
        public RegularExpressionData GetRegularExpressionsOfUser(int userId, int surveyId)
        {
            //SqlParameter[] commandParameters = new SqlParameter[] 
            //{ new SqlParameter("@UserId", userId), 
            //    new SqlParameter("@SurveyId", surveyId) };


            ArrayList commandParameters = new ArrayList();
            {
                commandParameters.Add(new SqlParameter("@UserId", userId).SqlValue);
                commandParameters.Add(new SqlParameter("@SurveyId", surveyId).SqlValue);
            }

            RegularExpressionData dataSet = new RegularExpressionData();
            DbConnection.db.LoadDataSet("vts_spRegularExpressionGetListForUser", dataSet, new string[] { "RegularExpressions" }, commandParameters.ToArray());
            return dataSet;
        }
コード例 #13
0
 /// <summary>
 /// Updates regular expressions data
 /// </summary>
 public void UpdateRegularExpression(RegularExpressionData updatedRegularExpression)
 {
     RegularExpressionFactory.Create().UpdateRegularExpression(updatedRegularExpression);
 }
コード例 #14
0
 /// <summary>
 /// Adds a new regular expression to the database
 /// </summary>
 public void AddRegularExpression(RegularExpressionData newRegularExpression, int userId)
 {
     RegularExpressionFactory.Create().AddRegularExpression(newRegularExpression, userId);
 }