Part 2.docx

  • Uploaded by: Md mizanur Rahaman
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Part 2.docx as PDF for free.

More details

  • Words: 5,148
  • Pages: 42
CHAPTER 1 INTRODUCTION 1.1 OBJECTIVE The main objectives of this management system are 

Improve efficiency : - Jingle helps the restaurant manager to manage the restaurant more effectively and efficiently by computerizing meal ordering, billing and inventory.



Single authority : - After successful login the administrator can access a panel specifically designed to monitor the employees shift and their corresponding salary. And also Admin can decide the menu. Each menu item has a name, price and associated recipe which can be varied by admin consent so that restaurant owners can make changes in the system that other employees cannot.



Monitoring sales : - This restaurant management system will allow the Administrator to record the food items that is being purchase by the customer. Also, it is capable of viewing the item that is already being sold.



Automatic bill generation : - Based on the food item customer ordered, jingle will generate their corresponding bills and also indicate the taxes associated with it.

1.2 PURPOSE 

Paper based systems that record and communicate customer’s orders are a commonality within the restaurant industry. Technological penetration into restaurants is very slow in comparison with the other exuberance fields. Manual handling will lead to errors and prove ineffectual. To resolve such issues jingle is designed which will make the extant system efficacious.



Using accepted development methodologies and best practices from the software engineering industry, the project intends to produce a computerized restaurant management system, which solves issues concerned with existing practices, whilst developing new functions to address portend functionality. In addition, the restaurant management system will facilitate a decrease in operation costs of any restaurant business, without significant increase to fixed costs from purchase of the project or equipment.



1

1.3 SCOPE This project transverse a lot of areas ranging from business concepts to computing field and required to perform several researches to be able to achieve the project objectives. The area covers include: 

It has become a trendsetter, impeccably growing at a faster pace. Today, majority of the restaurants are making use of the Management application, that ensure its security to have a better and convenient way of monitoring their operation

 While restaurant management systems do improve efficiency and streamline operations, they do not mean the end of front-of-house or back-of-house staff. Hence it entails new functionality while working staff remain pristine. 

This application replaces the manual system and enhances the accuracy of work in a restaurant. It also helps administrator to keep a keen eye on restaurant operations and allow him to make changes as per the requirement. Hence the project is developed proficiently to help restaurant owners to automate their business operations.

2

CHAPTER 2 REQUIREMENT 2.1 HARDWARE REQUIREMENT:2.1.1 Server Side:

 Hardware recommended by all the software needed.



 Processor

: Pentium-IV Intel 80486

 Ram

: 512 Ram or above

 HDD

: 20 GB or above

Communication hardware to serve client requests.

2.1.2 Client Side: 

Hardware recommended by respective client’s operating system and web browser.



Communication hardware to communicate the server.

2.2 SOFTWARE REQUIREMENT: Software side hardware.  Web server software, Apache.  Database tools: My SQL.  Compatible operating system: Linux, Windows.  Client side software.  Web browser supporting Java script, refer Browser Compatibility2.3.1.

3

CHAPTER 3 TECHNICAL DESCRIPTION 3.1 JAVA SE:The entire component has been developed using Java technology. Java has been chosen as the platform because of its feature rich nature. The Java Platform provides robust end-to-end solutions for networked applications as well as a trusted standard for embedded applications. So Java was a natural choice for development process. Following are some Characteristics of Java Of Java: 3.1.1 Object Oriented: Java is object oriented to the truest sense of the word. Everything in Java is represented as objects. Variables and methods both are encapsulated in objects. Java is the purest objectoriented language. 3.2.1.1 Robust:    

Java is a very robust language owing to the following features. Excellent exception handling facilities. Memory management relief for the user. Strict compile-time and runtime checks for data types.

3.2.1.2 Portable and Architecture-neutral (Platform Independent): Java is portable and platform independent so much that they satisfy “write once; run anywhere, anytime, forever”. This feature is implemented in the following ways: 

Compiler generates machine independent byte-code instructions which can be run on any machine supporting Java Virtual Machine.  Size of primitive data type is machine independent. 3.2.1.3 Multithreaded:   

