/// <Summary>CreateEditor creates the control collection.</Summary> protected override void CreateEditor() { CategoryDataField = "PropertyCategory"; EditorDataField = "DataType"; NameDataField = "PropertyName"; RequiredDataField = "Required"; ValidationExpressionDataField = "ValidationExpression"; ValueDataField = "PropertyValue"; VisibleDataField = "Visible"; VisibilityDataField = "Visibility"; LengthDataField = "Length"; base.CreateEditor(); //We need to wire up the RegionControl to the CountryControl foreach( FieldEditorControl editor in Fields ) { if( editor.Editor is DNNRegionEditControl ) { ListEntryInfo country = null; foreach( FieldEditorControl checkEditor in Fields ) { if( checkEditor.Editor is DNNCountryEditControl ) { DNNCountryEditControl countryEdit = (DNNCountryEditControl)checkEditor.Editor; ListController objListController = new ListController(); ListEntryInfoCollection countries = objListController.GetListEntryInfoCollection( "Country" ); foreach( ListEntryInfo checkCountry in countries ) { if( checkCountry.Text == countryEdit.Value.ToString() ) { country = checkCountry; break; } } } } //Create a ListAttribute for the Region string countryKey; if( country != null ) { countryKey = "Country." + country.Value; } else { countryKey = "Country.Unknown"; } object[] attributes; attributes = new object[1]; attributes[0] = new ListAttribute( "Region", countryKey, ListBoundField.Text, ListBoundField.Text ); editor.Editor.CustomAttributes = attributes; } } }
/// <summary> /// Select a list in dropdownlist /// </summary> /// <history> /// [tamttt] 20/10/2004 Created /// </history> protected void ddlSelectList_SelectedIndexChanged(object sender, EventArgs e) { ListController ctlLists = new ListController(); string selList = ddlSelectList.SelectedItem.Value; string listName = selList.Substring(selList.IndexOf(":") + 1); string parentKey = selList.Replace(listName, "").TrimEnd(':'); ddlSelectParent.Enabled = true; ddlSelectParent.DataSource = ctlLists.GetListEntryInfoCollection(listName, parentKey); ddlSelectParent.DataTextField = "DisplayName"; ddlSelectParent.DataValueField = "Key"; ddlSelectParent.DataBind(); ddlSelectParent.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), "")); }
/// <Summary>Page_Load runs when the control is loaded</Summary> protected void Page_Load(object sender, EventArgs e) { try { valStreet.ErrorMessage = Localization.GetString("StreetRequired", Localization.GetResourceFile(this, MyFileName)); valCity.ErrorMessage = Localization.GetString("CityRequired", Localization.GetResourceFile(this, MyFileName)); valCountry.ErrorMessage = Localization.GetString("CountryRequired", Localization.GetResourceFile(this, MyFileName)); valPostal.ErrorMessage = Localization.GetString("PostalRequired", Localization.GetResourceFile(this, MyFileName)); valTelephone.ErrorMessage = Localization.GetString("TelephoneRequired", Localization.GetResourceFile(this, MyFileName)); valCell.ErrorMessage = Localization.GetString("CellRequired", Localization.GetResourceFile(this, MyFileName)); valFax.ErrorMessage = Localization.GetString("FaxRequired", Localization.GetResourceFile(this, MyFileName)); if (!Page.IsPostBack) { if (!String.IsNullOrEmpty(_LabelColumnWidth)) { //lblCountry.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblRegion.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblCity.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblStreet.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblUnit.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblPostal.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblTelephone.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblCell.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) //lblFax.Width = System.Web.UI.WebControls.Unit.Parse(_LabelColumnWidth) } if (!String.IsNullOrEmpty(_ControlColumnWidth)) { cboCountry.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); cboRegion.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtRegion.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtCity.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtStreet.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtUnit.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtPostal.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtTelephone.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtCell.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); txtFax.Width = System.Web.UI.WebControls.Unit.Parse(_ControlColumnWidth); } txtStreet.TabIndex = Convert.ToInt16(_StartTabIndex); txtUnit.TabIndex = Convert.ToInt16(_StartTabIndex + 1); txtCity.TabIndex = Convert.ToInt16(_StartTabIndex + 2); cboCountry.TabIndex = Convert.ToInt16(_StartTabIndex + 3); cboRegion.TabIndex = Convert.ToInt16(_StartTabIndex + 4); txtRegion.TabIndex = Convert.ToInt16(_StartTabIndex + 5); txtPostal.TabIndex = Convert.ToInt16(_StartTabIndex + 6); txtTelephone.TabIndex = Convert.ToInt16(_StartTabIndex + 7); txtCell.TabIndex = Convert.ToInt16(_StartTabIndex + 8); txtFax.TabIndex = Convert.ToInt16(_StartTabIndex + 9); // <tam:note modified to test Lists //Dim objRegionalController As New RegionalController //cboCountry.DataSource = objRegionalController.GetCountries // <this test using method 2: get empty collection then get each entry list on demand & store into cache ListController ctlEntry = new ListController(); ListEntryInfoCollection entryCollection = ctlEntry.GetListEntryInfoCollection("Country"); cboCountry.DataSource = entryCollection; cboCountry.DataBind(); cboCountry.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); switch (_CountryData.ToLower()) { case "text": if (_Country == "") { cboCountry.SelectedIndex = 0; } else { if (cboCountry.Items.FindByText(_Country) != null) { cboCountry.ClearSelection(); cboCountry.Items.FindByText(_Country).Selected = true; } } break; case "value": if (cboCountry.Items.FindByValue(_Country) != null) { cboCountry.ClearSelection(); cboCountry.Items.FindByValue(_Country).Selected = true; } break; } Localize(); if (cboRegion.Visible) { switch (_RegionData.ToLower()) { case "text": if (_Region == "") { cboRegion.SelectedIndex = 0; } else { if (cboRegion.Items.FindByText(_Region) != null) { cboRegion.Items.FindByText(_Region).Selected = true; } } break; case "value": if (cboRegion.Items.FindByValue(_Region) != null) { cboRegion.Items.FindByValue(_Region).Selected = true; } break; } } else { txtRegion.Text = _Region; } txtStreet.Text = _Street; txtUnit.Text = _Unit; txtCity.Text = _City; txtPostal.Text = _Postal; txtTelephone.Text = _Telephone; txtCell.Text = _Cell; txtFax.Text = _Fax; rowStreet.Visible = _ShowStreet; rowUnit.Visible = _ShowUnit; rowCity.Visible = _ShowCity; rowCountry.Visible = _ShowCountry; rowRegion.Visible = _ShowRegion; rowPostal.Visible = _ShowPostal; rowTelephone.Visible = _ShowTelephone; rowCell.Visible = _ShowCell; rowFax.Visible = _ShowFax; if (PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName)) { chkStreet.Visible = true; chkCity.Visible = true; chkCountry.Visible = true; chkRegion.Visible = true; chkPostal.Visible = true; chkTelephone.Visible = true; chkCell.Visible = true; chkFax.Visible = true; } ViewState["ModuleId"] = Convert.ToString(_ModuleId); ViewState["LabelColumnWidth"] = _LabelColumnWidth; ViewState["ControlColumnWidth"] = _ControlColumnWidth; ShowRequiredFields(); } } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(this.ValidationGroupName)) { AddignValidationGroup(this); } ListController ctlEntry = new ListController(); ListEntryInfoCollection entryCollection = ctlEntry.GetListEntryInfoCollection("Country"); if (!Page.IsPostBack) { ddlCountry.DataSource = entryCollection; ddlCountry.DataBind(); ddlCountry.Items.FindByValue("US").Selected = true; string listKey = "Country.US"; ListEntryInfoCollection regionCollection = ctlEntry.GetListEntryInfoCollection("Region", listKey); ddlRegion.DataSource = regionCollection; ddlRegion.DataBind(); atiTxtAddress.TabIndex = Convert.ToInt16(_StartTabIndex); atiTxtCity.TabIndex = Convert.ToInt16(_StartTabIndex + 2); ddlCountry.TabIndex = Convert.ToInt16(_StartTabIndex + 3); ddlRegion.TabIndex = Convert.ToInt16(_StartTabIndex + 4); txtRegion.TabIndex = Convert.ToInt16(_StartTabIndex + 5); atiTxtPostal.TabIndex = Convert.ToInt16(_StartTabIndex + 6); if( this.Width != null ) { ddlCountry.Width = this.Width; ddlRegion.Width = this.Width; atiTxtPostal.Width = this.Width; atiTxtCity.Width = this.Width; atiTxtAddress.Width = this.Width; } } else { // ddlCountry.SelectedValue } } catch (DotNetNuke.Services.Exceptions.ModuleLoadException mlex) { } }
/// <Summary> /// Localize correctly sets up the control for US/Canada/Other Countries /// </Summary> private void Localize() { string countryCode = cboCountry.SelectedItem.Value; ListController ctlEntry = new ListController(); // listKey in format "Country.US:Region" string listKey = "Country." + countryCode; ListEntryInfoCollection entryCollection = ctlEntry.GetListEntryInfoCollection("Region", "", listKey); if (entryCollection.Count != 0) { cboRegion.Visible = true; txtRegion.Visible = false; cboRegion.Items.Clear(); cboRegion.DataSource = entryCollection; cboRegion.DataBind(); cboRegion.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); if (countryCode.ToLower() == "us") { valRegion1.Enabled = true; valRegion2.Enabled = false; valRegion1.ErrorMessage = Localization.GetString("StateRequired", Localization.GetResourceFile(this, MyFileName)); plRegion.Text = Localization.GetString("plState", Localization.GetResourceFile(this, MyFileName)); plRegion.HelpText = Localization.GetString("plState.Help", Localization.GetResourceFile(this, MyFileName)); plPostal.Text = Localization.GetString("plZip", Localization.GetResourceFile(this, MyFileName)); plPostal.HelpText = Localization.GetString("plZip.Help", Localization.GetResourceFile(this, MyFileName)); } else { valRegion1.ErrorMessage = Localization.GetString("ProvinceRequired", Localization.GetResourceFile(this, MyFileName)); plRegion.Text = Localization.GetString("plProvince", Localization.GetResourceFile(this, MyFileName)); plRegion.HelpText = Localization.GetString("plProvince.Help", Localization.GetResourceFile(this, MyFileName)); plPostal.Text = Localization.GetString("plPostal", Localization.GetResourceFile(this, MyFileName)); plPostal.HelpText = Localization.GetString("plPostal.Help", Localization.GetResourceFile(this, MyFileName)); } valRegion1.Enabled = true; valRegion2.Enabled = false; } else { cboRegion.ClearSelection(); cboRegion.Visible = false; txtRegion.Visible = true; valRegion1.Enabled = false; valRegion2.Enabled = true; valRegion2.ErrorMessage = Localization.GetString("RegionRequired", Localization.GetResourceFile(this, MyFileName)); plRegion.Text = Localization.GetString("plRegion", Localization.GetResourceFile(this, MyFileName)); plRegion.HelpText = Localization.GetString("plRegion.Help", Localization.GetResourceFile(this, MyFileName)); plPostal.Text = Localization.GetString("plPostal", Localization.GetResourceFile(this, MyFileName)); plPostal.HelpText = Localization.GetString("plPostal.Help", Localization.GetResourceFile(this, MyFileName)); } if (lblRegionRequired.Text == "") { valRegion1.Enabled = false; valRegion2.Enabled = false; } }
public RegionalInfo GetRegionsFromCountry(string countryCode) { RegionalInfo ri = new RegionalInfo(); ListController ctlEntry = new ListController(); // listKey in format "Country.US:Region" string listKey = "Country." + countryCode; ListEntryInfoCollection entryCollection = ctlEntry.GetListEntryInfoCollection("Region", listKey); if (entryCollection.Count != 0) { foreach (ListEntryInfo lei in entryCollection) { ri.TextArray.Add(lei.Text); ri.ValueArray.Add(lei.Value); } switch (countryCode) { case "US": ri.PostalText = "Zip"; ri.RegionText = "State"; break; case "CA": ri.RegionText = "Province"; ri.PostalText = "Postal"; break; } } else { ri.RegionText = "Region"; ri.PostalText = "Postal"; } return ri; }
/// <summary> /// BindData fetches the data from the database and updates the controls /// </summary> /// <history> /// [cnurse] 9/27/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> private void BindData() { lblVersion.Text = Globals.glbAppVersion; switch( Convert.ToString( Globals.HostSettings["CheckUpgrade"] ) ) { case "": chkUpgrade.Checked = true; break; case "Y": chkUpgrade.Checked = true; break; case "N": chkUpgrade.Checked = false; break; } if( chkUpgrade.Checked ) { hypUpgrade.ImageUrl = string.Format( "{0}/update.aspx?version={1}", Globals.glbUpgradeUrl, lblVersion.Text.Replace( ".", "" ) ); hypUpgrade.NavigateUrl = string.Format( "{0}/redirect.aspx?version={1}", Globals.glbUpgradeUrl, lblVersion.Text.Replace( ".", "" ) ); } else { hypUpgrade.Visible = false; } lblDataProvider.Text = ProviderConfiguration.GetProviderConfiguration( "data" ).DefaultProvider; lblFramework.Text = Environment.Version.ToString(); lblIdentity.Text = WindowsIdentity.GetCurrent().Name; lblHostName.Text = Dns.GetHostName(); PortalController objPortals = new PortalController(); cboHostPortal.DataSource = objPortals.GetPortals(); cboHostPortal.DataBind(); if( Convert.ToString( Globals.HostSettings["HostPortalId"] ) != "" ) { if( cboHostPortal.Items.FindByValue( Convert.ToString( Globals.HostSettings["HostPortalId"] ) ) != null ) { cboHostPortal.Items.FindByValue( Convert.ToString( Globals.HostSettings["HostPortalId"] ) ).Selected = true; } } txtHostTitle.Text = Convert.ToString( Globals.HostSettings["HostTitle"] ); txtHostURL.Text = Convert.ToString( Globals.HostSettings["HostURL"] ); txtHostEmail.Text = Convert.ToString( Globals.HostSettings["HostEmail"] ); //SkinController objSkins = new SkinController(); SkinInfo objSkin; ctlHostSkin.Width = "252px"; ctlHostSkin.SkinRoot = SkinInfo.RootSkin; objSkin = SkinController.GetSkin( SkinInfo.RootSkin, Null.NullInteger, SkinType.Portal ); if( objSkin != null ) { if( Null.IsNull( objSkin.PortalId ) ) { ctlHostSkin.SkinSrc = objSkin.SkinSrc; } } ctlHostContainer.Width = "252px"; ctlHostContainer.SkinRoot = SkinInfo.RootContainer; objSkin = SkinController.GetSkin( SkinInfo.RootContainer, Null.NullInteger, SkinType.Portal ); if( objSkin != null ) { if( Null.IsNull( objSkin.PortalId ) ) { ctlHostContainer.SkinSrc = objSkin.SkinSrc; } } ctlAdminSkin.Width = "252px"; ctlAdminSkin.SkinRoot = SkinInfo.RootSkin; objSkin = SkinController.GetSkin( SkinInfo.RootSkin, Null.NullInteger, SkinType.Admin ); if( objSkin != null ) { if( Null.IsNull( objSkin.PortalId ) ) { ctlAdminSkin.SkinSrc = objSkin.SkinSrc; } } ctlAdminContainer.Width = "252px"; ctlAdminContainer.SkinRoot = SkinInfo.RootContainer; objSkin = SkinController.GetSkin( SkinInfo.RootContainer, Null.NullInteger, SkinType.Admin ); if( objSkin != null ) { if( Null.IsNull( objSkin.PortalId ) ) { ctlAdminContainer.SkinSrc = objSkin.SkinSrc; } } ModuleControlController objModuleControls = new ModuleControlController(); ArrayList arrModuleControls = objModuleControls.GetModuleControls( Null.NullInteger ); int intModuleControl; for( intModuleControl = 0; intModuleControl <= arrModuleControls.Count - 1; intModuleControl++ ) { ModuleControlInfo objModuleControl = (ModuleControlInfo)arrModuleControls[intModuleControl]; if( objModuleControl.ControlType == SecurityAccessLevel.ControlPanel ) { cboControlPanel.Items.Add( new ListItem( objModuleControl.ControlKey.Replace( "CONTROLPANEL:", "" ), objModuleControl.ControlSrc ) ); } } if( Convert.ToString( Globals.HostSettings["ControlPanel"] ) != "" ) { if( cboControlPanel.Items.FindByValue( Convert.ToString( Globals.HostSettings["ControlPanel"] ) ) != null ) { cboControlPanel.Items.FindByValue( Convert.ToString( Globals.HostSettings["ControlPanel"] ) ).Selected = true; } } else { if( cboControlPanel.Items.FindByValue( Globals.glbDefaultControlPanel ) != null ) { cboControlPanel.Items.FindByValue( Globals.glbDefaultControlPanel ).Selected = true; } } ListController ctlList = new ListController(); ListEntryInfoCollection colProcessor = ctlList.GetListEntryInfoCollection( "Processor", "" ); cboProcessor.DataSource = colProcessor; cboProcessor.DataBind(); cboProcessor.Items.Insert( 0, new ListItem( "<" + Localization.GetString( "None_Specified" ) + ">", "" ) ); if( cboProcessor.Items.FindByText( Globals.HostSettings["PaymentProcessor"].ToString() ) != null ) { cboProcessor.Items.FindByText( Globals.HostSettings["PaymentProcessor"].ToString() ).Selected = true; } txtUserId.Text = Convert.ToString( Globals.HostSettings["ProcessorUserId"] ); txtPassword.Attributes.Add( "value", Convert.ToString( Globals.HostSettings["ProcessorPassword"] ) ); txtHostFee.Text = Convert.ToString( Globals.HostSettings["HostFee"] ); ListEntryInfoCollection colCurrency = ctlList.GetListEntryInfoCollection( "Currency", "" ); cboHostCurrency.DataSource = colCurrency; cboHostCurrency.DataBind(); if( cboHostCurrency.Items.FindByValue( Convert.ToString( Globals.HostSettings["HostCurrency"] ) ) != null ) { cboHostCurrency.Items.FindByValue( Globals.HostSettings["HostCurrency"].ToString() ).Selected = true; } else { cboHostCurrency.Items.FindByValue( "USD" ).Selected = true; } if( cboSchedulerMode.Items.FindByValue( Convert.ToString( Globals.HostSettings["SchedulerMode"] ) ) != null ) { cboSchedulerMode.Items.FindByValue( Globals.HostSettings["SchedulerMode"].ToString() ).Selected = true; } else { cboSchedulerMode.Items.FindByValue( "1" ).Selected = true; } txtHostSpace.Text = Convert.ToString( Globals.HostSettings["HostSpace"] ); txtPageQuota.Text = Convert.ToString(Globals.HostSettings["PageQuota"]); txtUserQuota.Text = Convert.ToString(Globals.HostSettings["UserQuota"]); if( Convert.ToString( Globals.HostSettings["SiteLogStorage"] ) == "" ) { optSiteLogStorage.Items.FindByValue( "D" ).Selected = true; } else { optSiteLogStorage.Items.FindByValue( Convert.ToString( Globals.HostSettings["SiteLogStorage"] ) ).Selected = true; } if( Convert.ToString( Globals.HostSettings["SiteLogBuffer"] ) == "" ) { txtSiteLogBuffer.Text = "1"; } else { txtSiteLogBuffer.Text = Convert.ToString( Globals.HostSettings["SiteLogBuffer"] ); } txtSiteLogHistory.Text = Convert.ToString( Globals.HostSettings["SiteLogHistory"] ); if (Convert.ToString(Globals.HostSettings["PageStatePersister"]) == "") { cboPageState.Items.FindByValue("P").Selected = true; } else { cboPageState.Items.FindByValue(Convert.ToString(Globals.HostSettings["PageStatePersister"])).Selected = true; } if( Convert.ToString( Globals.HostSettings["ModuleCaching"] ) == "" ) { cboCacheMethod.Items.FindByValue( "M" ).Selected = true; } else { cboCacheMethod.Items.FindByValue( Convert.ToString( Globals.HostSettings["ModuleCaching"] ) ).Selected = true; } if (cboPerformance.Items.FindByValue(Convert.ToString(Globals.HostSettings["PerformanceSetting"])) != null) { cboPerformance.Items.FindByValue(Globals.HostSettings["PerformanceSetting"].ToString()).Selected = true; } else { cboPerformance.Items.FindByValue("3").Selected = true; } if (cboCacheability.Items.FindByValue(Convert.ToString(Globals.HostSettings["AuthenticatedCacheability"])) != null) { cboCacheability.Items.FindByValue(Globals.HostSettings["AuthenticatedCacheability"].ToString()).Selected = true; } else { cboCacheability.Items.FindByValue("4").Selected = true; } if (cboCompression.Items.FindByValue(Convert.ToString(Globals.HostSettings["HttpCompression"])) != null) { cboCompression.Items.FindByValue(Globals.HostSettings["HttpCompression"].ToString()).Selected = true; } else { cboCompression.Items.FindByValue("0").Selected = true; } if (cboLevel.Items.FindByValue(Convert.ToString(Globals.HostSettings["HttpCompressionLevel"])) != null) { cboLevel.Items.FindByValue(Globals.HostSettings["HttpCompressionLevel"].ToString()).Selected = true; } else { cboLevel.Items.FindByValue("0").Selected = true; } if (Convert.ToString(Globals.HostSettings["WhitespaceFilter"]) == "Y") { chkWhitespace.Checked = true; } else { chkWhitespace.Checked = false; } string filePath = Globals.ApplicationMapPath + "\\Compression.config"; if (File.Exists(filePath)) { FileStream fileReader = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); XPathDocument doc = new XPathDocument(fileReader); foreach (XPathNavigator nav in doc.CreateNavigator().Select("compression/excludedMimeTypes/mimeType")) { txtExcludedMimeTypes.Text += nav.Value.ToLower() + Environment.NewLine; } foreach (XPathNavigator nav in doc.CreateNavigator().Select("compression/excludedPaths/path")) { txtExcludedPaths.Text += nav.Value.ToLower() + Environment.NewLine; } txtWhitespaceFilter.Text = doc.CreateNavigator().SelectSingleNode("compression/whitespace").Value; } txtDemoPeriod.Text = Convert.ToString( Globals.HostSettings["DemoPeriod"] ); if( Convert.ToString( Globals.HostSettings["DemoSignup"] ) == "Y" ) { chkDemoSignup.Checked = true; } else { chkDemoSignup.Checked = false; } if( Globals.GetHashValue( Globals.HostSettings["Copyright"], "Y" ) == "Y" ) { chkCopyright.Checked = true; } else { chkCopyright.Checked = false; } if( Globals.HostSettings.ContainsKey( "DisableUsersOnline" ) ) { if( Globals.HostSettings["DisableUsersOnline"].ToString() == "Y" ) { chkUsersOnline.Checked = true; } else { chkUsersOnline.Checked = false; } } else { chkUsersOnline.Checked = false; } txtUsersOnlineTime.Text = Convert.ToString( Globals.HostSettings["UsersOnlineTime"] ); txtAutoAccountUnlock.Text = Convert.ToString( Globals.HostSettings["AutoAccountUnlockDuration"] ); txtProxyServer.Text = Convert.ToString( Globals.HostSettings["ProxyServer"] ); txtProxyPort.Text = Convert.ToString( Globals.HostSettings["ProxyPort"] ); txtProxyUsername.Text = Convert.ToString( Globals.HostSettings["ProxyUsername"] ); txtProxyPassword.Attributes.Add( "value", Convert.ToString( Globals.HostSettings["ProxyPassword"] ) ); txtSMTPServer.Text = Convert.ToString( Globals.HostSettings["SMTPServer"] ); if( Convert.ToString( Globals.HostSettings["SMTPAuthentication"] ) != "" ) { optSMTPAuthentication.Items.FindByValue( Globals.HostSettings["SMTPAuthentication"].ToString() ).Selected = true; } else { optSMTPAuthentication.Items.FindByValue( "0" ).Selected = true; } if (Convert.ToString(Globals.HostSettings["SMTPEnableSSL"]) == "Y") { chkSMTPEnableSSL.Checked = true; } else { chkSMTPEnableSSL.Checked = false; } txtSMTPUsername.Text = Convert.ToString( Globals.HostSettings["SMTPUsername"] ); txtSMTPPassword.Attributes.Add( "value", Convert.ToString( Globals.HostSettings["SMTPPassword"] ) ); txtFileExtensions.Text = Convert.ToString( Globals.HostSettings["FileExtensions"] ); if( Globals.HostSettings.ContainsKey( "UseCustomErrorMessages" ) ) { if( Globals.HostSettings["UseCustomErrorMessages"].ToString() == "Y" ) { chkUseCustomErrorMessages.Checked = true; } else { chkUseCustomErrorMessages.Checked = false; } } else { chkUseCustomErrorMessages.Checked = false; } if( Globals.HostSettings.ContainsKey( "UseFriendlyUrls" ) ) { if( Globals.HostSettings["UseFriendlyUrls"].ToString() == "Y" ) { chkUseFriendlyUrls.Checked = true; } else { chkUseFriendlyUrls.Checked = false; } } else { chkUseFriendlyUrls.Checked = false; } rowFriendlyUrls.Visible = chkUseFriendlyUrls.Checked; if( Globals.HostSettings.ContainsKey( "EventLogBuffer" ) ) { if( Globals.HostSettings["EventLogBuffer"].ToString() == "Y" ) { chkLogBuffer.Checked = true; } else { chkLogBuffer.Checked = false; } } else { chkLogBuffer.Checked = false; } if( Convert.ToString( Globals.HostSettings["SkinUpload"] ) != "" ) { optSkinUpload.Items.FindByValue( Globals.HostSettings["SkinUpload"].ToString() ).Selected = true; } else { optSkinUpload.Items.FindByValue( "G" ).Selected = true; } txtHelpURL.Text = Convert.ToString( Globals.HostSettings["HelpURL"] ); if( Globals.HostSettings.ContainsKey( "EnableModuleOnLineHelp" ) ) { if( Globals.HostSettings["EnableModuleOnLineHelp"].ToString() == "Y" ) { chkEnableHelp.Checked = true; } else { chkEnableHelp.Checked = false; } } else { chkEnableHelp.Checked = true; } if (Globals.HostSettings.ContainsKey("EnableFileAutoSync")) { if (Globals.HostSettings["EnableFileAutoSync"].ToString() == "Y") { chkAutoSync.Checked = true; } else { chkAutoSync.Checked = false; } } else { chkAutoSync.Checked = false; } ViewState["SelectedSchedulerMode"] = cboSchedulerMode.SelectedItem.Value; ViewState["SelectedLogBufferEnabled"] = chkLogBuffer.Checked; ViewState["SelectedUsersOnlineEnabled"] = chkUsersOnline.Checked; // Get the name of the data provider ProviderConfiguration objProviderConfiguration = ProviderConfiguration.GetProviderConfiguration( "data" ); // get list of script files string strProviderPath = PortalSettings.GetProviderPath(); ArrayList arrScriptFiles = new ArrayList(); string[] arrFiles = Directory.GetFiles( strProviderPath, "*." + objProviderConfiguration.DefaultProvider ); foreach( string strFile in arrFiles ) { arrScriptFiles.Add( Path.GetFileNameWithoutExtension( strFile ) ); } arrScriptFiles.Sort(); cboUpgrade.DataSource = arrScriptFiles; cboUpgrade.DataBind(); ModuleInfo FileManagerModule = ( new ModuleController() ).GetModuleByDefinition( Null.NullInteger, "File Manager" ); string[] additionalParameters = new string[3]; additionalParameters[0] = "mid=" + FileManagerModule.ModuleID; additionalParameters[1] = "ftype=" + UploadType.Skin; additionalParameters[2] = "rtab=" + this.TabId; lnkUploadSkin.NavigateUrl = Globals.NavigateURL( FileManagerModule.TabID, "Edit", additionalParameters ); additionalParameters[1] = "ftype=" + UploadType.Container; lnkUploadContainer.NavigateUrl = Globals.NavigateURL( FileManagerModule.TabID, "Edit", additionalParameters ); }
/// <summary> /// Processes all Profile Definitions from the template /// </summary> /// <param name="nodeProfileDefinitions">Template file node for the Profile Definitions</param> /// <param name="PortalId">PortalId of the new portal</param> private void ParseProfileDefinitions( XmlNode nodeProfileDefinitions, int PortalId ) { ListController objListController = new ListController(); ListEntryInfoCollection colDataTypes = objListController.GetListEntryInfoCollection( "DataType" ); int OrderCounter = -1; ProfilePropertyDefinition objProfileDefinition = null; foreach( XmlNode node in nodeProfileDefinitions.SelectNodes( "//profiledefinition" ) ) { OrderCounter += 2; ListEntryInfo typeInfo = colDataTypes.Item( "DataType." + XmlUtils.GetNodeValue( node, "datatype", "" ) ); if( typeInfo == null ) { typeInfo = colDataTypes.Item("DataType.Unknown"); } objProfileDefinition = new ProfilePropertyDefinition(); objProfileDefinition.DataType = typeInfo.EntryID; objProfileDefinition.DefaultValue = ""; objProfileDefinition.ModuleDefId = Null.NullInteger; objProfileDefinition.PortalId = PortalId; objProfileDefinition.PropertyCategory = XmlUtils.GetNodeValue( node, "propertycategory", "" ); objProfileDefinition.PropertyName = XmlUtils.GetNodeValue( node, "propertyname", "" ); objProfileDefinition.Required = false; objProfileDefinition.Visible = true; objProfileDefinition.ViewOrder = OrderCounter; objProfileDefinition.Length = XmlUtils.GetNodeValueInt( node, "length", 0 ); ProfileController.AddPropertyDefinition( objProfileDefinition ); } }
protected void lnkbtn_EditProfile_Click(object sender, EventArgs e) { // string navurl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", query); //HttpContext.Current.Response.Redirect(navurl); lnkbtn_UpdateProfile.Visible = true; lnkbtn_EditProfile.Visible = false; lnkbtn_editProfileSettings.Visible = false; lnkbtn_ChangePassword.Visible = false; Ourspace_Utilities.View util = new Ourspace_Utilities.View(); if (!util.IsFacebookUser(UserId)) { txt_FirstName.Visible = true; txt_LastName.Visible = true; txt_FirstName.Text = lbl_FirstNameValue.Text; txt_LastName.Text = lbl_LastNameValue.Text; lbl_FirstNameValue.Visible = false; lbl_LastNameValue.Visible = false; lnkbtn_ChangePhoto.Visible = true; } //pnlEditDate.Visible = true; txt_City.Visible = true; txt_City.Text = lbl_CityValue.Text; lbl_CityValue.Visible = false; ddlCountries.Visible = true; lbl_CountryValue.Visible = false; txt_DOB.Visible = true; // txt_DOB.Text = lbl_AgeValue.Text; ListController lc = new ListController(); ListEntryInfoCollection leic = lc.GetListEntryInfoCollection("Country", "", ""); ddlCountries.DataTextField = "Text"; ddlCountries.DataValueField = "Value"; ddlCountries.DataSource = leic; ddlCountries.DataBind(); int selectedIndex = 0; int i = 0; foreach (ListItem item in ddlCountries.Items) { if (item.Text == lbl_CountryValue.Text) { selectedIndex = i; } i++; } ddlCountries.SelectedIndex = selectedIndex; lnkbtn_cancel.Visible = true; // lnkbtn_ChangePhoto.Visible = false; //ddlCountries.Items.Insert(0, new ListItem("Select Country", "-1")); }
private void loadCountryList() { ListController ctlEntry = new ListController(); ListEntryInfoCollection entryCollection = ctlEntry.GetListEntryInfoCollection("Country"); cboCountry.DataSource = entryCollection; cboCountry.DataBind(); }
private void loadRegionList() { string countryCode = cboCountry.SelectedItem.Value; string listKey = "Country." + countryCode; ListController ctlEntry = new ListController(); ListEntryInfoCollection entryCollection = ctlEntry.GetListEntryInfoCollection("Region", "", listKey); cboRegion.DataSource = entryCollection; cboRegion.DataBind(); }
/// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <history> /// [cnurse] 9/8/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> protected void Page_Load( Object sender, EventArgs e ) { try { if( ( Request.QueryString["pid"] != null ) && ( PortalSettings.ActiveTab.ParentId == PortalSettings.SuperTabId || UserInfo.IsSuperUser ) ) { intPortalId = int.Parse( Request.QueryString["pid"] ); ctlLogo.ShowUpLoad = false; ctlBackground.ShowUpLoad = false; } else { intPortalId = PortalId; ctlLogo.ShowUpLoad = true; ctlBackground.ShowUpLoad = true; } //this needs to execute always to the client script code is registred in InvokePopupCal cmdExpiryCalendar.NavigateUrl = Calendar.InvokePopupCal( txtExpiryDate ); ClientAPI.AddButtonConfirm( cmdRestore, Localization.GetString( "RestoreCCSMessage", LocalResourceFile ) ); // If this is the first visit to the page, populate the site data if( Page.IsPostBack == false ) { ClientAPI.AddButtonConfirm( cmdDelete, Localization.GetString( "DeleteMessage", LocalResourceFile ) ); PortalController objPortalController = new PortalController(); ListController ctlList = new ListController(); ListEntryInfoCollection colProcessor = ctlList.GetListEntryInfoCollection( "Processor" ); cboProcessor.DataSource = colProcessor; cboProcessor.DataBind(); cboProcessor.Items.Insert( 0, new ListItem( "<" + Localization.GetString( "None_Specified" ) + ">", "" ) ); PortalInfo objPortal = objPortalController.GetPortal( intPortalId ); txtPortalName.Text = objPortal.PortalName; ctlLogo.Url = objPortal.LogoFile; ctlLogo.FileFilter = Globals.glbImageFileTypes; txtDescription.Text = objPortal.Description; txtKeyWords.Text = objPortal.KeyWords; ctlBackground.Url = objPortal.BackgroundFile; ctlBackground.FileFilter = Globals.glbImageFileTypes; txtFooterText.Text = objPortal.FooterText; optUserRegistration.SelectedIndex = objPortal.UserRegistration; optBannerAdvertising.SelectedIndex = objPortal.BannerAdvertising; cboSplashTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false ); cboSplashTabId.DataBind(); if( cboSplashTabId.Items.FindByValue( objPortal.SplashTabId.ToString() ) != null ) { cboSplashTabId.Items.FindByValue( objPortal.SplashTabId.ToString() ).Selected = true; } cboHomeTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false ); cboHomeTabId.DataBind(); if( cboHomeTabId.Items.FindByValue( objPortal.HomeTabId.ToString() ) != null ) { cboHomeTabId.Items.FindByValue( objPortal.HomeTabId.ToString() ).Selected = true; } cboLoginTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false ); cboLoginTabId.DataBind(); if( cboLoginTabId.Items.FindByValue( objPortal.LoginTabId.ToString() ) != null ) { cboLoginTabId.Items.FindByValue( objPortal.LoginTabId.ToString() ).Selected = true; } cboUserTabId.DataSource = Globals.GetPortalTabs( intPortalId, true, true, false, false, false ); cboUserTabId.DataBind(); if( cboUserTabId.Items.FindByValue( objPortal.UserTabId.ToString() ) != null ) { cboUserTabId.Items.FindByValue( objPortal.UserTabId.ToString() ).Selected = true; } ListEntryInfoCollection colList = ctlList.GetListEntryInfoCollection( "Currency" ); cboCurrency.DataSource = colList; cboCurrency.DataBind(); if( Null.IsNull( objPortal.Currency ) || cboCurrency.Items.FindByValue( objPortal.Currency ) == null ) { cboCurrency.Items.FindByValue( "USD" ).Selected = true; } else { cboCurrency.Items.FindByValue( objPortal.Currency ).Selected = true; } RoleController objRoleController = new RoleController(); ArrayList Arr = objRoleController.GetUserRolesByRoleName( intPortalId, objPortal.AdministratorRoleName ); int i; for( i = 0; i <= Arr.Count - 1; i++ ) { UserRoleInfo objUser = (UserRoleInfo)Arr[i]; cboAdministratorId.Items.Add( new ListItem( objUser.FullName, objUser.UserID.ToString() ) ); } if( cboAdministratorId.Items.FindByValue( objPortal.AdministratorId.ToString() ) != null ) { cboAdministratorId.Items.FindByValue( objPortal.AdministratorId.ToString() ).Selected = true; } if( ! Null.IsNull( objPortal.ExpiryDate ) ) { txtExpiryDate.Text = objPortal.ExpiryDate.ToShortDateString(); } txtHostFee.Text = objPortal.HostFee.ToString(); txtHostSpace.Text = objPortal.HostSpace.ToString(); txtPageQuota.Text = objPortal.PageQuota.ToString(); txtUserQuota.Text = objPortal.UserQuota.ToString(); if( objPortal.SiteLogHistory != 0 ) { txtSiteLogHistory.Text = objPortal.SiteLogHistory.ToString(); } DesktopModuleController objDesktopModules = new DesktopModuleController(); ArrayList arrDesktopModules = objDesktopModules.GetDesktopModules(); ArrayList arrPremiumModules = new ArrayList(); foreach( DesktopModuleInfo objDesktopModule in arrDesktopModules ) { if( objDesktopModule.IsPremium ) { arrPremiumModules.Add( objDesktopModule ); } } ArrayList arrPortalDesktopModules = objDesktopModules.GetPortalDesktopModules( intPortalId, Null.NullInteger ); foreach( PortalDesktopModuleInfo objPortalDesktopModule in arrPortalDesktopModules ) { foreach( DesktopModuleInfo objDesktopModule in arrPremiumModules ) { if( objDesktopModule.DesktopModuleID == objPortalDesktopModule.DesktopModuleID ) { arrPremiumModules.Remove( objDesktopModule ); break; } } } ctlDesktopModules.Available = arrPremiumModules; ctlDesktopModules.Assigned = arrPortalDesktopModules; if( !String.IsNullOrEmpty( objPortal.PaymentProcessor ) ) { if( cboProcessor.Items.FindByText( objPortal.PaymentProcessor ) != null ) { cboProcessor.Items.FindByText( objPortal.PaymentProcessor ).Selected = true; } else // default { if( cboProcessor.Items.FindByText( "PayPal" ) != null ) { cboProcessor.Items.FindByText( "PayPal" ).Selected = true; } } } else { cboProcessor.Items.FindByValue( "" ).Selected = true; } txtUserId.Text = objPortal.ProcessorUserId; txtPassword.Attributes.Add( "value", objPortal.ProcessorPassword ); txtHomeDirectory.Text = objPortal.HomeDirectory; //Populate the default language combobox Localization.LoadCultureDropDownList( cboDefaultLanguage, CultureDropDownTypes.NativeName, objPortal.DefaultLanguage ); //Populate the timezone combobox (look up timezone translations based on currently set culture) Localization.LoadTimeZoneDropDownList( cboTimeZone, ( (PageBase)Page ).PageCulture.Name, Convert.ToString( objPortal.TimeZoneOffset ) ); SkinInfo objSkin; ctlPortalSkin.Width = "275px"; ctlPortalSkin.SkinRoot = SkinInfo.RootSkin; objSkin = SkinController.GetSkin( SkinInfo.RootSkin, PortalId, SkinType.Portal ); if( objSkin != null ) { if( objSkin.PortalId == PortalId ) { ctlPortalSkin.SkinSrc = objSkin.SkinSrc; } } ctlPortalContainer.Width = "275px"; ctlPortalContainer.SkinRoot = SkinInfo.RootContainer; objSkin = SkinController.GetSkin( SkinInfo.RootContainer, PortalId, SkinType.Portal ); if( objSkin != null ) { if( objSkin.PortalId == PortalId ) { ctlPortalContainer.SkinSrc = objSkin.SkinSrc; } } ctlAdminSkin.Width = "275px"; ctlAdminSkin.SkinRoot = SkinInfo.RootSkin; objSkin = SkinController.GetSkin( SkinInfo.RootSkin, PortalId, SkinType.Admin ); if( objSkin != null ) { if( objSkin.PortalId == PortalId ) { ctlAdminSkin.SkinSrc = objSkin.SkinSrc; } } ctlAdminContainer.Width = "275px"; ctlAdminContainer.SkinRoot = SkinInfo.RootContainer; objSkin = SkinController.GetSkin( SkinInfo.RootContainer, PortalId, SkinType.Admin ); if( objSkin != null ) { if( objSkin.PortalId == PortalId ) { ctlAdminContainer.SkinSrc = objSkin.SkinSrc; } } LoadStyleSheet(); if( Convert.ToString( PortalSettings.HostSettings["SkinUpload"] ) == "G" && ! UserInfo.IsSuperUser ) { lnkUploadSkin.Visible = false; lnkUploadContainer.Visible = false; } else { ModuleInfo FileManagerModule = ( new ModuleController() ).GetModuleByDefinition( intPortalId, "File Manager" ); string[] parameters = new string[3]; parameters[0] = "mid=" + FileManagerModule.ModuleID; parameters[1] = "ftype=" + UploadType.Skin; parameters[2] = "rtab=" + TabId; lnkUploadSkin.NavigateUrl = Globals.NavigateURL( FileManagerModule.TabID, "Edit", parameters ); parameters[1] = "ftype=" + UploadType.Container; lnkUploadContainer.NavigateUrl = Globals.NavigateURL( FileManagerModule.TabID, "Edit", parameters ); } if( Request.UrlReferrer != null ) { if( Request.UrlReferrer.AbsoluteUri == Request.Url.AbsoluteUri ) { ViewState["UrlReferrer"] = ""; } else { ViewState["UrlReferrer"] = Convert.ToString( Request.UrlReferrer ); } } else { ViewState["UrlReferrer"] = ""; } } if( UserInfo.IsSuperUser ) { dshHost.Visible = true; tblHost.Visible = true; cmdDelete.Visible = true; if( Convert.ToString( ViewState["UrlReferrer"] ) == "" ) { cmdCancel.Visible = false; } else { cmdCancel.Visible = true; } } else { dshHost.Visible = false; tblHost.Visible = false; cmdDelete.Visible = false; cmdCancel.Visible = false; } } catch( Exception exc ) //Module failed to load { Exceptions.ProcessModuleLoadException( this, exc ); } }
private void loadCountryList() { ListController ctlEntry = new ListController(); ListEntryInfoCollection entryCollection = ctlEntry.GetListEntryInfoCollection("Country"); cboCountry.DataSource = entryCollection; cboCountry.DataBind(); cboCountry_SelectedIndexChanged(cboCountry, null); //cboCountry.Items.Insert(0, new ListItem("<" + Services.Localization.Localization.GetString("Not_Specified", Services.Localization.Localization.SharedResourceFile) + ">", "")); }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 9/15/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> /// ----------------------------------------------------------------------------- protected override void OnLoad(EventArgs e) { base.OnLoad(e); cmdDisplay.Click += OnDisplayClick; try { //If this is the first visit to the page, bind the role data to the datalist if (Page.IsPostBack == false) { var strSiteLogStorage = "D"; if (!string.IsNullOrEmpty(Host.SiteLogStorage)) { strSiteLogStorage = Host.SiteLogStorage; } if (strSiteLogStorage == "F") { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("FileSystem", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); cmdDisplay.Visible = false; } else { switch (PortalSettings.SiteLogHistory) { case -1: //unlimited break; case 0: UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("LogDisabled", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); break; default: UI.Skins.Skin.AddModuleMessage(this, string.Format(Localization.GetString("LogHistory", LocalResourceFile), PortalSettings.SiteLogHistory), ModuleMessage.ModuleMessageType.YellowWarning); break; } cmdDisplay.Visible = true; } var ctlList = new ListController(); var colSiteLogReports = ctlList.GetListEntryInfoCollection("Site Log Reports"); cboReportType.DataSource = colSiteLogReports; cboReportType.DataBind(); cboReportType.SelectedIndex = 0; diStartDate.SelectedDate = DefaultBeginDate; diEndDate.SelectedDate = DefaultEndDate; } } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
private void FillState() { // Load the state list based on country ListController controller = new ListController(); ListEntryInfoCollection states = controller.GetListEntryInfoCollection("Region"); this.RegionDropDownList.DataSource = states; this.RegionDropDownList.DataTextField = "Text"; this.RegionDropDownList.DataValueField = "EntryID"; this.RegionDropDownList.DataBind(); this.RegionDropDownList.Items.Insert(0, new ListItem(Localization.GetString("None", this.LocalResourceFile), string.Empty)); }
private void FillCountry() { ListController controller = new ListController(); ListEntryInfoCollection countries = controller.GetListEntryInfoCollection("Country"); this.CountryDropDownList.DataSource = countries; this.CountryDropDownList.DataTextField = "Text"; this.CountryDropDownList.DataValueField = "EntryId"; this.CountryDropDownList.DataBind(); this.CountryDropDownList.Items.Insert(0, new ListItem(Localization.GetString("ChooseOne", this.LocalResourceFile), string.Empty)); ListItem defaultItem = this.CountryDropDownList.Items.FindByValue(Dnn.Utility.GetStringSetting(this.Settings, "DefaultCountry", string.Empty)); this.CountryDropDownList.Items.Remove(defaultItem); this.CountryDropDownList.Items.Insert(1, defaultItem); this.CountryDropDownList.SelectedIndex = 1; }
private void BindPaymentProcessor(PortalInfo portal) { var listController = new ListController(); currencyCombo.DataSource = listController.GetListEntryInfoCollection("Currency", ""); var currency = portal.Currency; if (String.IsNullOrEmpty(currency)) { currency = "USD"; } currencyCombo.DataBind(currency); processorCombo.DataSource = listController.GetListEntryInfoCollection("Processor", ""); processorCombo.DataBind(); processorCombo.InsertItem(0, "<" + Localization.GetString("None_Specified") + ">", ""); processorCombo.Select(Host.PaymentProcessor, true); processorLink.NavigateUrl = Globals.AddHTTP(processorCombo.SelectedItem.Value); txtUserId.Text = portal.ProcessorUserId; txtPassword.Attributes.Add("value", portal.ProcessorPassword); // use sandbox? bool bolPayPalSandbox = Boolean.Parse(PortalController.GetPortalSetting("paypalsandbox", portal.PortalID, "false")); chkPayPalSandboxEnabled.Checked = bolPayPalSandbox; // return url after payment or on cancel string strPayPalReturnURL = PortalController.GetPortalSetting("paypalsubscriptionreturn", portal.PortalID, Null.NullString); txtPayPalReturnURL.Text = strPayPalReturnURL; string strPayPalCancelURL = PortalController.GetPortalSetting("paypalsubscriptioncancelreturn", portal.PortalID, Null.NullString); txtPayPalCancelURL.Text = strPayPalCancelURL; }
/// ----------------------------------------------------------------------------- /// <summary> /// Select a list in dropdownlist /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [tamttt] 20/10/2004 Created /// [cnurse] 01/30/2007 Extracted to separte user control /// </history> /// ----------------------------------------------------------------------------- protected void SelectListIndexChanged(object sender, EventArgs e) { var ctlLists = new ListController(); if(!String.IsNullOrEmpty(ddlSelectList.SelectedValue)) { ListInfo selList = GetList(ddlSelectList.SelectedItem.Value, false); { ddlSelectParent.Enabled = true; ddlSelectParent.DataSource = ctlLists.GetListEntryInfoCollection(selList.Name, selList.ParentKey); ddlSelectParent.DataTextField = "DisplayName"; ddlSelectParent.DataValueField = "EntryID"; ddlSelectParent.DataBind(); } } else { ddlSelectParent.Enabled = false; ddlSelectParent.Items.Clear(); } }
/// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 9/15/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> protected void Page_Load( Object sender, EventArgs e ) { try { //this needs to execute always to the client script code is registred in InvokePopupCal cmdStartCalendar.NavigateUrl = Calendar.InvokePopupCal( txtStartDate ); cmdEndCalendar.NavigateUrl = Calendar.InvokePopupCal( txtEndDate ); // If this is the first visit to the page, bind the role data to the datalist if( Page.IsPostBack == false ) { string strSiteLogStorage = "D"; if( Convert.ToString( Globals.HostSettings["SiteLogStorage"] ) != "" ) { strSiteLogStorage = Convert.ToString( Globals.HostSettings["SiteLogStorage"] ); } if( strSiteLogStorage == "F" ) { UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "LogDisabled", this.LocalResourceFile ), ModuleMessageType.YellowWarning ); cmdDisplay.Visible = false; } else { switch( PortalSettings.SiteLogHistory ) { case - 1: // unlimited break; case 0: UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "LogDisabled", this.LocalResourceFile ), ModuleMessageType.YellowWarning ); break; default: UI.Skins.Skin.AddModuleMessage( this, string.Format( Localization.GetString( "LogHistory", this.LocalResourceFile ), PortalSettings.SiteLogHistory ), ModuleMessageType.YellowWarning ); break; } cmdDisplay.Visible = true; } ListController ctlList = new ListController(); ListEntryInfoCollection colSiteLogReports = ctlList.GetListEntryInfoCollection( "Site Log Reports" ); cboReportType.DataSource = colSiteLogReports; cboReportType.DataBind(); cboReportType.SelectedIndex = 0; txtStartDate.Text = DateTime.Today.AddDays(-6).ToShortDateString(); txtEndDate.Text = DateTime.Today.AddDays(1).ToShortDateString(); // Store URL Referrer to return to portal if( Request.UrlReferrer != null ) { if( Request.UrlReferrer.AbsoluteUri == Request.Url.AbsoluteUri ) { ViewState["UrlReferrer"] = ""; } else { ViewState["UrlReferrer"] = Convert.ToString( Request.UrlReferrer ); } } else { ViewState["UrlReferrer"] = ""; } } if( Convert.ToString( ViewState["UrlReferrer"] ) == "" ) { cmdCancel.Visible = false; } else { cmdCancel.Visible = true; } } catch( Exception exc ) //Module failed to load { Exceptions.ProcessModuleLoadException( this, exc ); } }
private static int ResolveCountry(string country) { int id = -1; ListController controller = new ListController(); ListEntryInfoCollection info = controller.GetListEntryInfoCollection("Country"); // controller.GetListEntryInfo("Country", country); foreach (ListEntryInfo entry in info) { if (entry.Text == country) { id = entry.EntryID; } } return id; }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 9/10/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> /// ----------------------------------------------------------------------------- protected override void OnLoad(EventArgs e) { base.OnLoad(e); jQuery.RequestDnnPluginsRegistration(); cboBillingFrequency.SelectedIndexChanged += OnBillingFrequencyIndexChanged; cboTrialFrequency.SelectedIndexChanged += OnTrialFrequencyIndexChanged; cmdDelete.Click += OnDeleteClick; cmdManage.Click += OnManageClick; cmdUpdate.Click += OnUpdateClick; txtRSVPCode.TextChanged += OnRsvpCodeChanged; try { if ((Request.QueryString["RoleID"] != null)) { _roleID = Int32.Parse(Request.QueryString["RoleID"]); } var objPortalController = new PortalController(); var objPortalInfo = objPortalController.GetPortal(PortalSettings.PortalId); if ((objPortalInfo == null || string.IsNullOrEmpty(objPortalInfo.ProcessorUserId))) { //Warn users about fee based roles if we have a Processor Id lblProcessorWarning.Visible = true; } else { divServiceFee.Visible = true; divBillingPeriod.Visible = true; divTrialFee.Visible = true; divTrialPeriod.Visible = true; } if (Page.IsPostBack == false) { cmdCancel.NavigateUrl = Globals.NavigateURL(); var objUser = new RoleController(); var ctlList = new ListController(); var colFrequencies = ctlList.GetListEntryInfoCollection("Frequency", ""); cboBillingFrequency.DataSource = colFrequencies; cboBillingFrequency.DataBind(); cboBillingFrequency.Items.FindByValue("N").Selected = true; cboTrialFrequency.DataSource = colFrequencies; cboTrialFrequency.DataBind(); cboTrialFrequency.Items.FindByValue("N").Selected = true; BindGroups(); ctlIcon.FileFilter = Globals.glbImageFileTypes; if (_roleID != -1) { lblRoleName.Visible = true; txtRoleName.Visible = false; valRoleName.Enabled = false; var objRoleInfo = objUser.GetRole(_roleID, PortalSettings.PortalId); if (objRoleInfo != null) { lblRoleName.Text = objRoleInfo.RoleName; txtDescription.Text = objRoleInfo.Description; if (cboRoleGroups.Items.FindByValue(objRoleInfo.RoleGroupID.ToString()) != null) { cboRoleGroups.ClearSelection(); cboRoleGroups.Items.FindByValue(objRoleInfo.RoleGroupID.ToString()).Selected = true; } if (objRoleInfo.BillingFrequency != "N") { txtServiceFee.Text = objRoleInfo.ServiceFee.ToString("N2", CultureInfo.CurrentCulture); txtBillingPeriod.Text = objRoleInfo.BillingPeriod.ToString(); if (cboBillingFrequency.Items.FindByValue(objRoleInfo.BillingFrequency) != null) { cboBillingFrequency.ClearSelection(); cboBillingFrequency.Items.FindByValue(objRoleInfo.BillingFrequency).Selected = true; } } if (objRoleInfo.TrialFrequency != "N") { txtTrialFee.Text = objRoleInfo.TrialFee.ToString("N2", CultureInfo.CurrentCulture); txtTrialPeriod.Text = objRoleInfo.TrialPeriod.ToString(); if (cboTrialFrequency.Items.FindByValue(objRoleInfo.TrialFrequency) != null) { cboTrialFrequency.ClearSelection(); cboTrialFrequency.Items.FindByValue(objRoleInfo.TrialFrequency).Selected = true; } } chkIsPublic.Checked = objRoleInfo.IsPublic; chkAutoAssignment.Checked = objRoleInfo.AutoAssignment; txtRSVPCode.Text = objRoleInfo.RSVPCode; if (!String.IsNullOrEmpty(txtRSVPCode.Text)) { lblRSVPLink.Text = Globals.AddHTTP(Globals.GetDomainName(Request)) + "/" + Globals.glbDefaultPage + "?rsvp=" + txtRSVPCode.Text + "&portalid=" + PortalId; } ctlIcon.Url = objRoleInfo.IconFile; UpdateFeeTextBoxes(); } else //security violation attempt to access item not related to this Module { Response.Redirect(Globals.NavigateURL("Security Roles")); } if (_roleID == PortalSettings.AdministratorRoleId || _roleID == PortalSettings.RegisteredRoleId) { cmdDelete.Visible = false; ActivateControls(false); } if (_roleID == PortalSettings.RegisteredRoleId) { cmdManage.Visible = false; } } else { cmdDelete.Visible = false; cmdManage.Visible = false; lblRoleName.Visible = false; txtRoleName.Visible = true; } } } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
/// <summary> /// Adds the default property definitions for a portal /// </summary> /// <param name="PortalId">Id of the Portal</param> public static void AddDefaultDefinitions(int PortalId) { _orderCounter = 1; ListController objListController = new ListController(); ListEntryInfoCollection dataTypes = objListController.GetListEntryInfoCollection("DataType"); AddDefaultDefinition(PortalId, "Name", "Prefix", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Name", "FirstName", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Name", "MiddleName", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Name", "LastName", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Name", "Suffix", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Address", "Unit", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Address", "Street", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Address", "City", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Address", "Region", "Region", 0, dataTypes); AddDefaultDefinition(PortalId, "Address", "Country", "Country", 0, dataTypes); AddDefaultDefinition(PortalId, "Address", "PostalCode", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Contact Info", "Telephone", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Contact Info", "Cell", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Contact Info", "Fax", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Contact Info", "Website", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Contact Info", "IM", "Text", 50, dataTypes); AddDefaultDefinition(PortalId, "Preferences", "Biography", "RichText", 0, dataTypes); AddDefaultDefinition(PortalId, "Preferences", "TimeZone", "TimeZone", 0, dataTypes); AddDefaultDefinition(PortalId, "Preferences", "PreferredLocale", "Locale", 0, dataTypes); }
/// <summary> /// Fills the drop down lists on the search form. Also shows or hides them based on the module's settings /// </summary> private void FillDropDowns() { this.SearchTitleLabel.Text = Dnn.Utility.GetStringSetting(this.Settings, "SearchTitle", Localization.GetString("lblSearchTitle", this.LocalResourceFile)); this.SearchAddressPanel.Visible = Dnn.Utility.GetBoolSetting(this.Settings, "Address", true); this.FilterCountryPanel.Visible = this.ShowCountry; this.SearchRadiusPanel.Visible = this.ShowRadius; foreach (ListItem li in this.SearchRadiusDropDownList.Items) { // li.Value becomes li.Text if you don't explicitly reset it, as below. BD li.Value = li.Value; li.Text = String.Format(CultureInfo.CurrentCulture, "{0} {1}", li.Value, Localization.GetString("Miles", this.LocalSharedResourceFile)); } if (Dnn.Utility.GetBoolSetting(this.Settings, "IncludeUnlimitedMilesRadius", true)) { this.SearchRadiusDropDownList.Items.Add(new ListItem(Localization.GetString("UnlimitedMiles", this.LocalSharedResourceFile), string.Empty)); } ListItem defaultItem = this.SearchRadiusDropDownList.Items.FindByValue(Dnn.Utility.GetStringSetting(this.Settings, "DefaultRadius", string.Empty)); if (defaultItem != null) { this.SearchRadiusDropDownList.ClearSelection(); defaultItem.Selected = true; } ListController listController = new ListController(); // Load the state list this.SearchRegionDropDownList.DataSource = listController.GetListEntryInfoCollection("Region"); this.SearchRegionDropDownList.DataTextField = "Text"; this.SearchRegionDropDownList.DataValueField = "EntryID"; this.SearchRegionDropDownList.DataBind(); this.SearchRegionDropDownList.Items.Insert(0, new ListItem(Localization.GetString("ChooseOne", this.LocalResourceFile), string.Empty)); this.SearchRegionDropDownList.SelectedValue = this.SearchRegionId.HasValue ? this.SearchRegionId.Value.ToString( CultureInfo.InvariantCulture) : string.Empty; // fill the country dropdown this.SearchCountryDropDownList.DataSource = listController.GetListEntryInfoCollection("Country"); this.SearchCountryDropDownList.DataTextField = "Text"; this.SearchCountryDropDownList.DataValueField = "EntryId"; this.SearchCountryDropDownList.DataBind(); this.SearchCountryDropDownList.Items.Insert(0, new ListItem(Localization.GetString("ChooseOne", this.LocalResourceFile), string.Empty)); this.SearchCountryDropDownList.SelectedValue = this.SearchCountryId.HasValue ? this.SearchCountryId.Value.ToString( CultureInfo.InvariantCulture) : string.Empty; if (this.ShowCountry) { this.FillCountry(); ////if (this.ShowRadius) ////{ //// this.SearchRadiusDropDownList.ClearSelection(); //// this.SearchRadiusDropDownList.Items.Insert(0, new ListItem(Localization.GetString("ChooseOne", this.LocalResourceFile), string.Empty)); //// this.SearchRadiusDropDownList.SelectedIndex = 0; ////} } }
/// <summary> /// Select a list in dropdownlist /// </summary> /// <history> /// [tamttt] 20/10/2004 Created /// </history> protected void ddlSelectList_SelectedIndexChanged( object sender, EventArgs e ) { ListController ctlLists = new ListController(); string selList = ddlSelectList.SelectedItem.Value; string listName = selList.Substring(selList.IndexOf(":") + 1); string parentKey = selList.Replace(listName, "").TrimEnd(':'); ddlSelectParent.Enabled = true; ddlSelectParent.DataSource = ctlLists.GetListEntryInfoCollection(listName, parentKey); ddlSelectParent.DataTextField = "DisplayName"; ddlSelectParent.DataValueField = "Key"; ddlSelectParent.DataBind(); ddlSelectParent.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), "")); }
private static int ResolveState(string state) { int id = -1; ListController controller = new ListController(); ListEntryInfoCollection regions = controller.GetListEntryInfoCollection("Region"); foreach (ListEntryInfo region in regions) { if (region.Text == state || region.Value == state) { id = region.EntryID; } } return id; }
/// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 9/10/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> protected void Page_Load( Object sender, EventArgs e ) { try { if( ( Request.QueryString["RoleID"] != null ) ) { RoleID = int.Parse( Request.QueryString["RoleID"] ); } if( Page.IsPostBack == false ) { ClientAPI.AddButtonConfirm( cmdDelete, Localization.GetString( "DeleteItem" ) ); RoleController objUser = new RoleController(); ListController ctlList = new ListController(); ListEntryInfoCollection colFrequencies = ctlList.GetListEntryInfoCollection( "Frequency", "" ); cboBillingFrequency.DataSource = colFrequencies; cboBillingFrequency.DataBind(); cboBillingFrequency.Items.FindByValue( "N" ).Selected = true; cboTrialFrequency.DataSource = colFrequencies; cboTrialFrequency.DataBind(); cboTrialFrequency.Items.FindByValue( "N" ).Selected = true; BindGroups(); ctlIcon.FileFilter = Globals.glbImageFileTypes; if( RoleID != - 1 ) { lblRoleName.Visible = true; txtRoleName.Visible = false; valRoleName.Enabled = false; RoleInfo objRoleInfo = objUser.GetRole( RoleID, PortalSettings.PortalId ); if( objRoleInfo != null ) { lblRoleName.Text = objRoleInfo.RoleName; txtDescription.Text = objRoleInfo.Description; if( cboRoleGroups.Items.FindByValue( objRoleInfo.RoleGroupID.ToString() ) != null ) { cboRoleGroups.ClearSelection(); cboRoleGroups.Items.FindByValue( objRoleInfo.RoleGroupID.ToString() ).Selected = true; } if( string.Format("{0:#,##0.00}" , objRoleInfo.ServiceFee) != "0.00" ) { txtServiceFee.Text = string.Format("{0:#,##0.00}", objRoleInfo.ServiceFee); txtBillingPeriod.Text = objRoleInfo.BillingPeriod.ToString(); if( cboBillingFrequency.Items.FindByValue( objRoleInfo.BillingFrequency ) != null ) { cboBillingFrequency.ClearSelection(); cboBillingFrequency.Items.FindByValue( objRoleInfo.BillingFrequency ).Selected = true; } } if( objRoleInfo.TrialFrequency != "N" ) { txtTrialFee.Text = string.Format("{0:#,##0.00}", objRoleInfo.TrialFee); txtTrialPeriod.Text = objRoleInfo.TrialPeriod.ToString(); if( cboTrialFrequency.Items.FindByValue( objRoleInfo.TrialFrequency ) != null ) { cboTrialFrequency.ClearSelection(); cboTrialFrequency.Items.FindByValue( objRoleInfo.TrialFrequency ).Selected = true; } } chkIsPublic.Checked = objRoleInfo.IsPublic; chkAutoAssignment.Checked = objRoleInfo.AutoAssignment; txtRSVPCode.Text = objRoleInfo.RSVPCode; ctlIcon.Url = objRoleInfo.IconFile; } else // security violation attempt to access item not related to this Module { Response.Redirect( Globals.NavigateURL( "Security Roles" ) ); } if( RoleID == PortalSettings.AdministratorRoleId || RoleID == PortalSettings.RegisteredRoleId ) { cmdDelete.Visible = false; cmdUpdate.Visible = false; ActivateControls( false ); } if( RoleID == PortalSettings.RegisteredRoleId ) { cmdManage.Visible = false; } } else { cmdDelete.Visible = false; cmdManage.Visible = false; lblRoleName.Visible = false; txtRoleName.Visible = true; } } } catch( Exception exc ) //Module failed to load { Exceptions.ProcessModuleLoadException( this, exc ); } }