Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        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});
        }
Exemplo n.º 5
0
        /// <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);
        }