Programs can do many things simultaneously using different threads. Provides a solution for multiprocessor synchronization. Allows the creation of networked and interactive programs.

3.2.1.4 Distributed:  

Open access to remote objects by the use of RMI (Remote Method Invocation). Brings a level of abstraction to client/server programming.

4

3.2.1.5 Secure: 

Security is achieved by confining a java program to the java execution environment and not allowing access to other parts of the user computer.  Absence of pointers provides memory related security as encroachment of memory is avoided Proper measures for prevention of viral infection and malicious intent. 3.2.1.6 Dynamic and Extensible:  Facilitates linking in of new classes, objects and methods.  Supports native methods (methods written in other languages like C, C++).  Programs carry with them a substantial amount of runtime type information

that is used

to verify and resolve accesses to objects at run-time. 3.2.1.7 High Performance: Just-In-Time (JIT) compilers are used to convert byte-code into native machine code resulting in very high performance. These JIT compilers can be used on a real time, piece by piece demand basis to perform on-the-fly compilation of byte-code into native-code. 3.2.2 JAVA SWINGS "Swing" refers to the new library of GUI controls (buttons, sliders, checkboxes, etc.) that replaces the somewhat weak and inflexible AWT controls. The Swing classes eliminate Java's biggest weakness: its relatively primitive user interface toolkit. Java Swing helps you to take full advantage of the Swing classes, providing detailed descriptions of every class and interface in the key Swing packages. It shows you how to use all of the new components, allowing you to build state-of-the-art user interfaces and giving you the context you need to understand what you're doing. It's more than documentation; Java Swing helps you develop code quickly and effectively. 3.2.2.1. Main New Features  

Lightweight. Not built on native window-system windows. Much bigger set of built-in controls. Trees, image buttons, tabbed panes, sliders, toolbars, color choosers, tables, text areas to display HTML or RTF, etc.  Much more customizable. Can change border, text alignment, or add image to almost any control.  "Pluggable" look and feel. Can change look and feel at runtime, or design own look and feel.  Many miscellaneous new features. Double-buffering built in, tool tips, dock able tool bars, keyboard accelerators, custom cursors, etc.

5

3.2.3 JDBC The JDBC is a set of the database access classes. The very term JDBC stands for “Java Database Connectivity”. It was developed by Java Soft. JDBC technology is an API (Application Program Interface) that allows virtual access to any tabular data source from the Java programming language by means of some connecting software called Drivers. It provides cross-DBMS connectivity to a wide range of SQL databases. JDBC defines a set of interfaces to enable developers to access data independently of the actual database product used to store the data. JDBC allow Java applets, Servlets, and application to access data in famous database management systems. The JDBC API is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases. The JDBC API makes it possible to do three things:  Establish a connection  Send SQL statements  Process the results

with a database or access any tabular data source

3.2.3.1 Steps in using JDBC      

Create a Connection type of object (A) denoting a connection to the database. Create a Statement type of object (B) using the A. Use B to execute either update the database or send a query request. The result of the query operation in step 3 is a Result Set type of object(C) C is actually a small table (D) consisting of the result of the query. D can be handled according to the user needs.

Fig.3.1 Steps in JDBC

6

06 3.2.3.3. JDBC ARCHITECTURE The JDBC API contains two major sets of interfaces:  

JDBC API for application writers Lower-level JDBC driver API for driver writers

JDBC drivers are divided into four types or levels. Each type defines a JDBC driver implementation with increasingly higher levels of platform independence, performance, and deployment administration. The four types are: Type 1: JDBC-ODBC BridgeType 2: Native-API/partly Java driveType 3: Net-protocol/all-Java driverType 4: Native-protocol/all-Java driver Type1:JDBC-ODBCBridge The type 1 driver, JDBC-ODBC Bridge, translates all JDBC calls into ODBC (Open Database Connectivity) calls and sends them to the ODBC driver. As such, the ODBC driver, as well as, in many cases, the client database code, must be present on the client machine. Figure 1 shows a typical JDBC-ODBC Bridge environment.

