コード例 #1
0
        public string SearchForVehicle(string regnr)
        {
            boxElement = Contains(regnr);
            if (boxElement != -1)
            {
                return($"Cost: {CalculatePrice.Price(boxes[boxElement].Search(regnr))}$" +
                       $"\nArrivel: {boxes[boxElement].Search(regnr).TimeArrived}" +
                       $"\nTime parked: {boxes[boxElement].Search(regnr).TimeParked}" +
                       $"\nBox Position {boxElement + 1} {boxes[boxElement].Search(regnr)}");
            }

            return($"Vehicle {regnr} not found!");
        }
コード例 #2
0
 public string Remove(string regnr)
 {
     boxElement = Contains(regnr);
     if (boxElement != -1)
     {
         //Shows all info including cost then remove it
         vehicleCount--;
         return($"Cost: {CalculatePrice.Price(boxes[boxElement].Search(regnr))}$" +
                $"\nArrivel: {boxes[boxElement].Search(regnr).TimeArrived}" +
                $"\nTime parked: {boxes[boxElement].Search(regnr).TimeParked}" +
                $"\nBox Position {boxElement + 1} {boxes[boxElement].Remove(regnr)}" +
                $"\nWill be removed: ");
     }
     return($"Vehicle {regnr} not found!");
 }