本文整理汇总了C#中DotNetNuke.Common.Lists.ListController.GetListEntryInfoCollection方法的典型用法代码示例。如果您正苦于以下问题:C# ListController.GetListEntryInfoCollection方法的具体用法?C# ListController.GetListEntryInfoCollection怎么用?C# ListController.GetListEntryInfoCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Common.Lists.ListController
的用法示例。
在下文中一共展示了ListController.GetListEntryInfoCollection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEditor
/// <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;
}
}
}
示例2: BindData
//.........这里部分代码省略.........
{
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
示例3: ResolveCountry
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;
}
示例4: AddDefaultDefinitions
/// <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);
}
示例5: Page_Load
/// <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 );
}
}
示例6: OnLoad
/// -----------------------------------------------------------------------------
/// <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;
}
}
//.........这里部分代码省略.........
示例7: Page_Load
/// <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() ) );
}
//.........这里部分代码省略.........
示例8: Page_Load
/// <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":
//.........这里部分代码省略.........
示例9: FillState
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));
}
示例10: OnLoad
/// -----------------------------------------------------------------------------
/// <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);
}
}
示例11: FillCountry
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;
}
示例12: GetRegionsFromCountry
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;
}
示例13: ddlSelectList_SelectedIndexChanged
/// <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"), ""));
}
示例14: Page_Load
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)
{
}
}
示例15: loadCountryList
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) + ">", ""));
}