JAVA APPLICATION JDBC DRIVER MANAGER JDBC/ODBC BRIDGE ODBC DRIVER DATABASE Type 1: JDBC-ODBC Bridge Fig.3.2 type1:jdbc-odbc bridge Pros: The JDBC-ODBC Bridge allows access to almost any database, since the database's ODBC drivers are already available. Type 1 drivers may be useful for those companies that have an ODBC driver already installed on client machines.

7

3.2 SQL :SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in a relational database. SQL is the standard language for Relational Database System. All the Relational Database Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as their standard database language. Also, they are using different dialects, such as − 

MS SQL Server using T-SQL,



Oracle using PL/SQL,



MS Access version of SQL is called JET SQL (native format) etc.

3.2.1 A Brief History of SQL 

1970 − Dr. Edgar F. "Ted" Codd of IBM is known as the father of relational databases. He described a relational model for databases.



1974 − Structured Query Language appeared.



1978 − IBM worked to develop Codd's ideas and released a product named System/R.



1986 − IBM developed the first prototype of relational database and standardized by ANSI. The first relational database was released by Relational Software which later came to be known as Oracle.

3.2.2 Application Of SQL SQL is widely popular because it offers the following advantages − 

Allows users to access data in the relational database management systems.



Allows users to describe the data.



Allows users to define the data in a database and manipulate that data.



Allows to embed within other languages using SQL modules, libraries & pre-compilers.



Allows users to create view, stored procedure, functions in a database.

8

3.2.3 SQL Process When you are executing an SQL command for any RDBMS, the system determines the best way to carry out your request and SQL engine figures out how to interpret the task. There are various components included in this process. These components are − 

Query Dispatcher



Optimization Engines



Classic Query Engine



SQL Query Engine, etc.

A classic query engine handles all the non-SQL queries, but a SQL query engine won't handle logical files. Following is a simple diagram showing the SQL Architecture −

Fig 3.3 :- Architecture of SQL

9

3.2.4 SQL Commands The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP. These commands can be classified into the following groups based on their nature − DDL - Data Definition Language Sr.No.

1

Command & Description

CREATE Creates a new table, a view of a table, or other object in the database.

2

ALTER Modifies an existing database object, such as a table.

3

DROP Deletes an entire table, a view of a table or other objects in the database. Table 3.1

DML - Data Manipulation Language Sr.No.

1

Command & Description

SELECT Retrieves certain records from one or more tables.

2

INSERT Creates a record.

3

UPDATE Modifies records. Table 3.2

10

DCL - Data Control Language Sr.No.

1

Command & Description

GRANT Gives a privilege to user.

REVOKE 2 Takes back privileges granted from user.

Table 3.3

11

CHAPTER 4 PROJECT DESCRIPTION 4.1 Slide Description The main goal of this project is to develop functional restaurant management system. These system will consist the following frames: 4.1.1 SplashScreenFrame A Splash Screen is the first screen displayed by the app and contains app title . It stays open for some duration and then disappears giving way to the next screen. 4.1.2 LoginFrame. It provide login facility to administrator and cashier to access their account. 4.1.3 AdminOptionsFrame It span a variety of operations that an administrator have authority to perform. By clicking on that operation, login frame will digress to new frame. 4.1.4 CashierOptionsFrame It entails the operation that a cashier can perform which includes take order, view transaction and bill generation. 4.1.5 AddCategoryFrame This frame is used to add a new category of food and admin has the authority to access this panel. 4.1.6 AddEmpFrame Admin use these panel to supplement a new employee in the restaurant. 4.1.7 AddProductFrame As soon as the frame loads it fills the Category Names in the JComboBox by pulling them from the DB and generates a specific product id for the new product 4.1.8 ViewProductFrame Detect which option user has selected amongst View Single Product and View All Products and open the respective Frame. 4.1.9 ViewAllProductsFrame It. handle the constructor so that it loads complete details of all the products DBMS 12

