상속: RockDropDownList
예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NewGroupMembersRow" /> class.
 /// </summary>
 public PreRegistrationChildRow()
     : base()
 {
     _lNickName      = new RockLiteral();
     _lLastName      = new RockLiteral();
     _tbNickName     = new RockTextBox();
     _tbLastName     = new RockTextBox();
     _ddlSuffix      = new DefinedValuePicker();
     _ddlGender      = new RockDropDownList();
     _dpBirthdate    = new DatePicker();
     _ddlGradePicker = new GradePicker {
         UseAbbreviation = true, UseGradeOffsetAsValue = true
     };
     _ddlGradePicker.Label = string.Empty;
     _pnbMobile            = new PhoneNumberBox();
     _ddlRelationshipType  = new RockDropDownList();
     _phAttributes         = new PlaceHolder();
     _lbDelete             = new LinkButton();
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NewGroupMembersRow" /> class.
 /// </summary>
 public NewGroupMembersRow()
     : base()
 {
     _rblRole             = new RockRadioButtonList();
     _dvpTitle            = new DefinedValuePicker();
     _tbFirstName         = new RockTextBox();
     _tbNickName          = new RockTextBox();
     _tbMiddleName        = new RockTextBox();
     _tbLastName          = new RockTextBox();
     _dvpSuffix           = new DefinedValuePicker();
     _dvpConnectionStatus = new DefinedValuePicker();
     _rblGender           = new RockRadioButtonList();
     _dpBirthdate         = new DatePicker();
     _ddlGradePicker      = new GradePicker {
         UseAbbreviation = true, UseGradeOffsetAsValue = true
     };
     _ddlGradePicker.Label = string.Empty;
     _lbDelete             = new LinkButton();
 }
예제 #3
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();

            Panel pnlRow = new Panel
            {
                ID       = "pnlRow",
                CssClass = "row"
            };

            this.Controls.Add(pnlRow);

            Panel pnlCol1 = new Panel
            {
                ID       = "pnlCol1",
                CssClass = "col-sm-4"
            };

            pnlRow.Controls.Add(pnlCol1);
            _dvpPersonTitle = new DefinedValuePicker
            {
                ID              = "_dvpPersonTitle",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_TITLE.AsGuid()),
                Label           = "Title",
                CssClass        = "input-width-md",
                ValidationGroup = ValidationGroup
            };

            pnlCol1.Controls.Add(_dvpPersonTitle);

            _tbPersonFirstName = new RockTextBox
            {
                ID               = "tbPersonFirstName",
                Label            = "First Name",
                Required         = true,
                AutoCompleteType = AutoCompleteType.None,
                ValidationGroup  = ValidationGroup
            };

            pnlCol1.Controls.Add(_tbPersonFirstName);

            _tbPersonLastName = new RockTextBox
            {
                ID               = "tbPersonLastName",
                Label            = "Last Name",
                Required         = true,
                AutoCompleteType = AutoCompleteType.None,
                ValidationGroup  = ValidationGroup
            };

            pnlCol1.Controls.Add(_tbPersonLastName);

            _dvpPersonSuffix = new DefinedValuePicker
            {
                ID              = "dvpPersonSuffix",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_SUFFIX.AsGuid()),
                Label           = "Suffix",
                CssClass        = "input-width-md",
                ValidationGroup = ValidationGroup
            };

            pnlCol1.Controls.Add(_dvpPersonSuffix);

            Panel pnlCol2 = new Panel
            {
                ID       = "pnlCol2",
                CssClass = "col-sm-4"
            };

            pnlRow.Controls.Add(pnlCol2);

            _dvpPersonConnectionStatus = new DefinedValuePicker
            {
                ID              = "dvpPersonConnectionStatus",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_CONNECTION_STATUS.AsGuid()),
                Label           = "Connection Status",
                Required        = true,
                ValidationGroup = ValidationGroup
            };

            pnlCol2.Controls.Add(_dvpPersonConnectionStatus);

            _rblPersonRole = new RockRadioButtonList
            {
                ID              = "rblPersonRole",
                Label           = "Role",
                RepeatDirection = RepeatDirection.Horizontal,
                DataTextField   = "Name",
                DataValueField  = "Id",
                Required        = true,
                ValidationGroup = ValidationGroup
            };

            pnlCol2.Controls.Add(_rblPersonRole);

            _rblPersonGender = new RockRadioButtonList
            {
                ID              = "rblPersonGender",
                Label           = "Gender",
                RepeatDirection = RepeatDirection.Horizontal,
                Required        = true,
                ValidationGroup = ValidationGroup
            };

            pnlCol2.Controls.Add(_rblPersonGender);

            Panel pnlCol3 = new Panel {
                ID = "pnlCol3", CssClass = "col-sm-4"
            };

            pnlRow.Controls.Add(pnlCol3);

            _dpPersonBirthDate = new DatePicker
            {
                ID    = "dpPersonBirthDate",
                Label = "Birthdate",
                AllowFutureDateSelection = false,
                ForceParse      = false,
                ValidationGroup = ValidationGroup
            };

            pnlCol3.Controls.Add(_dpPersonBirthDate);

            _ddlGradePicker = new GradePicker
            {
                ID                    = "ddlGradePicker",
                Label                 = "Grade",
                UseAbbreviation       = true,
                UseGradeOffsetAsValue = true,
                ValidationGroup       = ValidationGroup
            };

            pnlCol3.Controls.Add(_ddlGradePicker);

            _dvpPersonMaritalStatus = new DefinedValuePicker
            {
                ID              = "_vpPersonMaritalStatus",
                Label           = "Marital Status",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_MARITAL_STATUS.AsGuid()),
                ValidationGroup = ValidationGroup
            };

            pnlCol3.Controls.Add(_dvpPersonMaritalStatus);

            _ebPersonEmail = new EmailBox
            {
                ID              = "dbPersonEmail",
                Label           = "Email",
                ValidationGroup = ValidationGroup
            };

            pnlCol3.Controls.Add(_ebPersonEmail);

            var groupType = GroupTypeCache.GetFamilyGroupType();

            _rblPersonRole.DataSource = groupType.Roles.OrderBy(r => r.Order).ToList();
            _rblPersonRole.DataBind();

            _rblPersonGender.Items.Clear();
            _rblPersonGender.Items.Add(new ListItem(Gender.Male.ConvertToString(), Gender.Male.ConvertToInt().ToString()));
            _rblPersonGender.Items.Add(new ListItem(Gender.Female.ConvertToString(), Gender.Female.ConvertToInt().ToString()));
            _rblPersonGender.Items.Add(new ListItem(Gender.Unknown.ConvertToString(), Gender.Unknown.ConvertToInt().ToString()));
        }
