예제 #1
0
 public static void ShowCarDetails(CarStatus carStatus)
 {
     Console.WriteLine($"ID: {carStatus.car.ID}");
     Console.WriteLine($"Number Plate: {carStatus.car.NumberPlate}");
     Console.WriteLine($"Make: {carStatus.car.Make}");
     Console.WriteLine($"Model: {carStatus.car.Model}");
     Console.WriteLine($"Color: {carStatus.car.Color}");
     Console.WriteLine($"Owner Name: {carStatus.car.OwnerName}");
     Console.WriteLine($"Owner Contant Number: {carStatus.car.OwnerContactNumber}");
     Console.WriteLine($"Checked in status: {carStatus.checkInStatus}");
 }
예제 #2
0
        public List <CarStatus> SearchBy(string key)
        {
            List <Car>       foundCars = RegisteredCar.FindAll(rcar => rcar.NumberPlate.ToLower() == key.ToLower());
            List <CarStatus> carStatus = new List <CarStatus>();
            CarStatus        cs;

            foreach (var car in foundCars)
            {
                cs               = new CarStatus();
                cs.car           = car;
                cs.checkInStatus = isCarCheckedIn(car.ID);
                carStatus.Add(cs);
            }
            return(carStatus);
        }