├── .idea
├── .name
├── .gitignore
├── vcs.xml
├── libraries
│ └── postgresql_42_7_3.xml
├── misc.xml
├── modules.xml
└── uiDesigner.xml
├── tourismagency.sql
├── postgresql-42.7.3.jar
├── src
├── App.java
├── core
│ ├── ComboItem.java
│ ├── Database.java
│ └── Helper.java
├── business
│ ├── SeasonManager.java
│ ├── PensionManager.java
│ ├── HotelManager.java
│ ├── ReservationManager.java
│ ├── UserManager.java
│ └── RoomManager.java
├── entity
│ ├── Pension.java
│ ├── User.java
│ ├── Season.java
│ ├── Hotel.java
│ ├── Reservation.java
│ └── Room.java
├── view
│ ├── LoginView.java
│ ├── PensionView.java
│ ├── Layout.java
│ ├── HotelView.java
│ ├── SeasonView.java
│ ├── LoginView.form
│ ├── PensionView.form
│ ├── RoomView.java
│ ├── RoomUpdateView.java
│ ├── SeasonView.form
│ ├── ReservationUpdateView.java
│ ├── ReservationView.java
│ ├── AdminView.java
│ ├── HotelView.form
│ ├── RoomView.form
│ ├── RoomUpdateView.form
│ └── AdminView.form
└── dao
│ ├── SeasonDao.java
│ ├── PensionDao.java
│ ├── UserDao.java
│ ├── HotelDao.java
│ ├── ReservationDao.java
│ └── RoomDao.java
├── .gitignore
├── Tourism_Agency.iml
└── README.md
/.idea/.name:
--------------------------------------------------------------------------------
1 | Tourism_Agency
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/tourismagency.sql:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Keremyardan/Tourism_Agency_Java_Swing/HEAD/tourismagency.sql
--------------------------------------------------------------------------------
/postgresql-42.7.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Keremyardan/Tourism_Agency_Java_Swing/HEAD/postgresql-42.7.3.jar
--------------------------------------------------------------------------------
/src/App.java:
--------------------------------------------------------------------------------
1 | import core.Helper;
2 | import view.LoginView;
3 |
4 | public class App {
5 | public static void main(String[] args) {
6 |
7 | // Opens the window for login
8 | LoginView loginView = new LoginView();
9 | }
10 | }
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/libraries/postgresql_42_7_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### IntelliJ IDEA ###
2 | out/
3 | !**/src/main/**/out/
4 | !**/src/test/**/out/
5 |
6 | ### Eclipse ###
7 | .apt_generated
8 | .classpath
9 | .factorypath
10 | .project
11 | .settings
12 | .springBeans
13 | .sts4-cache
14 | bin/
15 | !**/src/main/**/bin/
16 | !**/src/test/**/bin/
17 |
18 | ### NetBeans ###
19 | /nbproject/private/
20 | /nbbuild/
21 | /dist/
22 | /nbdist/
23 | /.nb-gradle/
24 |
25 | ### VS Code ###
26 | .vscode/
27 |
28 | ### Mac OS ###
29 | .DS_Store
--------------------------------------------------------------------------------
/Tourism_Agency.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | A tourism agency system created with Java Swing and powered with PostgreSQL.
2 |
3 | You may create employee or admin accounts. Each account has different skills.
4 |
5 | Such as,
6 |
7 | Admins can create or delete two different account types, change roles and passcodes.
8 |
9 | On the employee side, you may add hotels, hotel stars, and different service features like "wi-fi" or "gym".
10 |
11 | An employee may create a reservation by entering season type, individual amount and price as currency amount.
12 |
13 | And of course editing or deleting for a reservation is possible as well.
14 |
15 | You may reach to the project video by clicking the link below;
16 |
17 | https://youtu.be/i96mvn4MCA4
18 |
--------------------------------------------------------------------------------
/src/core/ComboItem.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 |
4 |
5 | // logic of combo item is, this procedure is generally used in Java Swing for a visual interface.
6 | // with a list in combo box, we provide to the client multiple choices.
7 | // combo items are the values those located in combo box. this class, holds keys and values together for combo box.
8 | // so, we won't have to declare variables and key values for each item.
9 | public class ComboItem {
10 | private int key;
11 | private String value;
12 |
13 | // constructor with parameters
14 | public ComboItem(int key, String value) {
15 | this.key = key;
16 | this.value = value;
17 | }
18 |
19 | // default constructor
20 | public ComboItem(){
21 |
22 | }
23 |
24 | // getters and setters
25 | public int getKey() {
26 | return key;
27 | }
28 |
29 |
30 | public void setKey(int key) {
31 | this.key = key;
32 | }
33 |
34 |
35 | public String getValue() {
36 | return value;
37 | }
38 |
39 | public void setValue(String value) {
40 | this.value = value;
41 | }
42 |
43 |
44 | public String toString(){
45 | return this.value;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/core/Database.java:
--------------------------------------------------------------------------------
1 | package core;
2 |
3 | import java.sql.Connection;
4 | import java.sql.DriverManager;
5 | import java.sql.SQLException;
6 |
7 |
8 | public class Database {
9 | private static Database instance = null;
10 | private Connection connection = null;
11 |
12 | // url for database
13 | private final String DB_URL = "jdbc:postgresql://localhost:5432/tourismagency";
14 |
15 | //db user name
16 | private final String DB_USER = "postgres";
17 |
18 | //db user pass
19 | private final String DB_PASS = "Postgre";
20 |
21 | // method for establishing database connection
22 | private Database () {
23 | try {
24 | // to initialize the first value of connection, url, user and password are being hold.
25 | this.connection = DriverManager.getConnection(DB_URL,DB_USER,DB_PASS);
26 | } catch (SQLException e) {
27 | e.printStackTrace();
28 | }
29 | }
30 |
31 | // returning the connection
32 | public Connection getConnection() {
33 | return connection;
34 | }
35 |
36 | // instance of connection process
37 | public static Connection getInstance(){
38 | try {
39 | // checks if connection is null or closed
40 | if (instance == null || instance.getConnection().isClosed()) {
41 | // calls Database function
42 | instance = new Database();
43 | }
44 | } catch (SQLException e) {
45 | // throws and exception
46 | e.printStackTrace(); }
47 |
48 | // and returning the connection
49 | return instance.getConnection();
50 |
51 | }
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/src/business/SeasonManager.java:
--------------------------------------------------------------------------------
1 | package business;
2 |
3 | import core.Helper;
4 | import dao.SeasonDao;
5 | import entity.Season;
6 |
7 | import java.util.ArrayList;
8 |
9 |
10 | public class SeasonManager {
11 |
12 |
13 | SeasonDao seasonDao = new SeasonDao();
14 |
15 | // brings season with specific id
16 | public Season getById(int id){
17 | return this.seasonDao.getSeasonByID(id);
18 | }
19 |
20 | // brings the season with specific hotel id
21 | public ArrayList getSeasonsByOtelId(int id){return this.seasonDao.getSeasonsByOtelId(id);}
22 |
23 | // brings all seasons function
24 | public ArrayList findAll()
25 | {return this.seasonDao.findAll();}
26 |
27 | // the method that provides necessary information for table with generic data type as Object[] so, the array list may take
28 | // different type of objects
29 | public ArrayList