예제 #1
0
        /// <summary author="Richard Carroll" created="2019/03/08">
        /// Takes two Vehicle arguments and passes them to the
        /// Data Access Layer which attempts to update the Vehicle.
        /// Returns the result.
        /// </summary>
        public bool UpdateGuestVehicle(GuestVehicle oldVehicle, GuestVehicle vehicle)
        {
            bool result = false;

            try
            {
                if (vehicle.isValid())
                {
                    if (oldVehicle.isValid())
                    {
                        result = 1 == _guestVehicleAccessor.UpdateGuestVehicle(oldVehicle, vehicle);
                    }
                    else
                    {
                        throw new ArgumentException("Data for this Vehicle is Invalid: \n"
                                                    + oldVehicle.ToString());
                    }
                }
                else
                {
                    throw new ArgumentException("Data for this Vehicle is Invalid: \n"
                                                + vehicle.ToString());
                }
            }
            catch (Exception ex)
            {
                ExceptionLogManager.getInstance().LogException(ex);
                throw ex;
            }

            return(result);
        }