Inheritance: DataTextBox
Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NewFamilyMembersRow" /> class.
 /// </summary>
 public NewFamilyMembersRow()
     : base()
 {
     _rblRole = new RockRadioButtonList();
     _ddlTitle = new DropDownList();
     _tbFirstName = new RockTextBox();
     _tbLastName = new RockTextBox();
     _ddlSuffix = new DropDownList();
     _rblGender = new RockRadioButtonList();
     _dpBirthdate = new DatePicker();
     _ddlConnectionStatus = new DropDownList();
     _ddlGrade = new RockDropDownList();
     _lbDelete = new LinkButton();
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NewFamilyMembersRow" /> class.
 /// </summary>
 public NewFamilyMembersRow()
     : base()
 {
     _rblRole = new RockRadioButtonList();
     _ddlTitle = new DropDownList();
     _tbFirstName = new RockTextBox();
     _tbLastName = new RockTextBox();
     _ddlSuffix = new DropDownList();
     _ddlConnectionStatus = new DropDownList();
     _rblGender = new RockRadioButtonList();
     _dpBirthdate = new DatePicker();
     _ddlGradePicker = new GradePicker { UseAbbreviation = true, UseGradeOffsetAsValue = true };
     _ddlGradePicker.Label = string.Empty;
     _lbDelete = new LinkButton();
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleBuilder"/> class.
        /// </summary>
        public ScheduleBuilderPopupContents()
        {
            // common
            _dpStartDateTime = new DateTimePicker();

            _tbDurationHours = new NumberBox();
            _tbDurationMinutes = new NumberBox();

            _radOneTime = new RadioButton();
            _radRecurring = new RadioButton();

            _radSpecificDates = new RadioButton();
            _radDaily = new RadioButton();
            _radWeekly = new RadioButton();
            _radMonthly = new RadioButton();

            // specific date
            _hfSpecificDateListValues = new HiddenField();

            _dpSpecificDate = new DatePicker();

            // daily
            _radDailyEveryXDays = new RadioButton();
            _tbDailyEveryXDays = new NumberBox();
            _radDailyEveryWeekday = new RadioButton();
            _radDailyEveryWeekendDay = new RadioButton();

            // weekly
            _tbWeeklyEveryX = new NumberBox();
            _cbWeeklySunday = new RockCheckBox();
            _cbWeeklyMonday = new RockCheckBox();
            _cbWeeklyTuesday = new RockCheckBox();
            _cbWeeklyWednesday = new RockCheckBox();
            _cbWeeklyThursday = new RockCheckBox();
            _cbWeeklyFriday = new RockCheckBox();
            _cbWeeklySaturday = new RockCheckBox();

            // monthly
            _radMonthlyDayX = new RadioButton();
            _tbMonthlyDayX = new NumberBox();
            _tbMonthlyXMonths = new NumberBox();
            _radMonthlyNth = new RadioButton();
            _ddlMonthlyNth = new RockDropDownList();
            _ddlMonthlyDayName = new RockDropDownList();

            // end date
            _radEndByNone = new RadioButton();
            _radEndByDate = new RadioButton();
            _dpEndBy = new DatePicker();
            _radEndByOccurrenceCount = new RadioButton();
            _tbEndByOccurrenceCount = new NumberBox();

            // exclusions
            _hfExclusionDateRangeListValues = new HiddenField();
            _dpExclusionDateRange = new DateRangePicker();
        }
Example #4
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();
            RockControlHelper.CreateChildControls( this, Controls );

            _tbLowerValue = new DatePicker();
            _tbLowerValue.ID = this.ID + "_lower";
            _tbLowerValue.CssClass = "input-width-md";
            Controls.Add( _tbLowerValue );

            _tbUpperValue = new DatePicker();
            _tbUpperValue.ID = this.ID + "_upper";
            _tbUpperValue.CssClass = "input-width-md";
            Controls.Add( _tbUpperValue );
        }
 /// <summary>
 /// Gets the filter value control.
 /// </summary>
 /// <param name="configurationValues">The configuration values.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="required">if set to <c>true</c> [required].</param>
 /// <returns></returns>
 public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required )
 {
     var datePicker = new DatePicker();
     datePicker.ID = string.Format( "{0}_dtPicker", id );
     datePicker.AddCssClass( "js-filter-control" );
     datePicker.DisplayCurrentOption = true;
     return datePicker;
 }
