public void ChangeStateOfVehicle(string i_VehicleRegistrationPlate, StateOfVehicle i_NewState) // option 3
 {
     foreach (Vehicle vehicle in m_Vehicles)
     {
         if (vehicle.RegistrationPlate == i_VehicleRegistrationPlate)
         {
             vehicle.StateOfVehicle = i_NewState;
         }
     }
 }
        public List <string> CreateLicenseListByStateOfVehicle(StateOfVehicle i_VehicleState)
        {
            List <string> licenseNumbers = new List <string>();

            foreach (Vehicle vehicle in m_Vehicles)
            {
                if (vehicle.StateOfVehicle == i_VehicleState)
                {
                    licenseNumbers.Add(vehicle.RegistrationPlate);
                }
            }

            return(licenseNumbers);
        }
Exemplo n.º 3
0
 private Vehicle(long ownerId, Automobile automobile,
                 string title, string description, Mileage mileage,
                 string url, string imageUrl, string imageTag,
                 Condition condition, string price, string address, string exteriorColor, string salePrice,
                 StateOfVehicle stateOfVehicle, Geometry geometry)
 {
     OwnerId        = ownerId;
     Automobile     = automobile;
     Title          = title.Truncate(100);
     Description    = string.IsNullOrEmpty(description) || !Regex.IsMatch(description, @"[a-zA-Z]+") ? title : description;
     Mileage        = mileage;
     Url            = url;
     ImageUrl       = imageUrl;
     ImageTag       = imageTag;
     Condition      = condition.DisplayName;
     Price          = price.Truncate(25);
     Address        = address;
     ExteriorColor  = exteriorColor.Truncate(25);
     SalePrice      = salePrice.Truncate(25);
     StateOfVehicle = stateOfVehicle.DisplayName;
     Geometry       = geometry;
 }
Exemplo n.º 4
0
 public override StateOfVehicle SetStateOfVehicle(int input)
 {
     state = (StateOfVehicle)input;
     return(state);
 }
Exemplo n.º 5
0
 public virtual StateOfVehicle SetStateOfVehicle(int input)
 {
     state = (StateOfVehicle)input;
     return(state);
 }