Example #1
0
        public static List <string> GetFreeParkingLots(List <Vehicle> vehicles)
        {
            List <string> freeParkings = new ParkingsLots().parkingLots;

            foreach (var vehicle in vehicles)
            {
                if (freeParkings.Contains(vehicle.ParkingLotNumber))
                {
                    freeParkings.Remove(vehicle.ParkingLotNumber);
                }
            }
            return(freeParkings);
        }
Example #2
0
        public static List <string> GetParkingLots(List <Vehicle> vehicles)
        {
            ParkingsLots  parkingLots   = new ParkingsLots();
            List <string> parkingStatus = parkingLots.parkingLots;

            foreach (var vehicle in vehicles)
            {
                if (parkingStatus.Contains(vehicle.ParkingLotNumber))
                {
                    int i = parkingStatus.FindIndex(a => a.Equals(vehicle.ParkingLotNumber));
                    parkingStatus[i] = parkingStatus[i] + "<div title=/Vehicles/ParkingDetails/" + vehicle.RegNr + "><span class='regNr'> " + vehicle.RegNr + "</span></div><span class='tooltiptext'>" + vehicle.Brand + " " + vehicle.Modell + "</br> " + vehicle.ParkingStartTime + "</span>";
                }
            }
            return(parkingStatus);
        }