Ejemplo n.º 1
0
        private void changeVehicleStatusInGarage()
        {
            Console.Clear();
            string licensePlate = licensePlateInput();

            VehicleInGarage.eStatus newStatus = printMenuFormatAndReturnUserChoice <VehicleInGarage.eStatus>("Choose new status:");

            m_GarageModel.ChangeVehicleStatus(licensePlate, newStatus);
            Console.WriteLine("Vehicle status changed successfully.");
            System.Threading.Thread.Sleep(2500);
        }
Ejemplo n.º 2
0
        public bool ChangeVehicleStatus(string i_LicenseNumber, VehicleInGarage.eStatus i_Status)
        {
            bool returnValue = false;

            if (getVehicleInGarage(i_LicenseNumber, out VehicleInGarage currentVehicleInGarage))
            {
                currentVehicleInGarage.Status = i_Status;
                returnValue = true;
            }

            return(returnValue);
        }
Ejemplo n.º 3
0
        public List <string> GetListOfVehiclesInGarage(VehicleInGarage.eStatus i_Status)
        {
            List <string> list = new List <string>();

            foreach (KeyValuePair <string, VehicleInGarage> v in this.r_VehiclesInGarages)
            {
                if (v.Value.Status == i_Status)
                {
                    list.Add(v.Key);
                }
            }

            return(list);
        }
Ejemplo n.º 4
0
        public List <string> ListOfVehicleLicensePlatesInGarageByStatus(VehicleInGarage.eStatus i_Status)
        {
            List <string> LicensePlateList = new List <string>();

            foreach (KeyValuePair <int, VehicleInGarage> vehicleToCheck in m_VehicelsList)
            {
                if (vehicleToCheck.Value.Status == i_Status)
                {
                    LicensePlateList.Add(vehicleToCheck.Value.Vehicle.LicensePlate);
                }
            }

            return(LicensePlateList);
        }
Ejemplo n.º 5
0
        private void vehicleStatusMenuList()
        {
            Console.Clear();
            VehicleInGarage.eStatus vehicleStatusToShow = printMenuFormatAndReturnUserChoice <VehicleInGarage.eStatus>("Choose status:");
            List <string>           vehicleListByStatus = m_GarageModel.ListOfVehicleLicensePlatesInGarageByStatus(vehicleStatusToShow);

            // print the list:
            if (vehicleListByStatus.Count != 0)
            {
                Console.WriteLine(string.Format("{0} vehicles license plates:", Enum.GetName(typeof(VehicleInGarage.eStatus), vehicleStatusToShow)));
                vehicleListByStatus.ForEach(Console.WriteLine);
            }
            else
            {
                Console.WriteLine("There are no vehicles with this status at the garage.");
            }
            endOfActionMessage();
        }
Ejemplo n.º 6
0
        public void ChangeVehicleStatus(string i_LicensePlate, VehicleInGarage.eStatus i_NewStatus)
        {
            VehicleInGarage vehicleInGarageToUpdate = FindAndReturnVehicleInGarage(i_LicensePlate);

            vehicleInGarageToUpdate.Status = i_NewStatus;
        }