Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves all vehicles via the VehicleAccessor's retrieve all vehicles stored procedure call
        /// No parameters are required for this method as it is intended for admin/employees to utilize this feature
        /// </summary>
        /// <returns>List<Vehicle></returns>
        public List <Vehicle> GetFullListOfVehicles()
        {
            var allVehicles = new List <Vehicle>();

            allVehicles = VehicleAccessor.RetrieveAllVehicles();
            return(allVehicles);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Eric Walton
        /// 2017/02/03
        /// Retrieves all vehicles
        /// </summary>
        /// <remarks>
        /// Robert Forbes
        /// 2017/03/24
        ///
        /// Added repair list access
        /// </remarks>
        /// <returns></returns>
        public List <Vehicle> RetrieveAllVehicles()
        {
            var vehicles = new List <Vehicle>();

            try
            {
                vehicles = VehicleAccessor.RetrieveAllVehicles();
                foreach (Vehicle vehicle in vehicles)
                {
                    IRepairManager repairManager = new RepairManager();
                    vehicle.RepairList = repairManager.RetreiveAllRepairsForVehicle(vehicle.VehicleID);
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(vehicles);
        }