本文整理汇总了C#中SortDirection.GetValueOrDefault方法的典型用法代码示例。如果您正苦于以下问题:C# SortDirection.GetValueOrDefault方法的具体用法?C# SortDirection.GetValueOrDefault怎么用?C# SortDirection.GetValueOrDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortDirection
的用法示例。
在下文中一共展示了SortDirection.GetValueOrDefault方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SearchCatalogueValueListPaginated
/// <summary>
/// Perform the search of catalogues values in the pagination buttons
/// </summary>
/// <param name="sortedColumn">Sorted column</param>
/// <param name="page">Selected page</param>
/// <param name="sortDirection">Sort direction</param>
/// <returns>PartialViewResult</returns>
public PartialViewResult SearchCatalogueValueListPaginated(SortDirection? sortDirection, string sortedColumn, int? page)
{
PaginatedList<CatalogueValue> model = new PaginatedList<CatalogueValue>();
Guid? catalogueId = Session["catalogueId"] as Guid?;
int pageSize = Cotecna.Vestalis.Web.Properties.Settings.Default.PageSize;
model = CatalogueBusiness.SearchCatalogueValueList(catalogueId.GetValueOrDefault(), pageSize, sortDirection.GetValueOrDefault(), sortedColumn, page.GetValueOrDefault(), false);
return PartialView("_CatalogueValueGrid", model);
}
示例2: SearchCatalogueListPaginated
/// <summary>
/// Perform the search of catalogues in the pagination buttons
/// </summary>
/// <param name="sortedColumn">Sorted column</param>
/// <param name="page">Selected Page</param>
/// <param name="sortDirection">Sort direction</param>
/// <returns>PartialViewResult</returns>
public PartialViewResult SearchCatalogueListPaginated(SortDirection? sortDirection, string sortedColumn, int? page)
{
int pageSize = Cotecna.Vestalis.Web.Properties.Settings.Default.PageSize;
Guid? businessApplicationId = Session["catalogueBusinessApplicationId"] as Guid?;
PaginatedList<CatalogueModel> model = new PaginatedList<CatalogueModel>();
ParameterSearchCatalogues parameters = new ParameterSearchCatalogues()
{
BusinessApplicationId = businessApplicationId.GetValueOrDefault(),
PageSize = pageSize,
SortDirection = sortDirection.GetValueOrDefault(),
SortedColumn = sortedColumn,
SelectedPage = page.GetValueOrDefault(),
UserName = UserName
};
model = CatalogueBusiness.SearchCategoryCatalogue(parameters);
return PartialView("_CatalogueGrid", model);
}
示例3: SearchUsersPaginated
/// <summary>
/// Perform the search operation of the users
/// </summary>
/// <param name="sortDirection">Sort direction</param>
/// <param name="sortedColumn">Sorted column</param>
/// <param name="page">Current page</param>
/// <returns></returns>
public PartialViewResult SearchUsersPaginated(SortDirection? sortDirection, string sortedColumn, int? page)
{
PaginatedList<UserGridModel> model = new PaginatedList<UserGridModel>();
Guid? businessApplicationId = Session["selectedAppId"] as Guid?;
page = page == null ? 1 : page;
int pageSize = Cotecna.Vestalis.Web.Properties.Settings.Default.PageSize;
ParameterSearchUser parameters = new ParameterSearchUser
{
BusinessApplicationId = businessApplicationId.GetValueOrDefault(),
PageSize = pageSize,
SelectedPage = page.GetValueOrDefault(),
SortDirection = sortDirection.GetValueOrDefault(),
SortedColumn = sortedColumn,
UserTypes = UserTypes,
IsGlobalAdmin = IsGlobalAdmin,
LoggedUserName = UserName
};
model = AuthorizationBusiness.Instance.GetUserList(parameters);
Session.Add("selectedAppId", businessApplicationId);
Session.Add("UserSearch", model);
return PartialView("_UsersGrid", model);
}
示例4: ListOperation
public ActionResult ListOperation(int containerId, ListOperation operation, SortBy? sortBy, SortDirection? sortByDirection, PagerParameters pagerParameters) {
var items = _containerService.GetContentItems(containerId, VersionOptions.Latest).Select(x => x.As<ContainablePart>());
switch (operation) {
case ViewModels.ListOperation.Reverse:
_containerService.Reverse(items);
_services.Notifier.Information(T("The list has been reversed."));
break;
case ViewModels.ListOperation.Shuffle:
_containerService.Shuffle(items);
_services.Notifier.Information(T("The list has been shuffled."));
break;
case ViewModels.ListOperation.Sort:
_containerService.Sort(items, sortBy.GetValueOrDefault(), sortByDirection.GetValueOrDefault());
_services.Notifier.Information(T("The list has been sorted."));
break;
default:
_services.Notifier.Error(T("Please select an operation to perform on the list."));
break;
}
return RedirectToAction("List", new {containerId, page = pagerParameters.Page, pageSize = pagerParameters.PageSize});
}
示例5: SearchPermisssions
/// <summary>
/// Perform the search with pagination
/// </summary>
/// <param name="sortedColumn">Sorted column</param>
/// <param name="page">Page</param>
/// <param name="sortDirection">Sort direction</param>
/// <returns>PartialViewResult</returns>
public PartialViewResult SearchPermisssions(SortDirection? sortDirection, string sortedColumn, int? page)
{
UserModel userModel = Session["UserModel"] as UserModel;
int pageSize = Cotecna.Vestalis.Web.Properties.Settings.Default.PageSize;
if (string.IsNullOrEmpty(sortedColumn))
sortedColumn = "BusinessApplication";
if (page == null) page = 1;
if (sortDirection == null) sortDirection = SortDirection.Ascending;
ParameterSearchPermission parameters = new ParameterSearchPermission()
{
PageSize = pageSize,
SelectedPage = page.GetValueOrDefault(),
SortedColumn = sortedColumn,
SortDirection = sortDirection.GetValueOrDefault(),
LoginName = userModel.Email,
IsGlobalAdmin = IsGlobalAdmin,
LoggedUserName = UserName
};
PaginatedList<PermissionGridModel> model = AuthorizationBusiness.GetPermissionListByUser(parameters);
return PartialView("_PermissionGrid", model);
}