GithubHelp home page GithubHelp logo

cbozan / employer-worker-registration-system Goto Github PK

View Code? Open in Web Editor NEW
55.0 1.0 58.0 327 KB

An accounting program that contains employee and employer information and records of relationships between them.

License: MIT License

Java 100.00%
java gui-application accounting search-box java-database-application java-swing-applications java-gui-application java-login-page login-system java-swing-project java-swing-application postgresql java-project java-projects

employer-worker-registration-system's Introduction

employer-worker-registration-system

An accounting program that contains employee and employer information and records of relationships between them.


v1 branch

Screenshot

Login

Homepage Employer registration Worker registration
2-home_page 3-new_employer 3-new_worker
Search Box Registration document
5-view_worker 7-new_record_optionpane

Requirements

Postgresql is used in this program. You can find the necessary jar file for postgresql java connection here:

https://jdbc.postgresql.org/download.html

Or you can use a different database but for this to work, change:

DriverManager.getConnection("jdbc:database://host:port/database-name", "user-name", "password");

for postgresql:

DriverManager.getConnection("jdbc:postgresql://localhost:5432/db", "postgres", "password");

And finally, in order not to get a database error, you should add the following tables to the database:

CREATE TABLE admin(id smallserial primary key not null, username varchar, password varchar);
CREATE TABLE employer(employer_id serial primary key not null, name varchar not null, surname varchar not null, business varchar, phonenumber varchar);
CREATE TABLE worker(worker_id serial primary key not null, name varchar not null, surname varchar not null, phone_number varchar);
CREATE TABLE worker_record(worker_record_id serial primary key not null, worker_id integer references worker(worker_id), employer_id integer references employer(employer_id), date varchar(10) not null, wage smallint not null);
CREATE TABLE employer_record(employer_record_id serial primary key not null, employer_id integer references employer(employer_id), date varchar(10) not null, note varchar(255), number_worker smallint not null, wage smallint not null);
CREATE TABLE worker_payment(worker_payment_id serial primary key not null, worker_id integer references worker(worker_id), employer_id integer references employer(employer_id), date varchar(10) not null, paid integer not null);
CREATE TABLE employer_payment(employer_payment_id serial primary key not null, employer_id integer references employer(employer_id), date varchar(10) not null, paid integer not null);
CREATE TABLE worker_payment(worker_payment_id serial primary key not null, worker_id integer references worker(worker_id), employer_id integer references employer(employer_id), date varchar(10), not null, paid integer not null);

employer-worker-registration-system's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

employer-worker-registration-system's Issues

Rediseño en DataBase.java

Buenas noches, se sugiere rediseñar, implementando el patrón de diseño Singleton, esta clase dividiéndola en 2 clases, una que se encargue de tener la instancia de la base de datos, y otra que tenga todos los métodos para la manipulación de este. Por una parte, gracias a este rediseño, separamos las responsabilidades que antes tenía DataBase.java, además tenemos un acceso controlado a una instancia única de la base de datos.
Singleton

Reporte malos olores 2

En la clase Login.java existe un método GUI() y Login() el cual tiene el code smell long method ya que son bastante grandes. Se puede solucionar dividiendo en métodos más pequeños y fáciles de entender aplicando Extract Method. Beneficio: se hace más fácil entender y mantener el código al dividirlo en métodos más pequeños y focales.
image
image

Reporte malos olores 3

Dentro de la clase MyScrollPane.java, está presente el Duplicate code, la lógica de crear los botones de scroll se repite dos veces, una para el botón de decremento y otra para el botón de incremento. Esto puede ser refactorizado con Extract method utilizando un método privado que retorne el botón con las propiedades deseadas. Al eliminar la repetición de código, se vuelve más fácil mantener y modificar el código en el futuro, ya que solo se necesita modificar el método privado en lugar de hacerlo en dos lugares diferentes. Aquí se muestra refactorizado:
image

Reporte malos olores 1

Dentro de la clase AdminPanel.java en el método “actionPerformed(ActionEvent e)”, existe un code smell “Long Method” debido a que el método contiene varias líneas de código. Se puede solucionar esto aplicando Extract Method, Simpliflying Conditional Expression y Consolidate Duplicate Conditional Fragments. El beneficio de realizar con estas técnicas de refactorizaciones es que ahora es fácil de entender, cada método es responsable de realizar una acción y estos llaman a otros métodos.
image
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.