Example #6
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();
            RockControlHelper.CreateChildControls( this, Controls );

            _datePicker = new DatePicker();
            _datePicker.ID = this.ID + "_datePicker";
            _datePicker.CssClass = "input-width-md";

            Controls.Add( _datePicker );

            _timePicker = new TimePicker();
            _timePicker.ID = this.ID + "_timePicker";
            _timePicker.CssClass = "input-width-md";
            Controls.Add( _timePicker );
        }
 /// <summary>
 /// Creates the control(s) necessary for prompting user for a new value
 /// </summary>
 /// <param name="configurationValues">The configuration values.</param>
 /// <param name="id"></param>
 /// <returns>
 /// The control
 /// </returns>
 public override Control EditControl( Dictionary<string, ConfigurationValue> configurationValues, string id )
 {
     var datePicker = new DatePicker { ID = id }; 
     datePicker.DisplayCurrentOption = configurationValues != null &&
         configurationValues.ContainsKey( "displayCurrentOption" ) &&
         configurationValues["displayCurrentOption"].Value.AsBoolean();
     return datePicker;
 }
Example #8
0
        /// <summary>
        /// Gets the filter value control.
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="required">if set to <c>true</c> [required].</param>
        /// <param name="filterMode">The filter mode.</param>
        /// <returns></returns>
        public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required, FilterMode filterMode )
        {
            var dateFiltersPanel = new Panel();
            dateFiltersPanel.ID = string.Format( "{0}_dtFilterControls", id );

            var datePickerPanel = new Panel();
            dateFiltersPanel.Controls.Add( datePickerPanel );

            var datePicker = new DatePicker();
            datePicker.ID = string.Format( "{0}_dtPicker", id );
            datePicker.DisplayCurrentOption = true;
            datePickerPanel.AddCssClass( "js-filter-control" );
            datePickerPanel.Controls.Add( datePicker );

            var slidingDateRangePicker = new SlidingDateRangePicker();
            slidingDateRangePicker.ID = string.Format( "{0}_dtSlidingDateRange", id );
            slidingDateRangePicker.AddCssClass("js-filter-control-between");
            slidingDateRangePicker.Label = string.Empty;
            slidingDateRangePicker.PreviewLocation = SlidingDateRangePicker.DateRangePreviewLocation.Right;
            dateFiltersPanel.Controls.Add( slidingDateRangePicker );

            return dateFiltersPanel;
        }