4.1.10 EditCategoryFrame This frame provides the way to make changes in extant category. 4.1.11 EditEmpFrame This frame enables the admin to make changes in the credentials of his employee weather to alter his shift or to gave him promotion or demotion. 4.1.12 EditProductFrame As the name suggests, through this frame admin can change the product name, its quantity and price associated with it. 4.1.13 RegisterCashierFrame When admin wants to promote extant employee to cashier. Admin will use these panel to move his credential from employee database to cashier database. 4.1.14 ViewMenuFrame This frame entails the list of recipe restaurant provides at that time and their price has also being mentioned adjacently. 4.1.15 ViewTransactionsFrame This frame provides the details of all transaction that has been done within a particular span of time.

4.2 FEATURES OF THE PROJECT 

ADMIN Account: The project has admin login that controls all the online activities in the system. Admin can check and verify various member details. 

Cost tracking, such as labor costs and food costs



Labor management, including shift scheduling and clocking in and out.



Inventory

management,

including

purchase

orders,

vendor

relations

management, ingredient tracking, and low-ingredient notifications. 

Cross-establishment communication, including front of house to back of house and vice versa



CASHIER Account: cashier have to first create an account into the system by registering themselves. Then he/she can login into the system to avail the following authority.

13



Transaction system that accepts payments, works with integrated credit card processors, and provides receipts.



Monitor Payment, product, and activity reports.



Menu customization.



Commerce platform for the selling and tracking of items such as merchandise .



Access real-time product, sales and employee performance reports, from anywhere on any device.



Set different authorization levels for staff to control discount levels, refunds, or void sales.

4.3 Description of Used Model Development Methodology Often a customer defines a set of general objectives for software but does not identify detailed input , processing or output requirement . in other cases the developer may be unsure of the efficiency of an algorithm . The adaptability of an operating system or the form that human/machine interaction should take. In these and many other situations, a prototyping paradigm may offer the best approach

Fig 4.1 Prototyping Model A prototype paradigm begins with the requirement gathering . developer and customer meets define the overall objectives for the software , identifying whatever requirements are known and out lines areas where further definition is mandatory . a “quick design” then occur. The quick design focuses on representation of those aspects of the software that will be visible to the customer. The quick design leads to the construction of the prototype . the prototype is evaluated by the customer/user and used to requirement for the software to be developer. Reaction occur as

14

the prototype is turned to satisfy needs of customer . while at the same time enabling at the developer to better understand what needs to be done.

4.4 Project Analysis 







Product : a general statement of the product give a brief description of what the proposed system will do., highlighting where the proposed meets the specified business requirements of the organization . Technical Feasibility: will the proposed system performed to be required specification? Outline technical option you propose to use which will give a technical solution satisfying the requirements and constraints of the system ,as outlined in the term of reference Social Feasibility: consideration of whether the proposed system would proof acceptable to the people who would affected by its introduction describe the affect on user from the introduction on the new system. Consider wheather the needs for retraiying the workface . will there will be need for relocation of some of the work face ? will some jobs become deskilled?. Economic Feasibility: consider the cost of the proposed system. Detail the cost that will be incurred by the organisation adopting the new system; consider development costs and running costs. Details benefits that the new system will bring, direct economic benefits such as reduced cost and indirect benefits such as improved management information and better customer service. Illustrate the cost of the new system by applying a suitable cost/benefit analysis method such as the payback method.

4.5 Data Modeling Entity Relationship Diagram

Fig 4.2 E-R Diagram 15

4.6 Database Tables User Table Column Name

Data Type

Description

USERID

Varchar2(15)

Contains Login Id Of Ihe Employee

USERNAME

Varchar2(20)

Contains The Employee Name

EMPID

Varchar2(15)

Contains Id Of The Employee .This col Is Also The Foreign Key

PASSWORD

Number(6)

Contains Password

Table 4.1 Employee Table

Column Name

Data Type

Description

EMPID

Varchar2(10)

Contains Id Of Ihe Employee

ENAME

Varchar2(30)

Contains The Employee Name

JOB

Varchar2(15)

Contains Job Title

SAL

Number(6)

Contains Salary Of The Employee

Table 4.2

16

Category Table Column Name

Data Type

Description

CAT_ID

Varchar2(10)

Contains Id Of The Category

CAT_NAME

Varchar2(15)

Contains The Category Name

Column Name

Data Type

Description

PROD_ID

Varchar2(10)

Contains Id Of The Product

CAT_ID

