Exemple #1
0
        public static VehicleDAO getInstance()
        {
            if (dbInstance == null)
            {
                dbInstance = new VehicleDAO();
            }

            return(dbInstance);
        }
Exemple #2
0
        public DataTable retrieveVehicleInfo(string id)
        {
            VehicleDAO vehicleDAO = VehicleDAO.getInstance();

            try
            {
                vehicleDAO.openConnection();
                DataTable AVList = vehicleDAO.retrieveVehicleInfo(id);
                return(AVList);
            }
            catch (Exception)
            {
                throw;           // preserve stack trace
            }
            finally
            {
                vehicleDAO.CloseConnection();
            }
        }
        public Vehicle RetrievePlateNo(string plate)
        {
            VehicleDAO rentalDAO = VehicleDAO.getInstance();

            try
            {
                rentalDAO.openConnection();
                Vehicle c = rentalDAO.RetrieveVehicle(plate);
                return(c);
            }
            catch (Exception)
            {
                throw;           // preserve stack trace
            }
            finally
            {
                rentalDAO.CloseConnection();
            }
        }
Exemple #4
0
        public void updateVehicleInfo(Vehicle v)
        {
            VehicleDAO vehicleDAO = VehicleDAO.getInstance();

            try
            {
                vehicleDAO.openConnection();
                vehicleDAO.updateVehicleInfo(v);

                return;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                vehicleDAO.CloseConnection();
            }
        }