当前位置: 首页>>代码示例>>C#>>正文


C# SortDirection.GetValueOrDefault方法代码示例

本文整理汇总了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);
 }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:15,代码来源:CatalogueController.cs

示例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);
        }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:26,代码来源:CatalogueController.cs

示例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);
        }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:31,代码来源:AccountController.cs

示例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});
        }
开发者ID:Zlatinsz,项目名称:podnebeto,代码行数:22,代码来源:AdminController.cs

示例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);
        }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:30,代码来源:AccountController.cs


注:本文中的SortDirection.GetValueOrDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。