Exemple #1
0
        public void ReturnCar(Vehicle v)
        {
            RentRecordsDAO rentRecordsDAO = RentRecordsDAO.getInstance();
            VehicleDAO     vehicleDAO     = VehicleDAO.getInstance();

            try
            {
                rentRecordsDAO.ReturnCar(v);
                vehicleDAO.ReturnCar(v);
                return;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                throw;
            }
            finally
            {
                rentRecordsDAO.CloseConnection();
            }
        }
Exemple #2
0
        public void CreateRentRecords(RentRecords r)
        {
            RentRecordsDAO rentRecordsDAO = RentRecordsDAO.getInstance();
            VehicleDAO     vehicleDAO     = VehicleDAO.getInstance();

            try
            {
                rentRecordsDAO.openConnection();
                rentRecordsDAO.InsertRentRecord(r);
                //vehicleDAO.RentOut(r.VehiclePlateNumber);
                return;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                throw;
            }
            finally
            {
                rentRecordsDAO.CloseConnection();
            }
        }