Varchar2(10)

Contains The Cat Id To Which This Product Belongs . It Is Also The Foreign Key

PROD_NAME

Varchar2(20)

Contains The Name Of The Product

PROD_PRICE

Number(5)

Contains Price Of The Product

ACTIVE

Char(1)

Contains "Y" or "N" Table 4.4

17

CHAPTER 5 CODING & SNAPSHOT 5.1 CODING DBUtil import java.sql.Connection; import java.sql.DriverManager; import javax.swing.JOptionPane; /** * * @author Jonty */ public class DBConnection { private static Connection conn; static{ try { Class.forName("oracle.jdbc.OracleDriver"); conn=DriverManager.getConnection("jdbc:oracle:thin:@//AFTAB:1521/XE","planetfood","stud ents"); JOptionPane.showMessageDialog(null, "Connected Successfully To The Database","Success!",JOptionPane.INFORMATION_MESSAGE); } catch(Exception ex){ JOptionPane.showMessageDialog(null, "Error Connecting To The Database:"+ex,"Error!",JOptionPane.ERROR_MESSAGE); System.out.println("Exception is:"+ex); } } public static Connection getConnection(){ return conn; } public static void closeConnection() { }

18

SplashScreenFrame package Jingle.gui; import java.util.Random; import javax.swing.JOptionPane; public class SplashScreenFrame extends javax.swing.JFrame { SplashThread sp; public SplashScreenFrame() { initComponents(); super.setLocationRelativeTo(null); jProgressBar1.setStringPainted(true); sp=new SplashThread(); sp.start(); } class SplashThread extends Thread { public void run() { int count=1; Random r=new Random(); while(jProgressBar1.getValue()<jProgressBar1.getMaximum()){ try{ jProgressBar1.setValue(count); Thread.sleep(1200); count=count+r.nextInt(100); } catch(InterruptedException ex) { JOptionPane.showMessageDialog(null,"Exception in Thread"+ ex,"Error!",JOptionPane.ERROR_MESSAGE); ex.printStackTrace(); } } SplashScreenFrame.this.dispose(); LoginFrame loginFrame=new LoginFrame(); loginFrame.setVisible(true); } } @SuppressWarnings("unchecked") 19

// <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jProgressBar1 = new javax.swing.JProgressBar(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(0, 102, 102)); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/planetfood/Icon/SplashScreenImg.jpg"))); // NOI18N jLabel2.setBackground(new java.awt.Color(0, 102, 102)); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("HOTEL PLANET FOOD"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 550, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(124, 124, 124) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); 20

jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); pack(); }// public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SplashScreenFrame().setVisible(true); } }); } // Variables declaration - do not modify 21

private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; private javax.swing.JProgressBar jProgressBar1; // End of variables declaration }

LoginFrame package Jingle.gui; import java.sql.SQLException; import javax.swing.JOptionPane; import planetfood.dao.UserDao; import planetfood.dbutil.DBConnection; import planetfood.pojo.User; import planetfood.pojo.UserProfile; public class LoginFrame extends javax.swing.JFrame { String userId=""; String password=""; public LoginFrame() { initComponents(); this.setLocationRelativeTo(null); } private boolean validateInput(){ userId=txtUserId.getText(); char[] pwd=txtPassword.getPassword(); if(userId.isEmpty()|| pwd.length==0) return false; else { password=String.valueOf(pwd); return true; } } private String getUserType(){ if(jrAdmin.isSelected()) return jrAdmin.getText().toUpperCase(); else if(jrCashier.isSelected()) return jrCashier.getText().toUpperCase(); else 22

return null; } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); txtUserId = new javax.swing.JTextField(); txtPassword = new javax.swing.JPasswordField(); btnLogin = new javax.swing.JButton(); btnQuit = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jrAdmin = new javax.swing.JRadioButton(); jrCashier = new javax.swing.JRadioButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(0, 102, 102)); jPanel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setBackground(new java.awt.Color(0, 102, 102)); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("USER LOGIN SCREEN"); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/planetfood/Icon/LoginPage.png"))); // NOI18N jPanel2.setBackground(new java.awt.Color(0, 102, 102)); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Login details", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.ABOVE_TOP, new java.awt.Font("Tahoma", 1, 14), new java.awt.Color(255, 255, 255))); // NOI18N jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel3.setText("User ID"); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N 23

jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel4.setText("Password"); btnLogin.setBackground(new java.awt.Color(0, 102, 102)); btnLogin.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnLogin.setForeground(new java.awt.Color(255, 255, 255)); btnLogin.setText("Login"); btnLogin.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLoginActionPerformed(evt); } }); btnQuit.setBackground(new java.awt.Color(0, 102, 102)); btnQuit.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnQuit.setForeground(new java.awt.Color(255, 255, 255)); btnQuit.setText("Quit"); btnQuit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnQuitActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(25, 25, 25) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(btnLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(btnQuit, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup()

24

.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtUserId, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE) .addComponent(txtPassword)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(37, 37, 37) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELIN E) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtUserId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(30, 30, 30) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELIN E) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)

25

.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELIN E) .addComponent(btnLogin) .addComponent(btnQuit)) .addGap(20, 20, 20)) ); jPanel3.setBackground(new java.awt.Color(0, 102, 102)); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "User Type", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.ABOVE_TOP, new java.awt.Font("Tahoma", 1, 14), new java.awt.Color(255, 255, 255))); // NOI18N jPanel3.setForeground(new java.awt.Color(255, 255, 255)); jrAdmin.setBackground(new java.awt.Color(0, 102, 102)); buttonGroup1.add(jrAdmin); jrAdmin.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jrAdmin.setForeground(new java.awt.Color(255, 255, 255)); jrAdmin.setText("Admin"); jrCashier.setBackground(new java.awt.Color(0, 102, 102)); buttonGroup1.add(jrCashier); jrCashier.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jrCashier.setForeground(new java.awt.Color(255, 255, 255)); jrCashier.setText("Cashier"); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(23, 23, 23) .addComponent(jrAdmin) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE) .addComponent(jrCashier) .addGap(29, 29, 29)) ); jPanel3Layout.setVerticalGroup( 26

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(22, 22, 22) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELIN E) .addComponent(jrAdmin) .addComponent(jrCashier)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(149, 149, 149) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(19, 19, 19) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(70, 70, 70)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 27

.addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(18, 18, 18) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(34, 34, 34) .addComponent(jLabel2))) .addContainerGap(44, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 11, Short.MAX_VALUE)) ); pack(); }// private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) { boolean isValidInput=validateInput();

28

if(isValidInput==false){ JOptionPane.showMessageDialog(null,"UserId or Password cannot be left empty!","Error",JOptionPane.ERROR_MESSAGE); return; } String userType=getUserType(); if(userType==null){ JOptionPane.showMessageDialog(null,"Please Choose User type","Error",JOptionPane.ERROR_MESSAGE); return; } try{ User user=new User(); user.setUserid(userId); user.setPassword(password); user.setUserType(userType); String username=UserDao.validateUser(user); if(username!= null){ JOptionPane.showMessageDialog(null,"Login Accepted","Welcome"+username,JOptionPane.INFORMATION_MESSAGE); UserProfile.setUsername(username); UserProfile.setUserType(userType); UserProfile.setUserId(userId); if(userType.equalsIgnoreCase("admin")){ AdminOptionsFrame adminOptionsFrame = new AdminOptionsFrame(); adminOptionsFrame.setVisible(true); } else { CashierOptionsFrame cashieroptions = new CashierOptionsFrame(); cashieroptions.setVisible(true); } this.dispose(); } else JOptionPane.showMessageDialog(null,"Invalid UserId/Password","Login Denied",JOptionPane.ERROR_MESSAGE); 29

} catch(Exception ex){ JOptionPane.showMessageDialog(null,"DBError:"+ex,"Exception",JOptionPane.ERROR_MES SAGE); ex.printStackTrace(); } } private void btnQuitActionPerformed(java.awt.event.ActionEvent evt) { int ans; ans=JOptionPane.showConfirmDialog(null,"Are You Sure?","Quitting!",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE); if (ans==JOptionPane.YES_OPTION){ DBConnection.closeConnection(); System.exit(0); } } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new LoginFrame().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton btnLogin; private javax.swing.JButton btnQuit; private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; 30

