protected void Page_Load(object sender, EventArgs e)
        {
            // Cccev vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
            if (!RequireBirthDateSetting)
            {
                reqBirthDate.Enabled = trBirthDate.Visible = false;
            }

            if (!RequireGenderSetting)
            {
                reqGender.Enabled = trGender.Visible = false;
            }

            if (!RequireMaritalStatusSetting)
            {
                reqMaritalStatus.Enabled = trMaritalStatus.Visible = false;
            }

            if (!RequireAddressSetting)
            {
                reqStreetAddress.Enabled = reqCity.Enabled = reqState.Enabled = reqZipCode.Enabled = false;
                trStreetAddress.Visible  = trCity.Visible = trState.Visible = trZipCode.Visible = false;
            }

            if (!RequireHomePhoneSetting)
            {
                tbHomePhone.Enabled = trHomePhone.Visible = false;
            }

            if (!RequireWorkPhoneSetting)
            {
                tbWorkPhone.Enabled = trWorkPhone.Visible = false;
            }

            if (!RequireCellPhoneSetting)
            {
                tbCellPhone.Enabled = trCellPhone.Visible = false;
            }

            if (!RequireCampusSetting)
            {
                ddlCampus.Enabled = trCampus.Visible = false;
            }
            // Cccev ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

            this.pnlMessage.Visible   = false;
            this.lblMessage.Visible   = false;
            this.lblLoginMessage.Text = string.Empty;

            if (ArenaContext.Current.SelectedPerson == null)
            {
                this.person = base.CurrentPerson;
            }
            else
            {
                if (base.CurrentPerson != null && ArenaContext.Current.SelectedPerson.FamilyId == base.CurrentPerson.FamilyId)
                {
                    this.person = ArenaContext.Current.SelectedPerson;
                }
                else
                {
                    this.pnlEdit.Visible    = false;
                    this.lblMessage.Text    = "You do not have permission to edit this information";
                    this.lblMessage.Visible = true;
                    this.pnlMessage.Visible = true;
                }
            }

            if (this.person == null)
            {
                this.person = new Person();
            }

            this.EnableLogout();
            this.LoadAttributes();

            if (!this.Page.IsPostBack)
            {
                base.Session["RedirectValue"] = string.Empty;
                if (base.Request.QueryString["requestpage"] != null)
                {
                    base.Session["RedirectValue"] = string.Format("default.aspx?page={0}", base.Request.QueryString["requestpage"]);
                }
                if (base.Session["RedirectValue"].ToString() == string.Empty && base.Request.QueryString["requestUrl"] != null && !base.Request.QueryString["requestUrl"].ToLower().StartsWith("http"))
                {
                    base.Session["RedirectValue"] = base.Request.QueryString["requestUrl"];
                }
                if (base.Session["RedirectValue"].ToString() == string.Empty && this.RedirectSetting != string.Empty)
                {
                    base.Session["RedirectValue"] = this.RedirectSetting;
                }

                LookupType lookupType = new LookupType(SystemLookupType.MaritalStatus);
                lookupType.Values.LoadDropDownList(this.ddlMaritalStatus);

                this.ddlCampus.Items.Clear();
                CampusCollection campusCollection = new CampusCollection(base.CurrentOrganization.OrganizationID);
                campusCollection.LoadDropDownList(this.ddlCampus, "Select Campus");

                if (base.Request.IsAuthenticated)
                {
                    this.SetInfo();
                    this.tdLogin.Visible  = false;
                    this.tdFamily.Visible = bool.Parse(this.ShowFamilySetting);
                    return;
                }
                this.tdFamily.Visible = false;
                this.tdLogin.Visible  = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Cccev vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

            if (PrefixHTMLSetting != string.Empty)
            {
                litPrefixHTML.Text = PrefixHTMLSetting;
            }

            if (PostfixHTMLSetting != string.Empty)
            {
                litPostfixHTML.Text = PostfixHTMLSetting;
            }

            if (!RequireBirthDateSetting)
            {
                reqBirthDate.Enabled = cgBirthDate.Visible = false;
            }

            if (!RequireGenderSetting)
            {
                reqGender.Enabled = cgGender.Visible = false;
            }

            if (!RequireMaritalStatusSetting)
            {
                reqMaritalStatus.Enabled = cgMaritalStatus.Visible = false;
            }

            if (!RequireAddressSetting)
            {
                reqStreetAddress.Enabled = reqCity.Enabled = reqState.Enabled = reqZipCode.Enabled = false;
                cgAddress.Visible        = false;
            }

            if (!RequireHomePhoneSetting)
            {
                tbHomePhone.Enabled = cgHomePhone.Visible = false;
            }

            if (!RequireWorkPhoneSetting)
            {
                tbWorkPhone.Enabled = cgWorkPhone.Visible = false;
            }

            if (!RequireCellPhoneSetting)
            {
                tbCellPhone.Enabled = cgCellPhone.Visible = false;
            }

            if (!RequireCampusSetting)
            {
                ddlCampus.Enabled = cgCampus.Visible = false;
            }
            // Cccev ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

            this.pnlMessage.Visible     = false;
            this.lblMessage.Visible     = false;
            this.pnlEmailExists.Visible = false;
            if (!this.Page.IsPostBack)
            {
                base.Session["RedirectValue"] = string.Empty;
                if (base.Request.QueryString["requestpage"] != null)
                {
                    base.Session["RedirectValue"] = string.Format("default.aspx?page={0}", base.Request.QueryString["requestpage"]);
                }
                if (base.Session["RedirectValue"].ToString() == string.Empty && base.Request.QueryString["requestUrl"] != null && !base.Request.QueryString["requestUrl"].ToLower().StartsWith("http"))
                {
                    base.Session["RedirectValue"] = base.Request.QueryString["requestUrl"];
                }
                if (base.Session["RedirectValue"].ToString() == string.Empty)
                {
                    base.Session["RedirectValue"] = string.Format("default.aspx?page={0}", this.RedirectPageIDSetting);
                }
                LookupType lookupType = new LookupType(SystemLookupType.MaritalStatus);
                lookupType.Values.LoadDropDownList(this.ddlMaritalStatus);
                this.tbFirstName.Focus();
                this.tbHomePhone.PhoneNumberTextBox.TabIndex    = 11;
                this.tbWorkPhone.PhoneNumberTextBox.TabIndex    = 12;
                this.tbWorkPhone.PhoneExtensionTextBox.TabIndex = 13;
                this.tbCellPhone.PhoneNumberTextBox.TabIndex    = 14;

                this.ddlCampus.Items.Clear();
                CampusCollection campusCollection = new CampusCollection(base.CurrentOrganization.OrganizationID);
                campusCollection.LoadDropDownList(this.ddlCampus, SelectCampusPlaceholderSetting);
                // pre-select the default campus setting
                if (CampusSetting != string.Empty)
                {
                    ddlCampus.SelectedValue = CampusSetting;
                }
            }
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("\n\n<script language=\"javascript\" FOR=\"document\" EVENT=\"onreadystatechange\">\n");
            stringBuilder.Append("\tif(document.readyState==\"complete\");\n");
            stringBuilder.Append("\t{\n");
            stringBuilder.AppendFormat("\t\tdocument.frmMain.{0}.value = document.frmMain.{1}.value;\n", this.tbPassword.ClientID, this.iPassword.ClientID);
            stringBuilder.AppendFormat("\t\tdocument.frmMain.{0}.value = document.frmMain.{1}.value;\n", this.tbPassword2.ClientID, this.iPassword.ClientID);
            stringBuilder.Append("\t}\n");
            stringBuilder.Append("</script>\n\n");
            this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "setPassword", stringBuilder.ToString());
            this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "setPassword", stringBuilder.ToString());
        }
