/// <summary>
 /// Creates a new maintenance record
 /// Created by Mason Allen
 /// Created on 03/09/17
 /// </summary>
 /// <param name="vehicleId">Vehicle Id of the new maintenance schedule</param>
 /// <returns>int of 1 if successful, 0 if fail</returns>
 public int CreateMaintenanceSchedule(int vehicleId)
 {
     try
     {
         return(MaintenanceScheduleAccessor.CreateMaintenanceSchedule(vehicleId));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public MaintenanceSchedule RetrieveMaintenanceScheduleByVehicleId(int vehicleId)
 {
     try
     {
         return(MaintenanceScheduleAccessor.RetrieveMaintenanceScheduleByVehicleId(vehicleId));
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #3
0
        /// <summary>
        /// Mason Allen
        /// Created 03/01/2017
        /// Updated on 03/09/17 to include maintenance schedule creation on new vehicle creation
        /// Creates a new vehicle record
        /// </summary>
        /// <param name="newVehicle"></param>
        /// <returns>An int of 1 for success, 0 for fail</returns>
        public int CreateVehicle(Vehicle newVehicle)
        {
            int newVehicleId;
            int success;

            try
            {
                newVehicleId = VehicleAccessor.CreateVehicle(newVehicle);
                success      = MaintenanceScheduleAccessor.CreateMaintenanceSchedule(newVehicleId);
            }
            catch (Exception)
            {
                throw;
                //throw new ApplicationException("There was a problem saving the requested vehicle");
            }
            return(newVehicleId);
        }