public void Display(Member member, bool canEditContactDetails)
        {
            _member = member;
            _canEditContactDetails = canEditContactDetails;

            ucLocationCountry.SelectedValue = member.Address.Location.CountrySubdivision.Country;

            rdoMale.Checked   = member.Gender == Gender.Male;
            rdoFemale.Checked = member.Gender == Gender.Female;

            if (member.DateOfBirth.HasValue)
            {
                txtYear.Value          = member.DateOfBirth.Value.Year.ToString();
                ddlMonth.SelectedIndex = member.DateOfBirth.Value.Month ?? 1;
                ddlDay.SelectedIndex   = member.DateOfBirth.Value.Day ?? 1;
            }

            ucLocation.Text = member.Address.Location.ToString();

            chkListEthnicStatus.Items.AddRange(
                FieldInputHelper.CreateListItems(EthnicStatusDisplay.Values, EthnicStatusDisplay.GetDisplayText, false)
                .ToArray());

            foreach (ListItem item in chkListEthnicStatus.Items)
            {
                var itemFlag = (EthnicStatus)int.Parse(item.Value);
                item.Selected = ((member.EthnicStatus & itemFlag) != 0);
                item.Attributes.Add("intValue", item.Value); // used by the client JavaScript
            }
        }
示例#2
0
        protected void Application_BeginRequest(Object sender, EventArgs e)
        {
            // Avoid error messages caused by VS.NET's request for a non-existent file.

            if (Request.Url.AbsolutePath.EndsWith("get_aspx_ver.aspx"))
            {
                Response.End();
                return;
            }

            if (!NavigationManager.IsExcluded(Request.Url.AbsolutePath))
            {
                if (!Context.Items.Contains(LinkMeRequestValidator.INVALID_DANGEROUS_REQUEST))
                {
                    // On a POST validate the form data, otherwise validate the query string.

                    var request       = Context.Request;
                    var toValidate    = (request.HttpMethod == "POST" ? request.Form : request.QueryString);
                    var requestErrors = FieldInputHelper.ValidateNameValueCollection(toValidate);
                    if (requestErrors != null)
                    {
                        Context.Items.Add(LinkMeRequestValidator.INVALID_DANGEROUS_REQUEST, requestErrors);
                    }
                }
            }
        }
示例#3
0
        /// <summary>
        /// Sets the default button for one of the Panels on the page.
        /// </summary>
        protected void SetDefaultButton(Panel panel, string uniqueId)
        {
            if (panel == null)
            {
                throw new ArgumentNullException("panel");
            }

            // The documentation doesn't explain this properly, but the ID set here must be relative
            // to the panel ID.

            panel.DefaultButton = FieldInputHelper.GetRelativeId(uniqueId, panel, IdSeparator);
        }
示例#4
0
        /// <summary>
        /// Sets the default button for the entire page.
        /// </summary>
        protected void SetDefaultButton(IButtonControl button)
        {
            if (button == null)
            {
                throw new ArgumentNullException("button");
            }
            if (!(button is Control))
            {
                throw new ArgumentException("The button is not a Control.", "button");
            }

            var form = MainForm;

            form.DefaultButton = FieldInputHelper.GetRelativeId(((Control)button).UniqueID, form, IdSeparator);
        }