Example #9
0
        /// <summary>
        /// Adds the field type controls.
        /// </summary>
        /// <param name="parentControl">The filter control.</param>
        /// <param name="controls">The controls.</param>
        /// <param name="entityField">The entity field.</param>
        protected void AddFieldTypeControls( Control parentControl, List<Control> controls, EntityField entityField )
        {
            string controlIdPrefix = string.Format( "{0}_{1}", parentControl.ID, entityField.FieldKind == FieldKind.Attribute ? entityField.AttributeGuid.Value.ToString("n") : entityField.Name );
            switch ( entityField.FilterFieldType )
            {
                case SystemGuid.FieldType.DATE:

                    var ddlDateCompare = ComparisonControl( DateFilterComparisonTypes );
                    ddlDateCompare.ID = string.Format( "{0}_ddlDateCompare", controlIdPrefix );
                    ddlDateCompare.AddCssClass( "js-filter-compare" );
                    parentControl.Controls.Add( ddlDateCompare );
                    controls.Add( ddlDateCompare );

                    var datePicker = new DatePicker();
                    datePicker.ID = string.Format( "{0}_dtPicker", controlIdPrefix );
                    datePicker.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( datePicker );
                    controls.Add( datePicker );

                    break;

                case SystemGuid.FieldType.TIME:

                    var ddlTimeCompare = ComparisonControl( DateFilterComparisonTypes );
                    ddlTimeCompare.ID = string.Format( "{0}_ddlTimeCompare", controlIdPrefix );
                    ddlTimeCompare.AddCssClass( "js-filter-compare" );
                    parentControl.Controls.Add( ddlTimeCompare );
                    controls.Add( ddlTimeCompare );

                    var timePicker = new TimePicker();
                    timePicker.ID = string.Format( "{0}_timePicker", controlIdPrefix );
                    timePicker.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( timePicker );
                    controls.Add( timePicker );

                    break;

                case SystemGuid.FieldType.INTEGER:
                case SystemGuid.FieldType.DECIMAL:

                    var ddlNumberCompare = ComparisonControl( NumericFilterComparisonTypes );
                    ddlNumberCompare.ID = string.Format( "{0}_ddlNumberCompare", controlIdPrefix );
                    ddlNumberCompare.AddCssClass( "js-filter-compare" );
                    parentControl.Controls.Add( ddlNumberCompare );
                    controls.Add( ddlNumberCompare );

                    var numberBox = new NumberBox();
                    numberBox.ID = string.Format( "{0}_numberBox", controlIdPrefix );
                    numberBox.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( numberBox );
                    controls.Add( numberBox );

                    numberBox.FieldName = entityField.Title;

                    break;

                case SystemGuid.FieldType.MULTI_SELECT:

                    var cblMultiSelect = new RockCheckBoxList();
                    cblMultiSelect.ID = string.Format( "{0}_cblMultiSelect", controlIdPrefix );
                    parentControl.Controls.Add( cblMultiSelect );
                    cblMultiSelect.RepeatDirection = RepeatDirection.Horizontal;
                    controls.Add( cblMultiSelect );

                    if ( entityField.FieldKind == FieldKind.Property )
                    {
                        if ( entityField.PropertyType.IsEnum )
                        {
                            // Enumeration property
                            foreach ( var value in Enum.GetValues( entityField.PropertyType ) )
                            {
                                cblMultiSelect.Items.Add( new ListItem( Enum.GetName( entityField.PropertyType, value ).SplitCase() ) );
                            }
                        }
                        else if ( entityField.DefinedTypeGuid.HasValue )
                        {
                            // Defined Value Properties
                            var definedType = DefinedTypeCache.Read( entityField.DefinedTypeGuid.Value );
                            if ( definedType != null )
                            {
                                foreach ( var definedValue in definedType.DefinedValues )
                                {
                                    cblMultiSelect.Items.Add( new ListItem( definedValue.Name, definedValue.Guid.ToString() ) );
                                }
                            }
                        }
                    }
                    else
                    {
                        var attribute = AttributeCache.Read( entityField.AttributeGuid.Value );
                        if ( attribute != null )
                        {
                            switch ( attribute.FieldType.Guid.ToString().ToUpper() )
                            {
                                case SystemGuid.FieldType.SINGLE_SELECT:
                                    //TODO get attribute values qualifier to populate cbl
                                    break;
                                case SystemGuid.FieldType.MULTI_SELECT:
                                    //TODO get attribute values qualifier to populate cbl
                                    break;
                            }
                        }
                    }

                    break;

                case SystemGuid.FieldType.SINGLE_SELECT:

                    var ddlSingleSelect = new RockDropDownList();
                    ddlSingleSelect.ID = string.Format( "{0}_ddlSingleSelect", controlIdPrefix );
                    parentControl.Controls.Add( ddlSingleSelect );
                    controls.Add( ddlSingleSelect );

                    if ( entityField.FieldKind == FieldKind.Property )
                    {
                        if ( entityField.PropertyType == typeof( bool ) || entityField.PropertyType == typeof( bool? ) )
                        {
                            ddlSingleSelect.Items.Add( new ListItem( "True", "True" ) );
                            ddlSingleSelect.Items.Add( new ListItem( "False", "False" ) );
                        }
                    }
                    else
                    {
                        var attribute = AttributeCache.Read( entityField.AttributeGuid.Value );
                        if ( attribute != null )
                        {
                            switch ( attribute.FieldType.Guid.ToString().ToUpper() )
                            {
                                case SystemGuid.FieldType.BOOLEAN:
                                    ddlSingleSelect.Items.Add( new ListItem( "True", "True" ) );
                                    ddlSingleSelect.Items.Add( new ListItem( "False", "False" ) );
                                    break;
                            }
                        }
                    }

                    break;

                case SystemGuid.FieldType.DAY_OF_WEEK:
                    var dayOfWeekPicker = new DayOfWeekPicker();
                    dayOfWeekPicker.Label = string.Empty;
                    dayOfWeekPicker.ID = string.Format( "{0}_dayOfWeekPicker", controlIdPrefix );
                    dayOfWeekPicker.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( dayOfWeekPicker );
                    controls.Add( dayOfWeekPicker );

                    break;

                case SystemGuid.FieldType.TEXT:

                    var ddlText = ComparisonControl( StringFilterComparisonTypes );
                    ddlText.ID = string.Format( "{0}_ddlText", controlIdPrefix );
                    ddlText.AddCssClass( "js-filter-compare" );
                    parentControl.Controls.Add( ddlText );
                    controls.Add( ddlText );

                    var tbText = new RockTextBox();
                    tbText.ID = string.Format( "{0}_tbText", controlIdPrefix );
                    tbText.AddCssClass( "js-filter-control" );
                    parentControl.Controls.Add( tbText );
                    controls.Add( tbText );

                    break;
            }
        }
Example #10
0
 /// <summary>
 /// Creates the control(s) neccessary for prompting user for a new value
 /// </summary>
 /// <param name="configurationValues">The configuration values.</param>
 /// <param name="id"></param>
 /// <returns>
 /// The control
 /// </returns>
 public override Control EditControl( Dictionary<string, ConfigurationValue> configurationValues, string id )
 {
     var dp = new DatePicker { ID = id }; 
     return dp;
 }
