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(); } }
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(); } }