private javax.swing.JRadioButton jrAdmin; private javax.swing.JRadioButton jrCashier; private javax.swing.JPasswordField txtPassword; private javax.swing.JTextField txtUserId; // End of variables declaration } AdminOptionsFrame import java.awt.Color; import javax.swing.JOptionPane; import planetfood.pojo.UserProfile;

public class AdminOptionsFrame extends javax.swing.JFrame {

public AdminOptionsFrame() { initComponents(); this.setLocationRelativeTo(null); lbAdmin.setText("Hello " + s1); } String s1= UserProfile.getUsername();

@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); jrAddEmp = new javax.swing.JRadioButton(); jrViewEmp = new javax.swing.JRadioButton(); jrEditEmp = new javax.swing.JRadioButton(); jrRemoveEmp = new javax.swing.JRadioButton(); jPanel6 = new javax.swing.JPanel(); jrRegisterCashier = new javax.swing.JRadioButton(); jrRemoveCashier = new javax.swing.JRadioButton(); 31

jPanel7 = new javax.swing.JPanel(); jrViewOrder = new javax.swing.JRadioButton(); jrViewDatewise = new javax.swing.JRadioButton(); jPanel8 = new javax.swing.JPanel(); jrAddCategory = new javax.swing.JRadioButton(); jrEditCategory = new javax.swing.JRadioButton(); jrViewCategory = new javax.swing.JRadioButton(); jPanel9 = new javax.swing.JPanel(); jrAddProduct = new javax.swing.JRadioButton(); jrViewProduct = new javax.swing.JRadioButton(); jrEditProduct = new javax.swing.JRadioButton(); jrRemoveProduct = new javax.swing.JRadioButton(); btnQuit = new javax.swing.JButton(); btnDoTask = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); lbAdmin = new javax.swing.JLabel(); lblLogout = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(0, 102, 102)); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/planetfood/Icon/AdminOptions.png"))); // NOI18N jLabel2.setBackground(new java.awt.Color(0, 102, 102)); jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("PLANET FOOD ADMIN PANEL"); jLabel3.setBackground(new java.awt.Color(0, 102, 102)); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Make A Choice"); jPanel5.setBackground(new java.awt.Color(0, 102, 102)); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Emp Options", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,

32

javax.swing.border.TitledBorder.ABOVE_TOP, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(255, 255, 255))); // NOI18N jPanel5.setForeground(new java.awt.Color(255, 255, 255)); jrAddEmp.setBackground(new java.awt.Color(0, 102, 102)); buttonGroup1.add(jrAddEmp); jrAddEmp.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jrAddEmp.setForeground(new java.awt.Color(255, 255, 255)); jrAddEmp.setText("Add Emp"); jrViewEmp.setBackground(new java.awt.Color(0, 102, 102)); buttonGroup1.add(jrViewEmp); jrViewEmp.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jrViewEmp.setForeground(new java.awt.Color(255, 255, 255)); jrViewEmp.setText("View Emp"); jrEditEmp.setBackground(new java.awt.Color(0, 102, 102)); buttonGroup1.add(jrEditEmp); jrEditEmp.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jrEditEmp.setForeground(new java.awt.Color(255, 255, 255)); jrEditEmp.setText("Edit Emp"); jrEditEmp.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrEditEmpActionPerformed(evt); } }); jrRemoveEmp.setBackground(new java.awt.Color(0, 102, 102)); buttonGroup1.add(jrRemoveEmp); jrRemoveEmp.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jrRemoveEmp.setForeground(new java.awt.Color(255, 255, 255)); jrRemoveEmp.setText("Remove Emp"); jrRemoveEmp.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jrRemoveEmpActionPerformed(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); }} . 33

5.2 SNAPSHOT Splash Screen

Fig 5.1

Login Screen

Fig 5.2

34

Admin Screen

Fig 5.3

Cashier Screen

Fig 5.4

35

Add Product Screen

Fig 5.5 Edit Product Screen

Fig 5.6

36

Add Category Screen

Fig 5.7