Example #11
0
        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var controls = new List<Control>();

            // Create the field selection dropdown
            var ddlProperty = new RockDropDownList();
            ddlProperty.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
            filterControl.Controls.Add( ddlProperty );
            controls.Add( ddlProperty );

            foreach ( var entityField in GetEntityFields(entityType) )
            {
                // Add the field to the dropdown of availailable fields
                ddlProperty.Items.Add( new ListItem( entityField.Title, entityField.Name ) );

                switch ( entityField.FilterFieldType )
                {
                    case SystemGuid.FieldType.DATE:

                        var ddlDate = ComparisonControl( DateFilterComparisonTypes );
                        ddlDate.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( ddlDate );
                        controls.Add( ddlDate );

                        var dtPicker = new DatePicker();
                        dtPicker.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( dtPicker );
                        controls.Add( dtPicker );

                        break;

                    case SystemGuid.FieldType.INTEGER:

                        var ddlInteger = ComparisonControl( NumericFilterComparisonTypes );
                        ddlInteger.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( ddlInteger );
                        controls.Add( ddlInteger );

                        var numberBox = new NumberBox();
                        numberBox.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( numberBox );
                        controls.Add( numberBox );

                        numberBox.FieldName = entityField.Title;

                        break;

                    case SystemGuid.FieldType.MULTI_SELECT:

                        var cblMultiSelect = new RockCheckBoxList();
                        cblMultiSelect.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( cblMultiSelect );
                        cblMultiSelect.RepeatDirection = RepeatDirection.Horizontal;
                        controls.Add( cblMultiSelect );

                        if ( entityField.FieldKind == FieldKind.Property )
                        {
                            // Enumeration property
                            if ( entityField.PropertyType.IsEnum )
                            {
                                foreach ( var value in Enum.GetValues( entityField.PropertyType ) )
                                {
                                    cblMultiSelect.Items.Add( new ListItem( Enum.GetName( entityField.PropertyType, value ).SplitCase() ) );
                                }
                            }

                            // Defined Value Properties
                            else if ( entityField.DefinedTypeId.HasValue )
                            {
                                var definedType = DefinedTypeCache.Read( entityField.DefinedTypeId.Value );
                                if ( definedType != null )
                                {
                                    foreach ( var definedValue in definedType.DefinedValues )
                                        cblMultiSelect.Items.Add( new ListItem( definedValue.Name, definedValue.Id.ToString() ) );
                                }
                            }
                        }
                        else
                        {
                            var attribute = AttributeCache.Read( entityField.AttributeId.Value );
                            if (attribute != null)
                            {
                                switch ( attribute.FieldType.Guid.ToString().ToUpper() )
                                {
                                    case SystemGuid.FieldType.SINGLE_SELECT:
                                        //TODO get attribute values qualifier to populate cbl
                                        break;
                                    case SystemGuid.FieldType.MULTI_SELECT:
                                        //TODO get attribute values qualifier to populate cbl
                                        break;
                                }
                            }
                        }

                        break;

                    case SystemGuid.FieldType.SINGLE_SELECT:

                        var ddlSingleSelect = new RockDropDownList();
                        ddlSingleSelect.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( ddlSingleSelect );
                        controls.Add( ddlSingleSelect );

                        if ( entityField.FieldKind == FieldKind.Property )
                        {
                            if ( entityField.PropertyType == typeof( bool ) || entityField.PropertyType == typeof( bool? ) )
                            {
                                ddlSingleSelect.Items.Add( new ListItem( "True", "True" ) );
                                ddlSingleSelect.Items.Add( new ListItem( "False", "False" ) );
                            }
                        }
                        else
                        {
                            var attribute = AttributeCache.Read( entityField.AttributeId.Value );
                            if ( attribute != null )
                            {
                                switch ( attribute.FieldType.Guid.ToString().ToUpper() )
                                {
                                    case SystemGuid.FieldType.BOOLEAN:
                                        ddlSingleSelect.Items.Add( new ListItem( "True", "True" ) );
                                        ddlSingleSelect.Items.Add( new ListItem( "False", "False" ) );
                                        break;
                                }
                            }
                        }

                        break;

                    case SystemGuid.FieldType.TEXT:

                        var ddl = ComparisonControl( StringFilterComparisonTypes );
                        ddl.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( ddl );
                        controls.Add( ddl );

                        var tb = new RockTextBox();
                        tb.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
                        filterControl.Controls.Add( tb );
                        controls.Add( tb );

                        break;

                }
            }

            _clientFormatSelection = string.Format( "{0}PropertySelection( $content )", entityType.Name );
            
            return controls.ToArray();        
        }