Example #3
0
        public void btnPopulate_Click(object sender, EventArgs e)
        {
            Address address;


            //
            // Geocode the address.
            //
            address             = new Address();
            address.StreetLine1 = txtAddress.Text;
            address.City        = txtCity.Text;
            address.State       = txtState.Text;
            address.PostalCode  = txtPostal.Text;
            address.Geocode("GoogleMaps");

            if (address.Latitude != 0 && address.Longitude != 0)
            {
                Placemark    placemark;
                RadiusLoader loader;


                //
                // Clear the map.
                //
                ltError.Visible = false;
                myMap.ClearContent();

                //
                // Put the center placemark if they want one.
                //
                if (cbShowHome.Checked == true)
                {
                    placemark           = new Placemark();
                    placemark.Latitude  = address.Latitude;
                    placemark.Longitude = address.Longitude;
                    placemark.Unique    = "Home";
                    placemark.PinImage  = "http://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=home|FFFF00";
                    placemark.Name      = address.StreetLine1 + "\\n" + address.City + ", " + address.State + " " + address.PostalCode;
                    myMap.Placemarks.Add(placemark);
                }

                //
                // Put all the campuses if those are requested.
                //
                if (cbShowCampus.Checked == true)
                {
                    CampusCollection campuses = new CampusCollection(ArenaContext.Current.Organization.OrganizationID);

                    foreach (Campus c in campuses)
                    {
                        if (c.Address != null && c.Address.Latitude != 0 && c.Address.Longitude != 0)
                        {
                            myMap.Placemarks.Add(new CampusPlacemark(c));
                        }
                    }
                }

                //
                // Build a loader of the apropriate type.
                //
                loader              = new RadiusLoader();
                loader.Latitude     = address.Latitude;
                loader.Longitude    = address.Longitude;
                loader.Distance     = Convert.ToDouble(txtDistance.Text);
                loader.PopulateWith = (PopulationType)Enum.Parse(typeof(PopulationType), ddlType.SelectedValue);
                myMap.Loaders.Add(loader);

                //
                // Set the center point for the map.
                //
                myMap.Center.Latitude  = address.Latitude;
                myMap.Center.Longitude = address.Longitude;
            }
            else
            {
                ltError.Visible = true;
            }
        }