/// <summary> /// Bind data and config the controls (buttons view, CountryStateCityEditMode) /// </summary> public void LoadControl() { organizationComponent = new OrganizationComponent(organizationId); organizationId = organizationComponent.Organization.OrganizationID; btnEditProfile.CommandArgument = "EDIT"; btnEditProfile2.CommandArgument = "EDIT"; FillData(); btnEditProfile.Visible = EnabledButtons; btnEditProfile2.Visible = EnabledButtons; PopulateLabels(); CountryStateCityEditMode.UpdateMap(); CountryStateCityViewMode.UpdateMap(); }
//private void PopulateData() //{ // if (!IsPostBack) // { // BindData(); // } // else // { // BindData(); // } // if (UserController.GetCurrentUserInfo().IsInRole("Administrators") || // UserController.GetCurrentUserInfo().IsInRole("NexsoSupport")) // { // BindData(); // } //} /// <summary> /// Obtener lista de elementos (respuesta) para los pasos 2 a 5 del asistente /// </summary> private void BindData() { var list = ListComponent.GetListPerCategory("Theme", Thread.CurrentThread.CurrentCulture.Name).ToList(); RadListView1.DataSource = list.Where(x => !x.Key.Contains("ctm_")).ToList(); RadListView1.DataBind(); list = ListComponent.GetListPerCategory("Beneficiaries", Thread.CurrentThread.CurrentCulture.Name).ToList(); RadListView2.DataSource = list; RadListView2.DataBind(); list = ListComponent.GetListPerCategory("Sector", Thread.CurrentThread.CurrentCulture.Name).ToList(); RadListView3.DataSource = list; RadListView3.DataBind(); list = ListComponent.GetListPerCategory("WhoAreYou", Thread.CurrentThread.CurrentCulture.Name).ToList(); RadListView4.DataSource = list; RadListView4.DataBind(); //If users is login load the list with its answer if (userId >= 0) { if (!IsPostBack) { SetChkControl("Theme", RadListView1); SetChkControl("Beneficiaries", RadListView2); SetChkControl("Sector", RadListView3); SetChkControl("WhoAreYou", RadListView4); txtEmail.Text = currentUser.Email; txtFirstName.Text = WebUtility.HtmlDecode(currentUser.FirstName); txtLastName.Text = WebUtility.HtmlDecode(currentUser.LastName); CountryStateCityEditMode.SelectedCity = userPropertyComponent.UserProperty.City; CountryStateCityEditMode.SelectedCountry = userPropertyComponent.UserProperty.Country; CountryStateCityEditMode.SelectedState = userPropertyComponent.UserProperty.Region; CountryStateCityEditMode.SelectedAddress = userPropertyComponent.UserProperty.Address; CountryStateCityEditMode.UpdateMap(); } } SetupWizard(Wizard1.ActiveStepIndex); }
/// <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; } } }
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; } }