本文整理汇总了C#中DotNetNuke.Common.Lists.ListController.UpdateListSortOrder方法的典型用法代码示例。如果您正苦于以下问题:C# ListController.UpdateListSortOrder方法的具体用法?C# ListController.UpdateListSortOrder怎么用?C# ListController.UpdateListSortOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Common.Lists.ListController
的用法示例。
在下文中一共展示了ListController.UpdateListSortOrder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: grdEntries_ItemCommand
/// <summary>
/// Handles events when clicking image button in the grid (Edit/Up/Down)
/// </summary>
/// <history>
/// [tamttt] 20/10/2004 Created
/// </history>
protected void grdEntries_ItemCommand( object source, DataGridCommandEventArgs e )
{
try
{
ListController ctlLists = new ListController();
int entryID = Convert.ToInt32(((DataGrid)source).DataKeys[e.Item.ItemIndex]);
switch (e.CommandName.ToLower())
{
case "delete":
DeleteItem(entryID);
InitList();
BindGrid();
break;
case "edit":
EnableView(false);
EnableEdit(false);
ListEntryInfo entry = ctlLists.GetListEntryInfo(entryID);
this.txtEntryID.Text = entryID.ToString();
this.txtParentKey.Text = entry.ParentKey;
this.txtEntryName.Text = entry.ListName;
this.txtEntryValue.Text = entry.Value;
this.txtEntryText.Text = entry.Text;
this.txtEntryName.ReadOnly = true;
this.cmdSaveEntry.CommandName = "Update";
if (!(entry.DefinitionID == -1))
{
this.cmdDelete.Visible = true;
ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem"));
}
else
{
this.cmdDelete.Visible = false;
}
break;
case "up":
ctlLists.UpdateListSortOrder(entryID, true);
InitList();
BindGrid();
break;
case "down":
ctlLists.UpdateListSortOrder(entryID, false);
InitList();
BindGrid();
break;
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}