Beispiel #1
0
        // GET: /List
        public ActionResult List(
            int?page,
            string sortField,
            int?sortOrder,
            string filterField_1 = "",
            string filterValue_1 = "",
            string filterField_2 = "",
            string filterValue_2 = "",
            string filterField_3 = "",
            string filterValue_3 = "")
        {
            if (string.IsNullOrEmpty(sortField))
            {
                sortField = "LastName";
            }

            ViewData["CurrentSortField"] = sortField;


            if (sortOrder == 1)
            {
                ViewData["NewSortOrder"]     = 0;
                ViewData["CurrentSortOrder"] = 1;
            }
            else
            {
                ViewData["NewSortOrder"]     = 1;
                ViewData["CurrentSortOrder"] = 0;
            }
            if (page < 1)
            {
                page = 1;
            }
            var items = systemUserRepository.GetSystemUsers(
                page ?? 1,
                sortField,
                sortOrder ?? 0,
                filterField_1,
                filterValue_1,
                filterField_2,
                filterValue_2,
                filterField_3,
                filterValue_3
                );

            Dictionary <string, string> filters = new Dictionary <string, string>();

            filters.Add("Login", "Login");
            filters.Add("ProfileID", "Profile ID");
            filters.Add("FirstName", "First Name");
            filters.Add("LastName", "Last Name");
            filters.Add("HomePCCOfficeID", "Home PCC/Office ID");
            filters.Add("GDSSignOnID", "GDS Sign On ID");
            filters.Add("Location", "Location");

            ViewData["Filters_1"] = new SelectList(filters, "Key", "Value", filterField_1);
            ViewData["Filters_2"] = new SelectList(filters, "Key", "Value", filterField_2);
            ViewData["Filters_3"] = new SelectList(filters, "Key", "Value", filterField_3);

            ViewData["FilterField_1"] = filterField_1;
            ViewData["FilterValue_1"] = filterValue_1;
            ViewData["FilterField_2"] = filterField_2;
            ViewData["FilterValue_2"] = filterValue_2;
            ViewData["FilterField_3"] = filterField_3;
            ViewData["FilterValue_3"] = filterValue_3;

            return(View(items));
        }