本文整理汇总了C#中DotNetNuke.Common.Lists.ListController类的典型用法代码示例。如果您正苦于以下问题:C# ListController类的具体用法?C# ListController怎么用?C# ListController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListController类属于DotNetNuke.Common.Lists命名空间,在下文中一共展示了ListController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:26,代码来源:ProfileServiceController.cs
示例2: setAlarmType
public void setAlarmType()
{
ListController listController = new ListController();
IEnumerable<ListEntryInfo> listEntryInfoCol = null;
//AlarmType
//listEntryInfoCol = listController.GetListEntryInfoItems("AlarmRuleSet.AlarmType");
listEntryInfoCol = ListsTextLocalizedByListName("AlarmRuleSet.AlarmType");
string strAlarmType = "";
int i = 0;
int icount = listEntryInfoCol.Count();
foreach (ListEntryInfo item in listEntryInfoCol)
{
i += 1;
strAlarmType += item.EntryID.ToString() + ":";
//strAlarmType += item.SortOrder.ToString() + " " + item.Text;
if (i == icount)
{
strAlarmType += item.SortOrder.ToString() + " " + item.Text;
//strAlarmType += ":" + item.EntryID.ToString();
}
else
{
strAlarmType += item.SortOrder.ToString() + " " + item.Text + ";";
//strAlarmType += ":" + item.EntryID.ToString() + ";";
}
}
hidAlarmType.Value = strAlarmType;
}
开发者ID:asaki0510,项目名称:AlarmRuleSet,代码行数:34,代码来源:DailyLog.ascx.cs
示例3: 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;
}
}
}
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:58,代码来源:ProfileEditorControl.cs
示例4: ListsTextLocalizedByListName
private IEnumerable<ListEntryInfo> ListsTextLocalizedByListName(string listname)
{
ListController listcontroller = new ListController();
IEnumerable<ListEntryInfo> listEntryInfoCol = null;
listEntryInfoCol = listcontroller.GetListEntryInfoItems(listname);
foreach (ListEntryInfo li in listEntryInfoCol)
{
li.Text = Localization.GetString(li.Text, "~/App_GlobalResources/List_" + listname + "." + (Page as DotNetNuke.Framework.PageBase).PageCulture.Name + ".resx");
}
return listEntryInfoCol;
}
开发者ID:asaki0510,项目名称:AlarmRuleSet,代码行数:11,代码来源:DailyLog.ascx.cs
示例5: 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;
}
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:12,代码来源:ProfilePropertyAccess.cs
示例6: DisplayDataType
public string DisplayDataType(AttributeDefinition definition)
{
string retValue = Null.NullString;
ListController objListController = new ListController();
ListEntryInfo definitionEntry = objListController.GetListEntryInfo(definition.DataType);
if ((definitionEntry != null))
{
retValue = definitionEntry.Value;
}
return retValue;
}
开发者ID:EngageSoftware,项目名称:Engage-Locator,代码行数:13,代码来源:AttributeDefinitions.ascx.cs
示例7: WhenIFillInTheProfilePropertyForm
public void WhenIFillInTheProfilePropertyForm(TechTalk.SpecFlow.Table table)
{
ProfilePropertiesPage.PropertyNameField.Value = table.Rows[0]["Value"];
ListEntryInfo dataType = new ListController().GetListEntryInfo("DataType", table.Rows[1]["Value"]);
ProfilePropertiesPage.DataTypeSelectList.SelectByValue(dataType.EntryID.ToString(CultureInfo.InvariantCulture));
ProfilePropertiesPage.PropertyCategoryField.Value = table.Rows[2]["Value"];
ProfilePropertiesPage.LengthTextField.Value = table.Rows[3]["Value"];
ProfilePropertiesPage.RequiredCheckBox.Checked = Boolean.Parse(table.Rows[4]["Value"]);
ProfilePropertiesPage.VisibleCheckBox.Checked = Boolean.Parse(table.Rows[5]["Value"]);
ProfilePropertiesPage.ReadOnlyCheckBox.Checked = Boolean.Parse(table.Rows[6]["Value"]);
}
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:13,代码来源:ProfilePropertiesSteps.cs
示例8: BindTree
private void BindTree()
{
var ctlLists = new ListController();
var colLists = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
var indexLookup = new Hashtable();
listTree.Nodes.Clear();
foreach (ListInfo list in colLists)
{
String filteredNode;
if (list.DisplayName.Contains(":"))
{
var finalPeriod = list.DisplayName.LastIndexOf(".", StringComparison.InvariantCulture);
filteredNode = list.DisplayName.Substring(finalPeriod + 1);
}
else
{
filteredNode = list.DisplayName;
}
var node = new DnnTreeNode { Text = filteredNode };
{
node.Value = list.Key;
node.ToolTip = String.Format(LocalizeString("NoEntries"), list.EntryCount);
node.ImageUrl = IconController.IconURL("Folder");
}
if (list.Level == 0)
{
listTree.Nodes.Add(node);
}
else
{
if (indexLookup[list.ParentList] != null)
{
var parentNode = (DnnTreeNode) indexLookup[list.ParentList];
parentNode.Nodes.Add(node);
}
}
//Add index key here to find it later, should suggest with Joe to add it to DNNTree
if (indexLookup[list.Key] == null)
{
indexLookup.Add(list.Key, node);
}
}
}
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:49,代码来源:ListEditor.ascx.cs
示例9: 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;
}
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:48,代码来源:DependencyFactory.cs
示例10: FoundBannedPassword
public bool FoundBannedPassword(string inputString)
{
const string listName = "BannedPasswords";
var listController = new ListController();
PortalSettings settings = PortalController.GetCurrentPortalSettings();
IEnumerable<ListEntryInfo> listEntryHostInfos = listController.GetListEntryInfoItems(listName, "", Null.NullInteger);
IEnumerable<ListEntryInfo> listEntryPortalInfos = listController.GetListEntryInfoItems(listName + "-" + settings.PortalId, "", settings.PortalId);
IEnumerable<ListEntryInfo> query2 = listEntryHostInfos.Where(test => test.Text == inputString);
IEnumerable<ListEntryInfo> query3 = listEntryPortalInfos.Where(test => test.Text == inputString);
if (query2.Any() || query3.Any())
{
return true;
}
return false;
}
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:20,代码来源:MembershipPasswordController.cs
示例11: 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);
}
}
开发者ID:biganth,项目名称:Curt,代码行数:38,代码来源:ProfileServiceController.cs
示例12: OnItemChanged
void OnItemChanged(object sender, PropertyEditorEventArgs e)
{
var regionContainer = ControlUtilities.FindControl<Control>(Parent, "Region", true);
if (regionContainer != null)
{
var regionControl = ControlUtilities.FindFirstDescendent<DNNRegionEditControl>(regionContainer);
if (regionControl != null)
{
var listController = new ListController();
var countries = listController.GetListEntryInfoItems("Country");
foreach (var checkCountry in countries)
{
if (checkCountry.Text == e.StringValue)
{
var attributes = new object[1];
attributes[0] = new ListAttribute("Region", "Country." + checkCountry.Value, ListBoundField.Text, ListBoundField.Text);
regionControl.CustomAttributes = attributes;
break;
}
}
}
}
}
开发者ID:davidsports,项目名称:Dnn.Platform,代码行数:23,代码来源:DNNCountryEditControl.cs
示例13: BindTree
private void BindTree()
{
var ctlLists = new ListController();
var colLists = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
var indexLookup = new Hashtable();
listTree.Nodes.Clear();
foreach (ListInfo list in colLists)
{
var node = new DnnTreeNode { Text = list.DisplayName.Replace(list.ParentList + ".", "") };
{
node.Value = list.Key;
node.ToolTip = String.Format(LocalizeString("NoEntries"), list.EntryCount);
node.ImageUrl = IconController.IconURL("Folder");
}
if (list.Level == 0)
{
listTree.Nodes.Add(node);
}
else
{
if (indexLookup[list.ParentList] != null)
{
var parentNode = (DnnTreeNode) indexLookup[list.ParentList];
parentNode.Nodes.Add(node);
}
}
//Add index key here to find it later, should suggest with Joe to add it to DNNTree
if (indexLookup[list.Key] == null)
{
indexLookup.Add(list.Key, node);
}
}
}
开发者ID:RichardHowells,项目名称:dnnextensions,代码行数:36,代码来源:ListEditor.ascx.cs
示例14: GetList
private ListInfo GetList(string key, bool update)
{
var ctlLists = new ListController();
int index = key.IndexOf(":", StringComparison.Ordinal);
string listName = key.Substring(index + 1);
string parentKey = Null.NullString;
if (index > 0)
{
parentKey = key.Substring(0, index);
}
if (update)
{
ListName = listName;
ParentKey = parentKey;
}
return ctlLists.GetListInfo(listName, parentKey, ListPortalID);
}
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:17,代码来源:ListEntries.ascx.cs
示例15: UpgradeToVersion530
private static void UpgradeToVersion530()
{
//update languages module
int moduleDefId = GetModuleDefinition("Languages", "Languages");
RemoveModuleControl(moduleDefId, "");
AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/Languages/languageEnabler.ascx", "~/images/icon_language_32px.gif", SecurityAccessLevel.View, 0, "", true);
AddModuleControl(moduleDefId, "Editor", "", "DesktopModules/Admin/Languages/languageeditor.ascx", "~/images/icon_language_32px.gif", SecurityAccessLevel.View, 0);
//Add new View Profile module
moduleDefId = AddModuleDefinition("ViewProfile", "", "ViewProfile", false, false);
AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/ViewProfile/ViewProfile.ascx", "~/images/icon_profile_32px.gif", SecurityAccessLevel.View, 0);
AddModuleControl(moduleDefId, "Settings", "Settings", "DesktopModules/Admin/ViewProfile/Settings.ascx", "~/images/icon_profile_32px.gif", SecurityAccessLevel.Edit, 0);
//Add new Sitemap settings module
moduleDefId = AddModuleDefinition("Sitemap", "", "Sitemap", false, false);
AddModuleControl(moduleDefId, "", "", "DesktopModules/Admin/Sitemap/SitemapSettings.ascx", "~/images/icon_analytics_32px.gif", SecurityAccessLevel.View, 0);
AddAdminPages("Search Engine Sitemap", "Configure the sitemap for submission to common search engines.", "~/images/icon_analytics_16px.gif", "~/images/icon_analytics_32px.gif", true, moduleDefId, "Search Engine Sitemap", "~/images/icon_analytics_32px.gif");
//Add new Photo Profile field to Host
var listController = new ListController();
Dictionary<string, ListEntryInfo> dataTypes = listController.GetListEntryInfoDictionary("DataType");
var properties = ProfileController.GetPropertyDefinitionsByPortal(Null.NullInteger);
ProfileController.AddDefaultDefinition(Null.NullInteger, "Preferences", "Photo", "Image", 0, properties.Count * 2 + 2, UserVisibilityMode.AllUsers, dataTypes);
string installTemplateFile = string.Format("{0}Template\\UserProfile.page.template", Globals.InstallMapPath);
string hostTemplateFile = string.Format("{0}Templates\\UserProfile.page.template", Globals.HostMapPath);
if (File.Exists(installTemplateFile))
{
if (!File.Exists(hostTemplateFile))
{
File.Copy(installTemplateFile, hostTemplateFile);
}
}
if (File.Exists(hostTemplateFile))
{
ArrayList portals = PortalController.Instance.GetPortals();
foreach (PortalInfo portal in portals)
{
properties = ProfileController.GetPropertyDefinitionsByPortal(portal.PortalID);
//Add new Photo Profile field to Portal
ProfileController.AddDefaultDefinition(portal.PortalID, "Preferences", "Photo", "Image", 0, properties.Count * 2 + 2, UserVisibilityMode.AllUsers, dataTypes);
//Rename old Default Page template
string defaultPageTemplatePath = string.Format("{0}Templates\\Default.page.template", portal.HomeDirectoryMapPath);
if (File.Exists(defaultPageTemplatePath))
{
File.Move(defaultPageTemplatePath, String.Format("{0}Templates\\Default_old.page.template", portal.HomeDirectoryMapPath));
}
//Update Default profile template in every portal
PortalController.Instance.CopyPageTemplate("Default.page.template", portal.HomeDirectoryMapPath);
//Add User profile template to every portal
PortalController.Instance.CopyPageTemplate("UserProfile.page.template", portal.HomeDirectoryMapPath);
//Synchronize the Templates folder to ensure the templates are accessible
FolderManager.Instance.Synchronize(portal.PortalID, "Templates/", false, true);
var xmlDoc = new XmlDocument();
try
{
// open the XML file
xmlDoc.Load(hostTemplateFile);
}
catch (Exception ex)
{
Exceptions.Exceptions.LogException(ex);
}
XmlNode userTabNode = xmlDoc.SelectSingleNode("//portal/tabs/tab");
if (userTabNode != null)
{
string tabName = XmlUtils.GetNodeValue(userTabNode.CreateNavigator(), "name");
var userTab = TabController.Instance.GetTabByName(tabName, portal.PortalID) ?? TabController.DeserializeTab(userTabNode, null, portal.PortalID, PortalTemplateModuleAction.Merge);
//Update SiteSettings to point to the new page
if (portal.UserTabId > Null.NullInteger)
{
portal.RegisterTabId = portal.UserTabId;
}
else
{
portal.UserTabId = userTab.TabID;
}
}
PortalController.Instance.UpdatePortalInfo(portal);
//Add Users folder to every portal
string usersFolder = string.Format("{0}Users\\", portal.HomeDirectoryMapPath);
if (!Directory.Exists(usersFolder))
{
//Create Users folder
Directory.CreateDirectory(usersFolder);
//Synchronize the Users folder to ensure the user folder is accessible
//.........这里部分代码省略.........
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:101,代码来源:Upgrade.cs
示例16: DeleteItem
private void DeleteItem(int entryId)
{
if (SelectedListItems.Any())
{
try
{
var ctlLists = new ListController();
ctlLists.DeleteListEntryByID(entryId, true);
DataBind();
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
else
{
DeleteList();
}
}
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:20,代码来源:ListEntries.ascx.cs
示例17: DeleteList
private void DeleteList()
{
var ctlLists = new ListController();
ctlLists.DeleteList(SelectedList, true);
Response.Redirect(Globals.NavigateURL(TabId));
}
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:8,代码来源:ListEntries.ascx.cs
示例18: SelectListIndexChanged
/// <summary>
/// Select a list in dropdownlist
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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.GetListEntryInfoItems(selList.Name, selList.ParentKey);
ddlSelectParent.DataTextField = "DisplayName";
ddlSelectParent.DataValueField = "EntryID";
ddlSelectParent.DataBind();
}
}
else
{
ddlSelectParent.Enabled = false;
ddlSelectParent.Items.Clear();
}
}
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:25,代码来源:ListEntries.ascx.cs
示例19: BindListInfo
/// <summary>
/// Loads top level entry list
/// </summary>
private void BindListInfo()
{
lblListName.Text = ListName;
lblListParent.Text = ParentKey;
rowListParent.Visible = (!String.IsNullOrEmpty(ParentKey));
chkEnableSortOrder.Checked = EnableSortOrder;
if (!SystemList && ShowDelete)
{
cmdDeleteList.Visible = true;
ClientAPI.AddButtonConfirm(cmdDeleteList, Localization.GetString("DeleteItem"));
}
else
{
cmdDeleteList.Visible = false;
}
switch (Mode)
{
case "ListEntries":
EnableView(true);
break;
case "EditEntry":
EnableView(false);
EnableEdit(false);
break;
case "AddEntry":
EnableView(false);
EnableEdit(false);
if (SelectedList != null)
{
txtParentKey.Text = SelectedList.ParentKey;
}
else
{
rowEnableSortOrder.Visible = true;
}
txtEntryName.Text = ListName;
rowListName.Visible = false;
txtEntryValue.Text = "";
txtEntryText.Text = "";
cmdSaveEntry.CommandName = "SaveEntry";
break;
case "AddList":
EnableView(false);
EnableEdit(true);
rowListName.Visible = true;
txtParentKey.Text = "";
txtEntryName.Text = "";
txtEntryValue.Text = "";
txtEntryText.Text = "";
txtEntryName.ReadOnly = false;
cmdSaveEntry.CommandName = "SaveList";
var ctlLists = new ListController();
ddlSelectList.Enabled = true;
ddlSelectList.DataSource = ctlLists.GetListInfoCollection(string.Empty, string.Empty, PortalSettings.ActiveTab.PortalID);
ddlSelectList.DataTextField = "DisplayName";
ddlSelectList.DataValueField = "Key";
ddlSelectList.DataBind();
//ddlSelectList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), ""));
ddlSelectList.InsertItem(0, Localization.GetString("None_Specified"), "");
//Reset dropdownlist
ddlSelectParent.ClearSelection();
ddlSelectParent.Enabled = false;
break;
}
}
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:73,代码来源:ListEntries.ascx.cs
示例20: EntriesGridItemCommand
/// <summary>
/// Handles events when clicking image button in the grid (Edit/Up/Down)
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
protected void EntriesGridItemCommand(object source, GridCommandEventArgs e)
{
try
{
var ctlLists = new ListController();
int entryID = Convert.ToInt32(((GridDataItem) e.Item).GetDataKeyValue("EntryID"));
switch (e.CommandName.ToLower())
{
case "delete":
Mode = "ListEntries";
DeleteItem(entryID);
break;
case "edit":
Mode = "EditEntry";
ListEntryInfo entry = ctlLists.GetListEntryInfo(entryID);
txtEntryID.Text = entryID.ToString(CultureInfo.InvariantCulture);
txtParentKey.Text = entry.ParentKey;
txtEntryValue.Text = entry.Value;
txtEntryText.Text = entry.Text;
rowListName.Visible = false;
cmdSaveEntry.CommandName = "Update";
if (!SystemList)
{
cmdDelete.Visible = true;
ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem"));
}
else
{
cmdDelete.Visible = false;
}
e.Canceled = true; //stop the grid from providing inline editing
DataBind();
break;
case "up":
ctlLists.UpdateListSortOrder(entryID, true);
DataBind();
break;
case "down":
ctlLists.UpdateListSortOrder(entryID, false);
DataBind();
break;
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:56,代码来源:ListEntries.ascx.cs
注:本文中的DotNetNuke.Common.Lists.ListController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论