Exemplo n.º 1
0
        // GET: /ListDeleted
        public ActionResult ListDeleted(string filter, int?page, string sortField, int?sortOrder)
        {
            //SortField
            if (sortField != "HierarchyType" && sortField != "EnabledDate")
            {
                sortField = "OptionalFieldGroupName";
            }
            ViewData["CurrentSortField"] = sortField;

            //SortOrder
            if (sortOrder == 1)
            {
                ViewData["NewSortOrder"]     = 0;
                ViewData["CurrentSortOrder"] = 1;
            }
            else
            {
                ViewData["NewSortOrder"]     = 1;
                ViewData["CurrentSortOrder"] = 0;
                sortOrder = 0;
            }

            OptionalFieldGroupsVM optionalFieldGroupsVM = new OptionalFieldGroupsVM();

            //Set Access Rights
            if (hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                optionalFieldGroupsVM.HasDomainWriteAccess = true;
            }

            //return items
            optionalFieldGroupsVM.OptionalFieldGroups = optionalFieldGroupRepository.PageOptionalFieldGroups(true, page ?? 1, filter ?? "", sortField, sortOrder ?? 0);

            return(View(optionalFieldGroupsVM));
        }
Exemplo n.º 2
0
        // GET: /ListOrphaned
        public ActionResult ListOrphaned(string filter, int?page, string sortField, int?sortOrder)
        {
            //Set Access Rights
            ViewData["Access"] = "";
            if (hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Access"] = "WriteAccess";
            }

            //SortField
            sortField = "OptionalFieldGroupName";
            ViewData["CurrentSortField"] = sortField;

            //SortOrder
            if (sortOrder == 1)
            {
                ViewData["NewSortOrder"]     = 0;
                ViewData["CurrentSortOrder"] = 1;
            }
            else
            {
                ViewData["NewSortOrder"]     = 1;
                ViewData["CurrentSortOrder"] = 0;
            }

            OptionalFieldGroupsVM optionalFieldGroupsVM = new OptionalFieldGroupsVM();

            //Set Access Rights
            if (hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                optionalFieldGroupsVM.HasDomainWriteAccess = true;
            }

            //return items
            optionalFieldGroupsVM.OptionalFieldGroupsOrphaned = optionalFieldGroupRepository.PageOrphanedOptionalFieldGroups(page ?? 1, filter ?? "", sortField, sortOrder ?? 0);

            return(View(optionalFieldGroupsVM));
        }