All Category Details Screen

Fig 5.8 37

Add Employee Screen

Fig 5.9

Register Cashier Screen

Fig 5.10 38

CHAPTER 6 TESTING 6.1 TESTING PROCESS

Fig 6.1 The diagram above outlines the process approach that will be followed .  

  



Organize Project involve creating a system test plan schedule and test approach and assigning responsibility . Design /Build System Test involves identifying test cycles . test cases entrances and exit criteria , expected results ,etc . in general , test condition /expected result will be identifying by the team in the conjunction with the development team . the team will then identify test cases and the data required . the test condition are derived from the program specification document . Design/Build Test Procedure include setting up procedure such as error management system and status reporting. Build Test Environment includes requesting/ building hardware software and data setups . Execute System Tests – the test identify in the design/ build test procedure will be executed . all results will be documented and bug report forms filled out and given to the development team as necessary. F.signoff - signoff happens when all pre-defined exit criteria have been achieved.

39

6.2 Decision table based testing Test case login Condition

Email ID

C1 C2 C3 C4 C5 C6 C7 C8 C9

Y Y Y Y Y ---------

Password

Cashier

Y Y Y --Y ----Y ----Y Y Y ----Y ----Table 6.1 Test case login

Admin (IsSelected) --Y ----Y --Y --Y

Result (Action) Correct Correct Incorrect Incorrect Incorrect Incorrect Incorrect Incorrect Incorrect

40

CHAPTER 7 CONCLUSION 7.1 CONCLUSION     

The project entitled ”JINGLE” has been proposed to be implementing to replace the manual system The developed system accomplishes all the objectives stated for the need for the change of the system The output produced seem to satisfy all the users but it will be definitely take to look forwarded for the real consequences the new system could produce This project was made user friendly by the use of visual basic enabling the user to interact easily with the database It also enables the platform to serve the needs of emerging information technology trends and needs

7.2 FUTURE WORK   

System on Smartphone : our next goal is to optimize for display on smartphones and tablets so that admin or cashier can perform the operations conveniently Allow to save customer payment details in a secure vault for future use Secure Credit Card Processing & Storing: with industry standard encryption, customer can rest assured that their payment will always remain secure with our SSL connections.

41

References Java References   

Gosling, James; Joy, Bill; Steele, Guy; Bracha, Gilad; Buckley, Alex (2014). The Java® Language Specification (PDF) (Java SE 8 ed.). Gosling, James; Joy, Bill; Steele, Guy L., Jr.; Bracha, Gilad (2005). The Java Language Specification (3rd ed.). Addison-Wesley. ISBN 0-321-24678-0. Lindholm, Tim; Yellin, Frank (1999). The Java Virtual Machine Specification (2nd ed.). Addison-Wesley. ISBN 0-201-43294-3.

SQL References        

"Media Type registration for application/sql". Internet Assigned Numbers Authority. 10 April 2013. Retrieved 10 April 2013. Jump up^ "The application/sql Media Type, RFC 6922". Internet Engineering Task Force. April 2013. p. 3. Retrieved 10 April 2013. Jump up^ Paul, Ryan. "A guided tour of the Microsoft Command Shell". Ars Technica. Retrieved 10 April 2011. Jump up^ Beaulieu, Alan (April 2009). Mary E Treseler, ed. Learning SQL (2nd ed.). Sebastapol, CA, USA: O'Reilly. ISBN 978-0-596-52083-0. Jump up^ "SQL". Britannica.com. Retrieved 2013-04-02. Jump up^ "SQL". Oxforddictionaries.com. Retrieved 2017-01-16. Jump up^ "SQL Guide". Publib.boulder.ibm.com. Retrieved 2017-01-16. Jump up^ "Structured Query Language (SQL)". Msdn.microsoft.com. Retrieved 2017-0116.

42

Related Documents

Part
May 2020 14
Students Part Part 4
May 2020 31
Part 1
December 2019 18
Second Part
December 2019 10

More Documents from "hosein"

Part 2.docx
November 2019 6
November 2019 4
Jingle Part 1.docx
November 2019 10
70 Dated 25.05.18.pdf
November 2019 13