Esempio n. 1
0
 /// <summary>
 /// Binds the expression editor.
 /// </summary>
 /// <param name="dataSource">The data source.</param>
 private void BindExpressionEditor(object dataSource)
 {
     ExprFilter.ProviderName    = "CustomerDataProvider";
     ExprFilter.ExpressionKey   = ExpressionId.ToString();
     ExprFilter.ExpressionPlace = "Customer";
     ExprFilter.DataSource      = dataSource;
     ExprFilter.DataBind();
 }
Esempio n. 2
0
        /// <summary>
        /// Handles the Click event of the SaveButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            ExpressionDto dto = (ExpressionDto)HttpContext.Current.Session[_ExpressionDtoEditSessionKey];

            if (dto != null)
            {
                ExpressionFilter = ExprFilter.NodeCollection[0].ChildNodes;

                ExprFilter.Visible    = true;
                ExprFilter.DataSource = dto;
                ExprFilter.Provider.SaveFilters(_RulesPrefix, ExpressionId.ToString(), ExpressionFilter);
                ExpressionDto.ExpressionRow row = null;
                if (ExpressionId == 0) // get the last row added
                {
                    row = dto.Expression[dto.Expression.Count - 1];
                }
                else
                {
                    row = dto.Expression.FindByExpressionId(ExpressionId);
                }

                row.Name = ExpressionName.Text;
            }
            else
            {
                ExprFilter.Visible = false;
            }
            ////Serialize FilterExpression in segment table
            //if (_SegmentDto != null && _SegmentDto.Segment.Count > 0)
            //{
            //    SegmentDto.SegmentRow row = _SegmentDto.Segment[0];
            //    row.ExpressionFilter = SerializeFilterExpressions(ExpressionFilters);
            //}

            CommandParameters cp = new CommandParameters(_RuleEditCommandString);

            CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
        }