本文整理汇总了C#中DotNetNuke.Common.Lists.ListController.GetListEntryInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ListController.GetListEntryInfo方法的具体用法?C# ListController.GetListEntryInfo怎么用?C# ListController.GetListEntryInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Common.Lists.ListController
的用法示例。
在下文中一共展示了ListController.GetListEntryInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Search
public HttpResponseMessage Search(string q)
{
var portalId = PortalController.GetEffectivePortalId(PortalSettings.PortalId);
var controller = new ListController();
ListEntryInfo imageType = controller.GetListEntryInfo("DataType", "Image");
IList<SearchResult> results = new List<SearchResult>();
foreach (var definition in ProfileController.GetPropertyDefinitionsByPortal(portalId)
.Cast<ProfilePropertyDefinition>()
.Where(definition => definition.DataType != imageType.EntryID))
{
AddProperty(results, definition.PropertyName, q);
}
AddProperty(results, "Email", q);
AddProperty(results, "DisplayName", q);
AddProperty(results, "Username", q);
AddProperty(results, "Password", q);
AddProperty(results, "PasswordConfirm", q);
AddProperty(results, "PasswordQuestion", q);
AddProperty(results, "PasswordAnswer", q);
return Request.CreateResponse(HttpStatusCode.OK, results.OrderBy(sr => sr.id));
}
示例2: DisplayDataType
private static string DisplayDataType(ProfilePropertyDefinition definition)
{
string cacheKey = string.Format("DisplayDataType:{0}", definition.DataType);
string strDataType = Convert.ToString(DataCache.GetCache(cacheKey)) + "";
if (strDataType == string.Empty)
{
var objListController = new ListController();
strDataType = objListController.GetListEntryInfo(definition.DataType).Value;
DataCache.SetCache(cacheKey, strDataType);
}
return strDataType;
}
示例3: Search
public ActionResult Search(string q)
{
try
{
var portalId = PortalController.GetEffectivePortalId(PortalSettings.PortalId);
var controller = new ListController();
var textType = controller.GetListEntryInfo("DataType", "Text");
var regionType = controller.GetListEntryInfo("DataType", "Region");
var countryType = controller.GetListEntryInfo("DataType", "Country");
IList<SearchResult> results = new List<SearchResult>();
foreach (var definition in ProfileController.GetPropertyDefinitionsByPortal(portalId)
.Cast<ProfilePropertyDefinition>()
.Where(definition => definition.DataType == textType.EntryID
|| definition.DataType == regionType.EntryID
|| definition.DataType == countryType.EntryID))
{
AddProperty(results, definition.PropertyName, q);
}
AddProperty(results, "Email", q);
AddProperty(results, "DisplayName", q);
AddProperty(results, "Username", q);
AddProperty(results, "Password", q);
AddProperty(results, "PasswordConfirm", q);
AddProperty(results, "PasswordQuestion", q);
AddProperty(results, "PasswordAnswer", q);
return Json(results.OrderBy(sr => sr.id), JsonRequestBehavior.AllowGet);
}
catch (Exception exc)
{
DnnLog.Error(exc);
return Json(null, JsonRequestBehavior.AllowGet);
}
}
示例4: GetDependency
/// -----------------------------------------------------------------------------
/// <summary>
/// The GetDependency method instantiates (and returns) the relevant Dependency
/// </summary>
/// <param name="dependencyNav">The manifest (XPathNavigator) for the dependency</param>
/// -----------------------------------------------------------------------------
public static IDependency GetDependency(XPathNavigator dependencyNav)
{
IDependency dependency = null;
string dependencyType = Util.ReadAttribute(dependencyNav, "type");
switch (dependencyType.ToLowerInvariant())
{
case "coreversion":
dependency = new CoreVersionDependency();
break;
case "package":
dependency = new PackageDependency();
break;
case "managedpackage":
dependency = new ManagedPackageDependency();
break;
case "permission":
dependency = new PermissionsDependency();
break;
case "type":
dependency = new TypeDependency();
break;
default:
//Dependency type is defined in the List
var listController = new ListController();
ListEntryInfo entry = listController.GetListEntryInfo("Dependency", dependencyType);
if (entry != null && !string.IsNullOrEmpty(entry.Text))
{
//The class for the Installer is specified in the Text property
dependency = (DependencyBase)Reflection.CreateObject(entry.Text, "Dependency_" + entry.Value);
}
break;
}
if (dependency == null)
{
//Could not create dependency, show generic error message
dependency = new InvalidDependency(Util.INSTALL_Dependencies);
}
//Read Manifest
dependency.ReadManifest(dependencyNav);
return dependency;
}
示例5: RenderViewMode
/// -----------------------------------------------------------------------------
/// <summary>
/// RenderViewMode renders the View (readonly) mode of the control
/// </summary>
/// <param name="writer">A HtmlTextWriter.</param>
/// <history>
/// [cnurse] 05/04/2006 created
/// </history>
/// -----------------------------------------------------------------------------
protected override void RenderViewMode(HtmlTextWriter writer)
{
var objListController = new ListController();
ListEntryInfo entry = null;
string entryText = Null.NullString;
switch (ValueField)
{
case ListBoundField.Id:
entry = objListController.GetListEntryInfo(Convert.ToInt32(Value));
break;
case ListBoundField.Text:
entryText = StringValue;
break;
case ListBoundField.Value:
entry = objListController.GetListEntryInfo(ListName, StringValue);
break;
}
ControlStyle.AddAttributesToRender(writer);
writer.RenderBeginTag(HtmlTextWriterTag.Span);
if (entry != null)
{
switch (TextField)
{
case ListBoundField.Id:
writer.Write(entry.EntryID.ToString());
break;
case ListBoundField.Text:
writer.Write(entry.Text);
break;
case ListBoundField.Value:
writer.Write(entry.Value);
break;
}
}
else
{
writer.Write(entryText);
}
//Close Select Tag
writer.RenderEndTag();
}
示例6: GetWriter
/// -----------------------------------------------------------------------------
/// <summary>
/// The GetWriter method instantiates the relevant PackageWriter Installer
/// </summary>
/// <param name="package">The associated PackageInfo instance</param>
/// <history>
/// [cnurse] 01/31/2008 created
/// </history>
/// -----------------------------------------------------------------------------
public static PackageWriterBase GetWriter(PackageInfo package)
{
PackageWriterBase writer = null;
switch (package.PackageType)
{
case "Auth_System":
writer = new AuthenticationPackageWriter(package);
break;
case "Module":
writer = new ModulePackageWriter(package);
break;
case "Container":
writer = new ContainerPackageWriter(package);
break;
case "Skin":
writer = new SkinPackageWriter(package);
break;
case "CoreLanguagePack":
case "ExtensionLanguagePack":
writer = new LanguagePackWriter(package);
break;
case "SkinObject":
writer = new SkinControlPackageWriter(package);
break;
case "Provider":
writer = new ProviderPackageWriter(package);
break;
case "Library":
writer = new LibraryPackageWriter(package);
break;
case "Widget":
writer = new WidgetPackageWriter(package);
break;
default:
//PackageType is defined in the List
var listController = new ListController();
ListEntryInfo entry = listController.GetListEntryInfo("PackageWriter", package.PackageType);
if (entry != null && !string.IsNullOrEmpty(entry.Text))
{
//The class for the Installer is specified in the Text property
writer = (PackageWriterBase) Reflection.CreateObject(entry.Text, "PackageWriter_" + entry.Value);
}
break;
}
return writer;
}
示例7: ValidateProperty
private bool ValidateProperty(ProfilePropertyDefinition definition)
{
bool isValid = true;
var objListController = new ListController();
string strDataType = objListController.GetListEntryInfo(definition.DataType).Value;
switch (strDataType)
{
case "Text":
if (definition.Required && definition.Length == 0)
{
_Message = "RequiredTextBox";
isValid = Null.NullBoolean;
}
break;
}
return isValid;
}
示例8: OnLoad
//.........这里部分代码省略.........
strPayPalURL += "¤cy_code=" + Globals.HTTPPOSTEncode(PortalSettings.Currency);
}
else //recurring payments
{
//build the subscription PayPal URL
strPayPalURL += "&redirect_cmd=_xclick-subscriptions&business=" + Globals.HTTPPOSTEncode(strProcessorUserId);
strPayPalURL += "&item_name=" +
Globals.HTTPPOSTEncode(PortalSettings.PortalName + " - " + objRole.RoleName + " ( " + objRole.ServiceFee.ToString("#.##") + " " +
PortalSettings.Currency + " every " + intBillingPeriod + " " + GetBillingFrequencyCode(objRole.BillingFrequency) + " )");
strPayPalURL += "&item_number=" + Globals.HTTPPOSTEncode(intRoleId.ToString());
strPayPalURL += "&no_shipping=1&no_note=1";
if (objRole.TrialFrequency != "N")
{
strPayPalURL += "&a1=" + Globals.HTTPPOSTEncode(strTrial);
strPayPalURL += "&p1=" + Globals.HTTPPOSTEncode(intTrialPeriod.ToString());
strPayPalURL += "&t1=" + Globals.HTTPPOSTEncode(objRole.TrialFrequency);
}
strPayPalURL += "&a3=" + Globals.HTTPPOSTEncode(strService);
strPayPalURL += "&p3=" + Globals.HTTPPOSTEncode(intBillingPeriod.ToString());
strPayPalURL += "&t3=" + Globals.HTTPPOSTEncode(objRole.BillingFrequency);
strPayPalURL += "&src=1";
strPayPalURL += "¤cy_code=" + Globals.HTTPPOSTEncode(PortalSettings.Currency);
}
}
var ctlList = new ListController();
strPayPalURL += "&custom=" + Globals.HTTPPOSTEncode(intUserID.ToString());
strPayPalURL += "&first_name=" + Globals.HTTPPOSTEncode(objUserInfo.Profile.FirstName);
strPayPalURL += "&last_name=" + Globals.HTTPPOSTEncode(objUserInfo.Profile.LastName);
try
{
if (objUserInfo.Profile.Country == "United States")
{
ListEntryInfo colList = ctlList.GetListEntryInfo("Region", objUserInfo.Profile.Region);
strPayPalURL += "&address1=" +
Globals.HTTPPOSTEncode(Convert.ToString(!String.IsNullOrEmpty(objUserInfo.Profile.Unit) ? objUserInfo.Profile.Unit + " " : "") +
objUserInfo.Profile.Street);
strPayPalURL += "&city=" + Globals.HTTPPOSTEncode(objUserInfo.Profile.City);
strPayPalURL += "&state=" + Globals.HTTPPOSTEncode(colList.Value);
strPayPalURL += "&zip=" + Globals.HTTPPOSTEncode(objUserInfo.Profile.PostalCode);
}
}
catch (Exception ex)
{
//issue getting user address
DnnLog.Error(ex);
}
//Return URL
if (settings.ContainsKey("paypalsubscriptionreturn") && !string.IsNullOrEmpty(settings["paypalsubscriptionreturn"]))
{
strPayPalURL += "&return=" + Globals.HTTPPOSTEncode(settings["paypalsubscriptionreturn"]);
}
else
{
strPayPalURL += "&return=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(Request)));
}
//Cancellation URL
if (settings.ContainsKey("paypalsubscriptioncancelreturn") && !string.IsNullOrEmpty(settings["paypalsubscriptioncancelreturn"]))
{
strPayPalURL += "&cancel_return=" + Globals.HTTPPOSTEncode(settings["paypalsubscriptioncancelreturn"]);
}
else
{
strPayPalURL += "&cancel_return=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(Request)));
示例9: OnSaveEntryClick
/// <summary>
/// Handles cmdSaveEntry.Click
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks>
/// Using "CommandName" property of cmdSaveEntry to determine action to take (ListUpdate/AddEntry/AddList)
/// </remarks>
protected void OnSaveEntryClick(object sender, EventArgs e)
{
String entryValue;
String entryText;
if (UserInfo.IsSuperUser)
{
entryValue = txtEntryValue.Text;
entryText = txtEntryText.Text;
}
else
{
var ps = new PortalSecurity();
entryValue = ps.InputFilter(txtEntryValue.Text, PortalSecurity.FilterFlag.NoScripting);
entryText = ps.InputFilter(txtEntryText.Text, PortalSecurity.FilterFlag.NoScripting);
}
var listController = new ListController();
var entry = new ListEntryInfo();
{
entry.DefinitionID = Null.NullInteger;
entry.PortalID = ListPortalID;
entry.ListName = txtEntryName.Text;
entry.Value = entryValue;
entry.Text = entryText;
}
if (Page.IsValid)
{
Mode = "ListEntries";
switch (cmdSaveEntry.CommandName.ToLower())
{
case "update":
entry.ParentKey = SelectedList.ParentKey;
entry.EntryID = Int16.Parse(txtEntryID.Text);
bool canUpdate = true;
foreach (var curEntry in listController.GetListEntryInfoItems(SelectedList.Name, entry.ParentKey, entry.PortalID))
{
if (entry.EntryID != curEntry.EntryID) //not the same item we are trying to update
{
if (entry.Value == curEntry.Value && entry.Text == curEntry.Text)
{
UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ItemAlreadyPresent", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
canUpdate = false;
break;
}
}
}
if (canUpdate)
{
listController.UpdateListEntry(entry);
DataBind();
}
break;
case "saveentry":
if (SelectedList != null)
{
entry.ParentKey = SelectedList.ParentKey;
entry.ParentID = SelectedList.ParentID;
entry.Level = SelectedList.Level;
}
if (chkEnableSortOrder.Checked)
{
entry.SortOrder = 1;
}
else
{
entry.SortOrder = 0;
}
if (listController.AddListEntry(entry) == Null.NullInteger) //entry already found in database
{
UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ItemAlreadyPresent", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
}
DataBind();
break;
case "savelist":
if (ddlSelectParent.SelectedIndex != -1)
{
int parentID = Int32.Parse(ddlSelectParent.SelectedItem.Value);
ListEntryInfo parentEntry = listController.GetListEntryInfo(parentID);
entry.ParentID = parentID;
entry.DefinitionID = parentEntry.DefinitionID;
entry.Level = parentEntry.Level + 1;
entry.ParentKey = parentEntry.Key;
}
if (chkEnableSortOrder.Checked)
{
entry.SortOrder = 1;
}
else
//.........这里部分代码省略.........
示例10: GetSearchDocuments
/// -----------------------------------------------------------------------------
/// <summary>
/// Returns the collection of SearchDocuments populated with Tab MetaData for the given portal.
/// </summary>
/// <param name="portalId"></param>
/// <param name="startDateLocal"></param>
/// <returns></returns>
/// <history>
/// [vnguyen] 04/16/2013 created
/// </history>
/// -----------------------------------------------------------------------------
public override IEnumerable<SearchDocument> GetSearchDocuments(int portalId, DateTime startDateLocal)
{
var searchDocuments = new Dictionary<string, SearchDocument>();
var needReindex = PortalController.GetPortalSettingAsBoolean(UserIndexResetFlag, portalId, false);
if (needReindex)
{
startDateLocal = SqlDateTime.MinValue.Value.AddDays(1);
}
var controller = new ListController();
var textDataType = controller.GetListEntryInfo("DataType", "Text");
var richTextDataType = controller.GetListEntryInfo("DataType", "RichText");
var profileDefinitions = ProfileController.GetPropertyDefinitionsByPortal(portalId, false, false)
.Cast<ProfilePropertyDefinition>()
.Where(d => (textDataType != null && d.DataType == textDataType.EntryID)
|| (richTextDataType != null && d.DataType == richTextDataType.EntryID)).ToList();
try
{
var startUserId = Null.NullInteger;
while (true)
{
var reader = DataProvider.Instance()
.GetAvailableUsersForIndex(portalId, startDateLocal, startUserId, BatchSize);
int rowsAffected = 0;
var indexedUsers = new List<int>();
while (reader.Read())
{
var userSearch = GetUserSearch(reader);
AddBasicInformation(searchDocuments, indexedUsers, userSearch, portalId);
//log the userid so that it can get the correct user collection next time.
if (userSearch.UserId > startUserId)
{
startUserId = userSearch.UserId;
}
foreach (var definition in profileDefinitions)
{
var propertyName = definition.PropertyName;
if (!ContainsColumn(propertyName, reader))
{
continue;
}
var propertyValue = reader[propertyName].ToString();
if (string.IsNullOrEmpty(propertyValue) || !propertyValue.Contains(ValueSplitFlag))
{
continue;
}
var splitValues = Regex.Split(propertyValue, Regex.Escape(ValueSplitFlag));
propertyValue = splitValues[0];
var visibilityMode = ((UserVisibilityMode) Convert.ToInt32(splitValues[1]));
var extendedVisibility = splitValues[2];
var modifiedTime = Convert.ToDateTime(splitValues[3]).ToUniversalTime();
if (string.IsNullOrEmpty(propertyValue))
{
continue;
}
var uniqueKey = string.Format("{0}_{1}", userSearch.UserId, visibilityMode).ToLowerInvariant();
if (visibilityMode == UserVisibilityMode.FriendsAndGroups)
{
uniqueKey = string.Format("{0}_{1}", uniqueKey, extendedVisibility);
}
if (searchDocuments.ContainsKey(uniqueKey))
{
var document = searchDocuments[uniqueKey];
document.Keywords.Add(propertyName, propertyValue);
if (modifiedTime > document.ModifiedTimeUtc)
{
document.ModifiedTimeUtc = modifiedTime;
}
}
else
{
//Need remove use exists index for all visibilities.
if (!indexedUsers.Contains(userSearch.UserId))
{
//.........这里部分代码省略.........
示例11: GetInstaller
/// -----------------------------------------------------------------------------
/// <summary>
/// The GetInstaller method instantiates the relevant Component Installer
/// </summary>
/// <param name="installerType">The type of Installer</param>
/// <history>
/// [cnurse] 07/25/2007 created
/// </history>
/// -----------------------------------------------------------------------------
public static ComponentInstallerBase GetInstaller(string installerType)
{
ComponentInstallerBase installer = null;
switch (installerType)
{
case "File":
installer = new FileInstaller();
break;
case "Assembly":
installer = new AssemblyInstaller();
break;
case "ResourceFile":
installer = new ResourceFileInstaller();
break;
case "AuthenticationSystem":
case "Auth_System":
installer = new AuthenticationInstaller();
break;
case "DashboardControl":
installer = new DashboardInstaller();
break;
case "Script":
installer = new ScriptInstaller();
break;
case "Config":
installer = new ConfigInstaller();
break;
case "Cleanup":
installer = new CleanupInstaller();
break;
case "Skin":
installer = new SkinInstaller();
break;
case "Container":
installer = new ContainerInstaller();
break;
case "Module":
installer = new ModuleInstaller();
break;
case "CoreLanguage":
installer = new LanguageInstaller(LanguagePackType.Core);
break;
case "ExtensionLanguage":
installer = new LanguageInstaller(LanguagePackType.Extension);
break;
case "Provider":
installer = new ProviderInstaller();
break;
case "SkinObject":
installer = new SkinControlInstaller();
break;
case "UrlProvider":
installer = new UrlProviderInstaller();
break;
case "Widget":
installer = new WidgetInstaller();
break;
default:
//Installer type is defined in the List
var listController = new ListController();
ListEntryInfo entry = listController.GetListEntryInfo("Installer", installerType);
if (entry != null && !string.IsNullOrEmpty(entry.Text))
{
//The class for the Installer is specified in the Text property
installer = (ComponentInstallerBase) Reflection.CreateObject(entry.Text, "Installer_" + entry.Value);
}
break;
}
return installer;
}
示例12: GetListValue
private string GetListValue(string listName, string value)
{
ListController lc = new ListController();
int entryId;
if (int.TryParse(value, out entryId))
{
ListEntryInfo item = lc.GetListEntryInfo(listName, entryId);
if (item != null)
{
return item.Text;
}
}
return value;
}
示例13: GetBillingFrequencyText
/// <summary>
/// This methods return the text description of the Frequency value
/// </summary>
/// <param name="value">value of the Frequency</param>
/// <returns>text of the Frequency</returns>
private string GetBillingFrequencyText(string value)
{
var ctlEntry = new ListController();
ListEntryInfo entry = ctlEntry.GetListEntryInfo("Frequency", value);
return entry.Text;
}
示例14: GetEditor
/// <Summary>
/// GetEditor gets the appropriate Editor based on ID properties
/// </Summary>
/// <Param name="editorType">The Id of the Editor</Param>
public static string GetEditor(int editorType)
{
string editor = "UseSystemType";
if (editorType != Null.NullInteger)
{
ListController objListController = new ListController();
ListEntryInfo definitionEntry = objListController.GetListEntryInfo(editorType);
if ((definitionEntry != null) && (definitionEntry.ListName == "DataType"))
{
editor = definitionEntry.Text;
}
}
return editor;
}
示例15: GetPropertyValue
/// -----------------------------------------------------------------------------
/// <summary>
/// Gets a Profile Property Value from the Profile
/// </summary>
/// <remarks></remarks>
/// <param name="propName">The name of the propoerty to retrieve.</param>
/// <history>
/// [cnurse] 02/10/2006 Created
/// </history>
/// -----------------------------------------------------------------------------
public string GetPropertyValue(string propName)
{
string propValue = Null.NullString;
ProfilePropertyDefinition profileProp = GetProperty(propName);
if (profileProp != null)
{
propValue = profileProp.PropertyValue;
if (profileProp.DataType > -1)
{
var controller = new ListController();
var dataType = controller.GetListEntryInfo("DataType", profileProp.DataType);
if (dataType.Value == "Country" || dataType.Value == "Region")
{
propValue = GetListValue(dataType.Value, propValue);
}
}
}
return propValue;
}