Beispiel #1
0
        public ActionResult DisplayOverview(string searchString, string sortOrder, string TypeFilter, bool?DateinFilter, bool?VehFilter)
        {
            // Default to sorting by parking slot id
            sortOrder = sortOrder ?? "ParkingSlotId";

            // Update ViewBag
            ViewBag.TypeSortParm     = sortOrder == "Type" ? "Type_desc" : "Type";
            ViewBag.OwnSortParm      = sortOrder == "OwnerName" ? "OwnerName_desc" : "OwnerName";
            ViewBag.RegSortParm      = sortOrder == "VehicleReg" ? "VehicleReg_desc" : "VehicleReg";
            ViewBag.PIDSortParm      = sortOrder == "ParkingSlotId" ? "ParkingSlotId_desc" : "ParkingSlotId";
            ViewBag.DateInSortParm   = sortOrder == "DateIn" ? "DateIn_desc" : "DateIn";
            ViewBag.DateOutSortParm  = sortOrder == "DateOut" ? "DateOut_desc" : "DateOut";
            ViewBag.DurationSortParm = sortOrder == "Duration" ? "Duration_desc" : "Duration";


            /*var TypeList = new List<string>();
             *
             *          TypeList.Add("Show All");
             *          foreach (var typex in Enum.GetValues(typeof(VehicleType)))
             * {
             *  TypeList.Add(typex.ToString());
             * }
             *
             * ViewBag.TypeList = TypeList;*/

            ViewBag.TypeList = repo.GetTypeList();

            var filteredList = repo.FilteredOverview(searchString, sortOrder, TypeFilter, DateinFilter, VehFilter);

            return(View(filteredList));
        }