Exemple #1
0
    /// <summary>
    /// configure the display (visible or invisible buttons and labels) depending on whether you want to create, view or edit a user)
    /// </summary>
    /// <param name="state"></param>
    private void setControl(string state)
    {
        switch (state)
        {
        case "CREATE":
        {
            btnEditProfile.Text = Localization.GetString("CreateNewProfile", LocalResourceFile);
            btnCancel.Text      = Localization.GetString("Decline",
                                                         LocalResourceFile);
            btnEditProfile.CommandArgument          = "CREATE";
            btnCancel.CommandArgument               = "DECLINE";
            divPassword.Visible                     = true;
            divPasswordConfirm.Visible              = true;
            CountryStateCityEditMode.ViewInEditMode = true;
            CountryStateCityEditMode.DataBind();
            EditPanel.Visible         = true;
            ViewPanel.Visible         = false;
            dvTerms.Visible           = true;
            dvSocialMediaPane.Visible = false;
            txtEmail.Enabled          = true;
            btnEditProfile.Enabled    = chkTerms.Checked;
            btnEditProfile.Visible    = true;
            btnCancel.Visible         = false;
            break;
        }

        case "VIEW":
        {
            btnEditProfile.Text = Localization.GetString("EditProfile",
                                                         LocalResourceFile);
            btnCancel.Text = Localization.GetString("Cancel",
                                                    LocalResourceFile);
            btnEditProfile.CommandArgument = "EDIT";
            btnCancel.CommandArgument      = "CANCEL";
            divPassword.Visible            = false;
            divPasswordConfirm.Visible     = false;
            //     CountryStateCityEditMode.EditMode = false;
            //     CountryStateCityEditMode.DataBind();
            dvTerms.Visible           = false;
            EditPanel.Visible         = false;
            ViewPanel.Visible         = true;
            dvSocialMediaPane.Visible = true;
            txtEmail.Enabled          = false;
            btnEditProfile.Visible    = false;
            btnCancel.Visible         = false;
            if (currentUser.UserID == UserController.GetCurrentUserInfo().UserID)
            {
                btnEditViewMode.Visible = true;
                passwordLink.Visible    = true;
            }
            else
            {
                btnEditViewMode.Visible = false;
                passwordLink.Visible    = false;
            }
            rvPassword.Enabled             = false;
            rvPasswordConfirmation.Enabled = false;
            //     CountryStateCityEditMode.EditMode = true;
            break;
        }

        case "EDIT":
        {
            btnEditProfile.CommandArgument = "EDITING";
            btnEditProfile.Text            = Localization.GetString("SaveProfile",
                                                                    LocalResourceFile);
            btnCancel.Text = Localization.GetString("Cancel",
                                                    LocalResourceFile);
            if (!chkTerms.Checked)
            {
                dvTerms.Visible             = true;
                btnEditProfile.Enabled      = false;
                btnCancel.Visible           = false;
                pnlImportantMessage.Visible = true;
                lblImportantMessage.Text    = Localization.GetString("SingAgreement",
                                                                     LocalResourceFile);
            }
            else
            {
                dvTerms.Visible             = false;
                btnEditProfile.Enabled      = true;
                btnCancel.Visible           = true;
                pnlImportantMessage.Visible = false;
            }
            divPassword.Visible        = false;
            divPasswordConfirm.Visible = false;
            //CountryStateCity1.EditMode = true;
            //CountryStateCity1.DataBind();
            EditPanel.Visible         = true;
            ViewPanel.Visible         = false;
            dvSocialMediaPane.Visible = true;
            txtEmail.Enabled          = false;
            btnEditProfile.Visible    = true;
            break;
        }
        }
    }
Exemple #2
0
    protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        switch (e.NextStepIndex)
        {
        case 1:
            break;

        case 2:
            if (RadListView1.SelectedItems.Count == 0)
            {
                //Activate the validator if not selected any item
                rfvTheme.IsValid = false;
                e.Cancel         = true;
            }
            else
            {
                //Save the items list
                SaveRadListView("Theme");
                rfvTheme.IsValid = true;
            }
            break;

        case 3:
            if (RadListView2.SelectedItems.Count == 0)
            {
                //Activate the validator if not selected any item
                rfvBeneficiaries.IsValid = false;
                e.Cancel = true;
            }
            else
            {
                //Save the items list
                SaveRadListView("Beneficiaries");
                rfvBeneficiaries.IsValid = true;
            }


            break;

        case 4:
            if (RadListView3.SelectedItems.Count == 0)
            {
                //Activate the validator if not selected any item
                rfvSector.IsValid = false;
                e.Cancel          = true;
            }
            else
            {
                //Save the items list
                SaveRadListView("Sector");
                rfvSector.IsValid = true;
            }


            break;

        case 5:
            if (RadListView4.SelectedItems.Count == 0)
            {
                //Activate the validator if not selected any item
                rfvWhoAreYou.IsValid = false;
                e.Cancel             = true;
            }
            else
            {
                //Save the items list
                SaveRadListView("WhoAreYou");
                rfvWhoAreYou.IsValid = true;
            }
            CountryStateCityEditMode.ViewInEditMode = true;
            CountryStateCityEditMode.DataBind();
            break;

        case 6:

            if (CountryStateCityEditMode.SelectedCity == "")
            {
                //     Message5.Visible = true;
                //    Message5.Text = Localization.GetString("Message5", LocalResourceFile);
                //Activate the validator if not selected any item
                rfvAddress.IsValid = false;
                e.Cancel           = true;
            }
            else
            if (CountryStateCityEditMode.SelectedAddress == "")
            {
                //  //  Message5.Visible = true;
                // //   Message5.Text = Localization.GetString("Message55", LocalResourceFile);
                //Activate the validator if not selected any item
                rfvAddress.IsValid = false;
                e.Cancel           = true;
            }
            //else
            //{
            //  //  Message5.Visible = false;
            //}
            break;
        }
    }