예제 #4
0
        /// <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 )
        {
            ListControl editControl;

            bool useDescription = configurationValues != null && configurationValues.ContainsKey( DISPLAY_DESCRIPTION ) && configurationValues[DISPLAY_DESCRIPTION].Value.AsBoolean();
            int? definedTypeId = configurationValues != null && configurationValues.ContainsKey( DEFINED_TYPE_KEY ) ? configurationValues[DEFINED_TYPE_KEY].Value.AsIntegerOrNull() : null;

            if ( configurationValues != null && configurationValues.ContainsKey( ALLOW_MULTIPLE_KEY ) && configurationValues[ALLOW_MULTIPLE_KEY].Value.AsBoolean() )
            {
                editControl = new DefinedValuesPicker { ID = id, DisplayDescriptions = useDescription, DefinedTypeId = definedTypeId };
                editControl.AddCssClass( "checkboxlist-group" );
            }
            else
            {
                editControl = new DefinedValuePicker { ID = id, DisplayDescriptions = useDescription, DefinedTypeId = definedTypeId };
            }

            if ( definedTypeId.HasValue )
            {
                return editControl;
            }

            return null;
        }
예제 #5
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();

            _phControls = new DynamicPlaceholder {
                ID = "phControls"
            };
            this.Controls.Add(_phControls);

            _pnlRow = new DynamicControlsPanel {
                ID = "pnlRow", CssClass = "row"
            };
            _pnlCol1 = new DynamicControlsPanel {
                ID = "pnlCol1", CssClass = "col-sm-4"
            };
            _pnlCol2 = new DynamicControlsPanel {
                ID = "pnlCol2", CssClass = "col-sm-4"
            };
            _pnlCol3 = new DynamicControlsPanel {
                ID = "pnlCol3", CssClass = "col-sm-4"
            };
            _phControls.Controls.Add(_pnlRow);
            _pnlRow.Controls.Add(_pnlCol1);
            _pnlRow.Controls.Add(_pnlCol2);
            _pnlRow.Controls.Add(_pnlCol3);


            _hfPersonId = new HiddenField
            {
                ID = "_hfPersonId"
            };

            _phControls.Controls.Add(_hfPersonId);

            _dvpPersonTitle = new DefinedValuePicker
            {
                ID              = "_dvpPersonTitle",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_TITLE.AsGuid()),
                Label           = "Title",
                CssClass        = "input-width-md",
                ValidationGroup = ValidationGroup
            };

            _tbPersonFirstName = new RockTextBox
            {
                ID               = "tbPersonFirstName",
                Label            = "First Name",
                Required         = true,
                AutoCompleteType = AutoCompleteType.None,
                ValidationGroup  = ValidationGroup
            };

            _tbPersonLastName = new RockTextBox
            {
                ID               = "tbPersonLastName",
                Label            = "Last Name",
                Required         = true,
                AutoCompleteType = AutoCompleteType.None,
                ValidationGroup  = ValidationGroup
            };

            _dvpPersonSuffix = new DefinedValuePicker
            {
                ID              = "dvpPersonSuffix",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_SUFFIX.AsGuid()),
                Label           = "Suffix",
                CssClass        = "input-width-md",
                ValidationGroup = ValidationGroup
            };

            // Have Email and PhoneNumber hidden by default
            _ebPersonEmail = new EmailBox
            {
                ID              = "ebPersonEmail",
                Label           = "Email",
                ValidationGroup = ValidationGroup,
                Visible         = false
            };

            _pnbMobilePhoneNumber = new PhoneNumberBox
            {
                Label   = "Mobile Phone",
                ID      = "pnbMobilePhoneNumber",
                Visible = false
            };

            _dvpPersonConnectionStatus = new DefinedValuePicker
            {
                ID              = "dvpPersonConnectionStatus",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_CONNECTION_STATUS.AsGuid()),
                Label           = "Connection Status",
                Required        = true,
                ValidationGroup = ValidationGroup
            };

            _rblPersonRole = new RockRadioButtonList
            {
                ID              = "rblPersonRole",
                Label           = "Role",
                RepeatDirection = RepeatDirection.Horizontal,
                DataTextField   = "Name",
                DataValueField  = "Id",
                Required        = true,
                ValidationGroup = ValidationGroup
            };

            _rblPersonGender = new RockRadioButtonList
            {
                ID              = "rblPersonGender",
                Label           = "Gender",
                RepeatDirection = RepeatDirection.Horizontal,
                Required        = this.RequireGender,
                ValidationGroup = this.RequireGender == true ? ValidationGroup : string.Empty,
                ShowNoneOption  = false
            };

            _bdpPersonBirthDate = new BirthdayPicker
            {
                ID              = "bdpPersonBirthDate",
                Label           = "Birthdate",
                ValidationGroup = ValidationGroup
            };

            _ddlGradePicker = new GradePicker
            {
                ID                    = "ddlGradePicker",
                Label                 = "Grade",
                UseAbbreviation       = true,
                UseGradeOffsetAsValue = true,
                ValidationGroup       = ValidationGroup
            };

            _dvpPersonMaritalStatus = new DefinedValuePicker
            {
                ID              = "dvpPersonMaritalStatus",
                Label           = "Marital Status",
                DefinedTypeId   = DefinedTypeCache.GetId(Rock.SystemGuid.DefinedType.PERSON_MARITAL_STATUS.AsGuid()),
                ValidationGroup = ValidationGroup
            };

            var groupType = GroupTypeCache.GetFamilyGroupType();

            _rblPersonRole.DataSource = groupType.Roles.OrderBy(r => r.Order).ToList();
            _rblPersonRole.DataBind();

            _rblPersonGender.Items.Clear();
            _rblPersonGender.Items.Add(new ListItem(Gender.Male.ConvertToString(), Gender.Male.ConvertToInt().ToString()));
            _rblPersonGender.Items.Add(new ListItem(Gender.Female.ConvertToString(), Gender.Female.ConvertToInt().ToString()));

            ArrangePersonControls(this.ShowInColumns);
            UpdatePersonControlLabels();
        }