public override void UpdateUniqueProperties(string i_Key, string i_Value)
 {
     if (i_Key == k_EngineVolumeKey)
     {
         this.m_EngineVolume = (int)LogicUtils.NumericValueValidation(i_Value, int.MaxValue);
     }
     else if (i_Key == k_LicenseTypeKey)
     {
         this.m_LicenseType = LogicUtils.EnumValidation <eLicenseType>(i_Value, i_Key);
     }
     else
     {
         throw new ArgumentException("Invalid key");
     }
 }
Example #2
0
 public override void UpdateUniqueProperties(string i_Key, string i_Value)
 {
     if (i_Key == k_ColorKey)
     {
         this.m_Color = LogicUtils.EnumValidation <eColor>(i_Value, k_ColorKey);
     }
     else if (i_Key == k_DoorsNumKey)
     {
         this.m_DoorsNumber = LogicUtils.EnumValidation <eDoorsNumber>(i_Value, k_DoorsNumKey);
     }
     else
     {
         throw new ArgumentException("Invalid key");
     }
 }
Example #3
0
        public string DisplayVehiclesList(string i_FilterByStatus)
        {
            eVehicleStatus fillter          = eVehicleStatus.InProcess;
            StringBuilder  licensePlatesStr = new StringBuilder();

            if (i_FilterByStatus != this.k_NoStatusFilter)
            {
                fillter = LogicUtils.EnumValidation <Garage.eVehicleStatus>(i_FilterByStatus, Garage.k_VehicleStatusKey);
            }

            foreach (ClientVehicle client in this.m_Vehicle.Values)
            {
                if (i_FilterByStatus == this.k_NoStatusFilter || client.Status == fillter)
                {
                    licensePlatesStr.Append(string.Format("{0}{1}", client.Vehicle.LicensePlate, Environment.NewLine).ToString());
                }
            }

            return(licensePlatesStr.ToString());
        }
Example #4
0
 public void UpdateVehicleStatus(string i_LicensePlate, string i_NewStatus)
 {
     Garage.eVehicleStatus statusToUpdate = LogicUtils.EnumValidation <Garage.eVehicleStatus>(i_NewStatus, k_VehicleStatusKey);
     this.checkLicensePlate(i_LicensePlate);
     this.m_Vehicle[i_LicensePlate].Status = statusToUpdate;
 }