Escolar Documentos
Profissional Documentos
Cultura Documentos
BY
BY
(2031100001)
AUGUST, 2015
ii
DECLARATION
This project is my original work and has not been presented for a degree in any other
University. No part of this project may be reproduced without the prior written
permission of the author and/or Federal University Lafia.
Date:_____________________
iii
APPROVAL
This is to certify that ABDUL-AZEEZ, ADAMU BADARA; MAT NO: 2031100001
undertook this research work ONLINE CAR SALES MANAGEMENT SYSTEM and
meets the requirements for submission to the Department of Computer science, Federal
University Lafia, in partial fulfilment for the award of Bachelor of science (B.Sc.)
Computer Science Degree 2015.
..
Mr Ofem, Paulinus
(Project Supervisor)
.
Date
.
Professor S. B. Junaidu
(External Examiner)
Date
Date
iv
DEDICATION
This project is dedicated to the memory of my late father, Mal. Abdul-Azeez Rabiu
Badara. Indeed he was a good father and to my humble Uncle Mal. Ishaka Ahmad
Galadima, who is the bone and marrow of my education right from primary level up to
the University level.
And to my lovely sister Amina Abdul-Azeez, my beloved mother and the entire
family for their moral and financial support throughout my stay in the University.
ABSTRACT
With the intention of upgrading the current manual system to a web-based system, the
work reported in this project has been proposed to aid effective and efficient management
of vehicle sales. The proposed system is for Sansani Motors (Our real case study). The
new system manages and keeps track of stock and sales of vehicles for effective customer
service delivery and profit maximization. The current management of vehicle stock and
sales at the company is handled manually. The business process relies heavily on paperwork for manual information processing. There is no well-organized system to manage
stock levels and sales. The current manual system was therefore found not suitable for
continuous usage as it does not meet the current needs of the fast-growing company. The
initiative to create a new system that is web-based will help the company to boost
customer service delivery and profit. Business information can be stored and managed
efficiently and in a more organized manner. The new system was developed following the
Analysis and Design Method (SSADM) which structures a project into small, welldefined activities and specifies the sequence and interaction of these activities. This
method enables the user of the system and the developer to better comprehend the
problem and the proposed solution. This new system, if deployed, will enable Sansani
Motors to better manage its business operations.
vi
Table of Contents
TITLE PAGE.i
DECLARATION .............................................................................................................. ii
APPROVAL .................................................................................................................... iii
DEDICATION ................................................................................................................. iv
ABSTRACT...................................................................................................................... v
ACKNOWLEDGEMENT ............................................................................................... ix
CHAPTER ONE: INTRODUCTION ............................................................................... 1
1.1
1.2
1.3
1.4
1.5
1.6
2.2
2.3
2.4
2.4.1
2.4.2
2.4.3
2.4.4
2.5
Introduction ...................................................................................................... 15
3.1.1
Waterfall Model............................................................................................ 15
3.2
3.3
3.4
3.4.1
vii
3.4.2
3.4.3
3.5
3.6
3.7
3.8
3.9
3.9.1
3.9.2
3.9.3
3.9.4
Implementation ................................................................................................ 33
4.2
Results: ............................................................................................................. 33
4.3
Findings ............................................................................................................ 33
Summary .......................................................................................................... 34
5.2
Conclusion........................................................................................................ 35
5.3
Recommendation.............................................................................................. 35
REFERENCES ............................................................................................................... 36
APPENDIX A: User Interface ........................................................................................ 38
APPENDIX B: Source Code .......................................................................................... 44
viii
List of Figures
Fig 3.0-Program Flowchart for Car Sales Management System.24
Fig 3.1-Usecase diagram for a Car Sales Management System..26
Fig 3.2-Entity Relationship diagram for a Car Sales Management System27
ix
ACKNOWLEDGEMENT
Every project big or small is successful largely due to the effort of a number of
wonderful people who have always given their valuable advice or lent a helping hand. I
sincerely appreciate the inspiration; support and guidance of all those people who have
been instrumental in making this project a success.
I feel deeply honoured to express my sincere thanks to my project supervisor, Mr
Paulinus Ofem for guiding me all through the project and providing valuable insights
leading to the successful completion of my project.
I am extremely grateful to the department of Computer Science for the confidence
bestowed in me and entrusting my project entitled Online Car sales Management
System with special reference to Sansani Motors Enterprise Ltd.
Also, am highly indebted to Sansani Motors Enterprise Ltd for taking their time to
provide me with necessary information regarding the project.
Last but not the least I wish to express my deep sense of gratitude to my family
members; especially my uncle, Mal. Ishaka Ahmad Galadima who has been my
sponsor all through, and my friends who have been constant source of inspiration and
encouragement during this project work.
Todays world is computer age; Stone Age is replaced with fabulous achievements
in
science. We are living in the computer age so humans are trying to become automated in
each and every field of his need. Basically automation is an act of replacing human
labour by machines. Automation is useful because when there are machines in place of
humans then the probability of error is minimized.
E-commerce is fast gaining ground as an accepted and used business paradigm. More
and more business houses are implementing web sites providing functionality for
performing commercial transactions over the web. It is reasonable to say that the process
of shopping on the web is becoming commonplace. The objective of this project is to
develop a general purpose e-commerce store where cars can be bought from the comfort
of home through the Internet (Swapna, 2007). However, for implementation purposes,
this paper will deal with an online book store. An online store is a virtual store on the
Internet where customers can browse the catalogue and select products of interest. The
selected items may be collected in a shopping cart. At checkout time, the items in the
shopping cart will be presented as an order. At that
needed to complete the transaction. Usually, the customer will be asked to fill or select a
billing address, a shipping address, a shipping option, and payment information such as
credit card number. An e-mail notification will be sent to the customer as soon as the
order is placed.
1.2
Problem Statement
In todays fast paced society, its very hard to be competitive without using cutting-edge
technology available in market. After years of business, the data has grown much for
Sansani Motors. It is becoming a challenge for Sansani Motors to manage that data in an
effective way. To be more productive in order processing, Sansani Motors needs a
solution which can facilitate their current processes with use of technology. With
increased amount of orders, it will be difficult for Sansani Motors to manage orders in an
effective and efficient manner. It will be very hard to go through all paper work and back
tracking orders. If there is any complain or review of any order, it takes large amount of
effort and time to backtrack and fix the problem. This results in loss of resources,
increased time, and low output.
All orders are managed using different papers; all information regarding one order is
stored in one physical file. This file contains all the documents related to that particular
order. Once Sansani Motors receive an order, they assign a unique number to that
order/file. Some of the financial details regarding orders are managed in an Excel sheet.
Currently in Sansani Motors the work flow followed is not very efficient due to lack of
Software and digital media usage. Workflow from order quotes, order to invoice and
payments are today made manually without the help of a computerized management
system. This means a lot of manual work, which leads to the loss of control over
operations. Due to higher workloads and more errors, delay in the whole process is
experienced on daily basis. No database exists and thus poor ability to pick out statistics
on for example the existing order stock.
1.3
The car sales System is a java based application that can be accessed easily. It basically
provides a tool so as to simplify all the activities involved in cars details. This project
primarily focuses on the elimination of hassles and paperwork to maintain the cars
records. Generally, the proposed system can help provide users with efficient working
environment and more output can be generated through this .This system provide the
user with friendly interface resulting in knowing each and every usability feature of the
system. The proposed system helps in tracking record so that past record can be verified
and one can make decision based on the past records. The system completes the work in
a very less time consumption and high level efficiency. The system is developed in such
way that even new users can also operate the system easily. The calculations are made
quickly and the records are directly saved into the database and can be maintain for
longer period of time. Each record can be retrieved and can be verified for future
transaction. Also the system provides high level of security of data so as to prevent
unauthorized access to the admin modules.
1.4
Scope of this project is to investigate and design a software solution which can facilitate
Sansani Motors in performing their daily tasks, improving efficiency, and
helping
which
Sansani Motors can easily manage, handle and generate all required information in their
respective format when needed. It will help them to manage order details, financial data,
and historical data and also in producing documents of different
formats
for
different customers. This solution will help Sansani Motors in reducing effort spent on
managing orders. It will also provide them opportunity to explore
possibility
of
4
generating documents, managing financial details and analysing historical data with use
of digitalized solution.
1.5
The aim of this research work is to develop a Car Sales Management System for Sansani
Motors. This will aid the management of Sansani Motors in tracking car sales and
control. The aim of the proposed Car Sales Management System is to help
small scale
dealers manage their business with a generic accounting package and extended
functionality with plug-in or other bolt-on software. The specific objectives of
the
ii.
Management System.
iii.
functionality.
Test and validate the systems performance.
iv.
1.6
Financial Constraints Bearing in mind the economic state of the nation, it was
found difficult in making both ends meet, because of the exorbitant nature of things
nowadays in travelling for the collection of data needed for the project.
b)
vacation of the final semester for the project to be completed, the time given seemed to
be short for the collection of required information for better work to be done.
5
c)
required materials needed for the project are not documented. Those that were
documented lacked storage facilities where they can be reached.
Knowing when an item was saved or not saved in the shopping cart.
Returning to different parts of the site after adding an item to the shopping cart.
Simple navigation from home page to information and order links for specific
products.
Another important factor in the design of an e-commerce site is feedback (Kubilus, 200).
The interactive cycle between a user and a web site is not complete until the web site
responds to a command entered by the user. According to Norman (Norman, 1994),
"feedback sending back to the user information about what action has actually been
done, what result has been accomplished is a well-known concept in the science of
control and information theory. Imagine trying to talk to someone when you cannot even
hear your own voice, or trying to draw a picture with a pencil that leaves no mark: there
would be no feedback". Web site feedback often consists of a change in the visual or
verbal information presented to the user. Simple examples include highlighting a
selection made by the user or filling a field on a form based on a user's selection from a
pull down list. Another example is using the sound of a cash register to confirm that a
product has been added to an electronic shopping cart (Norman, 1994).
Completed orders should be acknowledged quickly. This may be done with an
acknowledgment or fulfilment page. The amount of time it takes to generate and
download this page, however, is a source of irritation for many e-commerce users. Users
are quick to attribute meaning to events. A blank page, or what a user perceives to be "a
long time" to receive an acknowledgment, may be interpreted as "there must be
something wrong with the order." If generating an acknowledgment may take longer than
what may be reasonably expected by the user, then the design should include
intermediate feedback to the user indicating the progress being made toward
8
acknowledgment or fulfilment (Norman, 1994). Finally, feedback should not distract the
user. Actions and reactions made by the web site should be meaningful. Feedback should
not draw the user's attention away from the important tasks of gathering information,
selecting products, and placing orders (Norman, 1994).
2.2
The automated inventory control system software is a computer based system for
tracking product levels, orders, sales and deliveries. It can also be used in the
manufacturing industry to create a work order, bill of materials and other production
related documents. Companies use inventory management software to avoid product
overstock and outages and also, as a tool for organizing inventory data that was generally
stored in hardcopy form (Bolton, 2001).
According to Bolton (2001), the software is made up of components working together to
create a cohesive inventory control system which include:
i.
Asset tracking: This involves tracking products via its barcodes and other
tracking criteria such as serial number when they are in a warehouse or store.
ii.
inventory control system can be programmed to tell managers to reorder that product.
This helps companies to avoid running out of products or tying up too much capital in
inventory.
iii.
than product oriented can use this software to track the cost of the materials they use to
provide services. This way, they can attach prices to their services that reflect the total
cost of performing them.
9
Automated inventory control systems are efficient, effective and have helped to
improve the manufacturing industry thereby providing more security to warehouses
while improving customer service.
2.3
10
dealership staff are evaluating vendors and deciding what software to implement.
Integration of these tools is the key but dealer principals and other key staff still need to
pay attention to other factors such as cost.
2.4
Properly managing inventory requires a system of some sort. It does not matter if the
system consists of writing inventory levels on the back of an envelope or using the most
sophisticated radio frequency identification system. As the old saying goes, there are
many ways to skin a cat, the different types of inventory control systems all have pros
and cons. choosing the right one boils down to which system holds the most value for the
company (Rubin, 2007).Basically, there are four types of inventory control systems:
Barcode technology
11
a major downside to manual inventory management as a single data entry or formula
error can cause major inaccuracies in the data output. (Lysons, 2001).
to
technology
uses fixed tag readers assigned throughout a warehouse such that anytime an item with
an RFID tag passes the reader, the movement of the item is recorded in the inventory
management software. Active systems work best in environments that require real time
inventory tracking or where inventory security problems exist. Passive RFID technology
requires the use of handheld readers to monitor inventory movement. Because RFID
technology has a reading range of up to 40 feet using passive technology and 300 feet
12
using active technology, it greatly increases the accuracy of moving inventory around a
warehouse (Hamlett, 2006).
movement
and storage of materials within a warehouse and process the associated transactions,
including shipping, receiving, put away and picking. The systems also direct and
optimize stock put away based on real time information about the status of bin
utilization. A WMS monitors the progress of products through the warehouse. It involves
the physical warehouse infrastructure, tracking systems, and communication between
product stations. It is the management of storage of products and services rendered on
the product within the four walls of a warehouse (Sande, 2003). More precisely,
warehouse management involves the receipt, storage and movement of goods, (normally
finished goods), to intermediate storage locations or to a final customer. In the
multiechelon model for distribution, there may be multiple levels of warehouses. This
includes a central warehouse, a regional warehouses (serviced by the central warehouse)
and potentially retail warehouses (serviced by the regional warehouses). According to
Sande (2003), Warehouse management systems help to efficiently monitor the flow of
products. Once data has been collected, there is either batch synchronization with, or a
real time wireless transmission to a central database. The database can then provide
useful reports about the status of goods in the warehouse. Warehouse management
systems often utilize automatic identification and data capture technology, such as
barcode scanners, mobile computers, wireless LANs and potentially radio frequency
identification (RFID) to efficiently monitor the flow of products. According to
Wikipedia, the objective of a warehouse management system is to provide a set of
13
computerized procedures for management of warehouse inventory, space, equipment and
people with the goal of minimizing cost and fulfilment times. This includes:
warehouse management system helps companies cut expenses by minimizing the amount
of unnecessary parts and products in storage. It also helps companies keep lost sales to a
minimum by having enough stock on hand to meet demand.
facilities (e.g. racking, etc.). For example, if certain products are often sold together or
are more popular than others, those products can be grouped together or placed near the
delivery area to speed up the process of picking, packing and shipping to customers.
Tracking where products are stocked, which suppliers they come from, and the
length of time they are stored. By analysing such data, companies can control inventory
levels and maximize the use of warehouse space. Furthermore, firms are more prepared
for the demands and supplies of the market, especially during special circumstances such
as a peak season on a particular month. Through the reports generated by the inventory
management software, firms are also able to gather important data that may be put in a
model for it to be analysed.
14
2.5
Automation: This is the use of technology or computers to control and process data
reducing the need for human intervention.
Software: A computer program or set of instructions that direct a computer to perform
a processing functions.
Information System: A collection of procedures, people, instruction and equipment to
produce information in a useful form.
Processing: This is dealing with something according to an established procedure.
Database: This refers to a large store of related data on a computer that a user can
access and modify.
Password: This is a secret code that must be entered into a computer to enable access
to its applications. It is made up of numbers, letters, special characters or a combination
of any of the above categories.
Inventory Control System: A list of orders to be filled, and prompts workers to pick
the necessary items and provides them with packaging and shipping information.
Computerization: This is the conversion of a manually operated system to a
controlled, organized and automated system.
Research: A careful study of a subject to discover facts, establish a theory or develop a
plan of action based on the facts discovered.
System: A set of computer components functioning together.
Technology: The study of techniques of mobilizing resources such as information for
accomplishing objectives that benefit man and his environment.
15
Introduction
The analysis approach adopted in this research work is the Structured Systems Analysis
and Design Method (SSADM). SSADM structures a project into small, well-defined
activities and specify the sequence and interaction of these activities. SSADM also uses
diagrammatic and other modelling techniques to give a more precise (structured)
definition that is understandable by both users and developers. SSADM follows the
waterfall life cycle model starting from the feasibility study to the physical design stage
of development.
Waterfall model is the earliest SDLC approach that was used for software
development.
The waterfall Model illustrates the software development process in a linear sequential
flow; hence it is also referred to as a linear-sequential life cycle model. This means that
any phase in the development process begins only if the previous phase is complete. In
waterfall model phases do not overlap.
16
17
Implementation: With inputs from system design, the system is first developed in
small programs called units, which are integrated in the next phase. Each unit is
developed and tested for its functionality which is referred to as Unit Testing.
Integration and Testing: All the units developed in the implementation phase are
integrated into a system after testing of each unit. Post integration the entire
system is tested for any faults and failures.
Deployment of system: Once the functional and non-functional testing is done,
the product is deployed in the customer environment or released into the market.
Maintenance: There are some issues which come up in the client environment. To
fix those issues patches are released. Also to enhance the product some better
versions are released. Maintenance is done to deliver these changes in the
customer environment.
All these phases are cascaded to each other in which progress is seen as flowing
steadily downwards (like a waterfall) through the phases. The next phase is started only
after the defined set of goals are achieved for previous phase and it is signed off, so the
name "Waterfall Model". In this model phases do not overlap.
18
Ample resources with required expertise are available to support the
product.
The project is short.
3.1.2 Prototyping
(Chester & Athwall, 2002 ) state that a prototyping methodology produces a
preliminary version of the required system that can be reviewed by end-users. This
means that the system developers would build a prototype of the application based on
the users initial requirements, and then present this to the users for them to test and
review. When the user has reviewed the prototype system, they can suggest
modifications and improvements to the system, which the developers can then go back
and produce a better working system that meets the users requirements identified in
the review. There are two methods of Prototyping, these are identified as:
Throw-away prototypes: a prototype is developed for the users to review to
identify their requirements, this is then discarded and the developers start to
build a new system that incorporates the users requirements, which will then
lead towards the final system.
Evolutionary prototypes: these are based on the idea of developing an initial
implementation, exposing this to user comment and refining it through many
versions until an adequate system has been developed as (Sommerville, 2007)
states. This means that an initial prototype is developed for the users to review,
the user then makes suggestions for modifications or improvements, and these
suggestions are then developed further into the prototype. This process is
carried out until a final system is produced for the user.
The prototyping methodology provides benefits such as better user involvement during
the development of the application, this means that they are also involved in helping to
19
develop the system by suggesting areas of improvement as well as reveal errors and
omissions in the requirements that have been proposed as they review the prototype,
(Sommerville, 2007 ) identified. Another benefit of Prototyping is that it presents the
potential user interface of the application to the user at an early stage of the project.
This allows the developers to modify the interface if it does not satisfy the users needs
before completing the final version of the system.
20
3.2
The existing system is one that has been manually operated over the years. It is a system
in which all the processes involved are achieved by manual approach. Critical analysis of
this system reveals that it is prone to errors. Careful analysis also shows that due to the
complexities of the manual system, records of inventory kept are inaccurate and
manually operated in such a way that requires the dealer to register sales on a book,
thereby making a staff handle two or three jobs at a time. An example is a staff trying to
register sales and at the same time rushing back to face a queue of impatient retailers
waiting to be attended to. This makes the place so crowded with customers waiting to be
served. Sometimes, due to inadequate staff, customers who have other things to do, end
up missing their various appointments. As a result of this, the attendant finds it very
difficult to have an accurate record as pressure is being mounted on him. The attendant
might end up writing an order meant for another customer and have it delivered to the
wrong person. Sansani Motors operates manually and has not adopted a computerised
mode of operation. This generates inadequate records or exercise improper management
of the company and in extreme cases, the company may lose her customers.
3.3
As we know, manual inventory control systems are quite tedious, time consuming and
less efficient and less accurate in comparison to the computerised system. Sansani
Motors has the following problems/weaknesses.
a)
The manual system cannot maintain inventory stocks by its self or without
human help.
b)
21
c)
Some records get lost over time while some are not easily found.
d)
e)
f)
The system does not calculate and give financial reports at a glance and as such,
The system is unable to detect faults within the system in case of rectifying
fraud. It takes a long time for mistakes to be rectified and sometimes throws the system
into confusion.
3.4
Customer information
ii.
Card information
This is used to capture customer details and payment information. First a
customer searches for a vehicle, once the search is successful, the customer's basic
details are collected. Lastly, the customer enters his/her credit/debit card information to
pay for the selected vehicle online.
22
Technical Feasibility:
We can strongly say that it is technically feasible, since there will not be much
difficulty in getting required resources for the development and maintaining the system
as well. All the resources needed for the development of the software as well as the
maintenance of the same is available in the organization here we are utilizing the
resources which are available already.
Economic Feasibility
Development of this application is highly economically feasible .The organization
needed not spend much money for the development of the system. The only thing is to
be done is making an environment for the development with an effective supervision.
If we are doing so, we can attain the maximum usability of the corresponding
23
resources. Even after the development, the organization will not be in a condition to
invest more in the organization .Therefore, the system is economically feasible.
3.5
System analysis and application developers often make use of data flow diagram also
(called data flow charts or data flow graphs) during problem analysis for software
requirement specifications. DFDs are very important in understanding a system and
effectively used during analysis to show flow of data and or information through a
system. It views a system as a function that transforms inputs to required outputs in a
system. The DFDs aims to capture the transformation that takes place within a system to
the input data so that eventually the output data is produced. Data flow diagrams are
composed of the four basic symbols shown below:
The Data Store symbol represents data that is not moving (delayed data at rest)
24
Start
User Account
Valid User
is
User Valid
?
No
Yes
Is
User
Admin?
No
Is User
Customer?
No
Yes
Yes
Enable all menus
Perform operation
25
3.6
Programming languages have strengths in different areas. Some languages are powerful
but can be bug-prone and difficult to work with, while others are simpler but can be
limiting in terms of functionality or performance (Ben et al., 2001). Java can be defined
as a collection of objects that communicate via invoking each other's methods. With the
advancement of Java and its widespread popularity, multiple configurations were built to
suite various types of platforms. Example: J2EE for
Mobile Applications. In this research work, J2EE is used. In this project work, EJB3 is
used because of the following reasons:
C and C++, when Java is compiled, it is not compiled into platform specific machine,
rather into platform independent byte code. This byte code is distributed over the web
and interpreted by virtual Machine (JVM) on whichever platform it is being run.
object file format, which makes the compiled code to be executable on many processors,
with the presence of Java runtime system.
26
programs that can do many tasks simultaneously. This design feature allows developers
to construct smoothly running interactive applications
instructions and is not stored anywhere. The development process is more rapid and
analytical since the linking is an incremental and lightweight process.
High Performance: With the use of Just-In-Time compilers, Java enables high
performance.
designed to adapt to an evolving environment. Java programs can carry extensive amount
of run-time information that can be used to verify and resolve accesses to objects on runtime.
3.7
Use Cases
A use case illustrates a unit of functionality provided by the system. The main purpose of
the use-case diagram is to help development teams visualize the functional requirements
of a system, including the relationship of "actors" (human beings who will interact with
the system) to essential processes, as well as the relationships among different use cases
(Donald, 2003).The use-case diagram of this research work is presented below:
27
System
addCar
deleteCar
updateCarDetails
viewSalesReport
Manager
registerCustomer
viewCar
Customer
orderCar
viewPreviousOrder
Fig 3.1 Use case diagram for a Car Sales Management System
28
3.8
The Entity relationship is also a part of UML diagrams. The purpose of entity relation
diagram is to depict the classes within a model. In an object oriented programming
classes have attributes or variables, operations or functions and relations with other
classes. A UML diagram can depict all these things very easily. A class icon is simply
a rectangle divided into three parts: the topmost contains class name, the middle
contains list of attributes and the part bottom contains list of functions function.
The following figure shows that the declaration of each parameter of different classes
and it shows the relation among the classes. It also shows that after registering a
customer the information will be saved in the database that will utilized to be logged in
CustomerProfile
CarDatabsae
-String customer Id
-String surname
-String midname
-String fname
-String address
-Int phoneNo
-String email
-String country
-String state
n
1
Orders
-Int Id primary key
-String customer
-String product
-Int quantity
-Float price
-String
OrderDetails
29
3.9
Requirements Specification
This proposed software runs effectively on a computer system which has the
minimum requirements. The requirements are split into two categories, namely:
MySQL
MySQL-Connector-Java
30
Entities/Tables
After the users requirements were defined in the analysis section of the report, the
tables (entities) required in the new database can now be identified. The tables required
in the database were identified as follows for the first iteration of the prototyping
methodology being followed:
Cars: to hold the details of a vehicle.
Pricing: to hold the pricing details of a vehicle.
Customer: to hold details of a buyer of a vehicle.
Payment: to hold the details of payment transaction service.
Sales: to hold the details of Vehicle sales.
Users: to hold the details of the users of the System and their role.
The users table holds only three attributes i.e. username, password and role this is
because the System is designed to accommodate multiple user but each with separate
username and password and their roles are specified.
The decision to have a separate Pricing table to store the pricing details for a vehicle
was simply because there are many pricing attributes required to be stored, and
therefore it would be much more sensible to keep all pricing details in a separate table
for neatness, rather than cluttering the Cars table with too many attributes that could
lead to possible confusion.
31
Anomalies. It is a multi-step process that puts data into tabular form by removing
duplicated data from the relation tables.
Normalization is used for mainly two purposes,
Eliminating redundant (useless) data.
Ensuring data dependencies make sense i.e. data is logically stored.
Without Normalization, it becomes difficult to handle and update the database, without
facing data loss. Insertion, Update and Deletion Anomalies are very frequent if
Database is not normalized.
32
FIELD TYPE
VARCHAR
VARCHAR
VARCHAR
VARCHAR
VARCHAR
FIELD SIZE
15
15
15
30
10
FIELD TYPE
INTEGER
INTEGER
INTEGER
DATETIME
BOOLEAN
DOUBLE
FIELD SIZE
FIELD TYPE
INTEGER
VARCHAR
VARCHAR
VARCHAR
NUMBER
VARCHAR
FIELD SIZE
FIELD TYPE
INTEGER
VARCHAR
VARCHAR
VARCHAR
INTEGER
INTEGER
VARCHAR
FIELD SIZE
10;2
15
30
250
11
20
50
50
50
20
33
Implementation
In any system analysis and design, implementation is the stage where the designed ideas,
software and hardware components come together or are put in place to have the reality
of full operational functionalities of the designed system. The researcher, at this stage
consistently put to implementation, the design ideas or concepts of the new system to
realize the practical system. The implementation of the system was achieved using EJB3
as the programming language and MySQL as the database. The source code of the
system is presented in Appendix below.
4.2
Results:
This system produces physical results. These results are the outcome or output of the
system which are in accordance with the requirement of the system. The outcome or
outputs of the system can be found in APPENDIX A with each output carrying its title
that explains what it does in the system. The researcher believes that after going through
this work and especially the results of this chapter, readers and users should have a clear
idea and understanding of the system.
4.3
Findings
The result of the work shows that manual information processing can be automated.
The advantage of this automation is evidenced by the fact that, the limitations of the
manual system have been overcome by the web-based System. The efficient and
effective Customer service delivery and profit maximization are better supported by the
new System.
34
Summary
The Internet has become a major resource in modern business, thus electronic shopping
has gained significance not only from the entrepreneurs but also from the customers
point of view. For the entrepreneur, electronic shopping generates new business
opportunities and for the customer, it makes comparative shopping possible.
In this project, the user is provided with an e-commerce web site that can be used to
buy cars online. To implement this as a web application EJB3 technology is used.
EJB3 has several advantages such as enhanced performance, scalability, built-in
security and simplicity. Chapter one introduces the subject under discussion, the
statement of the problem, scope and limitations, justification of the study, aims and
objectives of the study and definition of terms.
Chapter two revealed the emergence of Internet Security which helped in encryption
and detection of intrusion. The chapter also covers a review of related literature on
Electronic e-Commerce, Automated Inventory Control Systems, Types of Inventory
Control Systems and Warehouse Management System. Chapter three focuses on the
methodology of information or resources gathering and presentation, analysis of the
system, programming language used and system testing and maintenance. In addition,
program development, database, unified modeling language and requirements for the
new system have been dealt with. Chapter four covers the implementation and results
of the research work.
A good shopping cart design must be accompanied with user-friendly shopping cart
application logic. It should be convenient for the customer to view the contents of their
35
cart and to be able to remove or add items to their cart. The shopping cart application
described in this project provides a number of features that are designed to make the
customer more comfortable.
5.2
Conclusion
While developing the system lots of effort has been made to create this software, making
use of available tools, techniques and resources that would generate a proper System.
While making the system; an eye was kept on making it as user friendly, effective and as
flexible as possible. This software will help to reduce the workload of Sansani Motors in
managing their day to day activities which will result in better sales and inventory
management. EJB3 and MYSQL were two main technologies used. These two
technologies have several benefits and are considered as one of the best combination in
the market. Despite of the technologies several other techniques were implemented to
ensure the reliability of the system. The system is built according to the modern web
standards. The system is built in such a manner that it requires
no
special
skills
to
manage the working of the system and it is very easy to perform all business tasks for
administrators as well as the customers.
5.3
Recommendation
Having carefully examined the usefulness of computer in eliminating most of the errors
and hindrances that ensue from paper work, I recommend this car Sales Management
System for Sansani Motors and other car dealers in the state and Nigeria in general in
order to enable them produce an efficient inventory management and likewise reduce
the complexity of manual work.
36
REFERENCES
Ben Albahari, Peter Drayton, Brad Merrill (2001): "C# Essentials, 2nd Edition", UAS,
O'Reilly Publisher, ISBN: 0-596-00315-3.
Bolton, D.J. (2001). Applying Automated Inventory Control Systems in Manufacturing
Industries. London: D.P Publications Ltd.
Donald B (2003). UML basics: An Introduction to the Unified Modelling Language.
IBM Global Services Retrieved 2015-06-26 from
http://www.therationaledge.com/content/jun_03/f_umlintro_db.jsp
Diwakar, H., Marathe, M. (2000). The Architecture of a One-stop Web-window shop.
December, ACM SIGecom Exchanges, Volume 2 Issue 1.
Hamlet, J. (2006). Cultivating Alliances with Customers. International Journal of
Organizational Management, New York. Vol. 7. Issue 3, pp. 255-287.
Kubilus, N. J. (2000). Designing an e-commerce Site for users. September 2000,
Crossroads, Volume 7 Issue 1.
Kenneth. D.C. (2002). Contemporary Inventory Management Systems. New York:
McGraw Go Spot.
Lysons, M.C. (2001). Systematic Planning for Change. Palo Alto, California: Mayfield
Publishing Company.
Rubin, K. (2007). Computer Applications for Inventory Control Systems. Boston:
McGraw Hill.
Norman, D.A. (1994). The Design of Everyday Things. Doubleday, New York.
Sande, O.F. (2003). Automated Warehouse Management Systems. Journal of
Information Technology, Massachusetts. Vol. 2, pp. 35-43.
37
Swapna K. (2007), The Design And Implementation Of An E-Commerce Site For
Online Book Sales. Master of Science Thesis, Department of Computer and
Information
Sciences
Wiley, Y. M. J. & Sons. (1997) Creating the Virtual Store: Taking Your Web Site
from Browsing to Buying
38
39
40
41
42
43
44
java.util.ArrayList;
java.util.Calendar;
java.util.GregorianCalendar;
java.util.Iterator;
java.util.List;
javax.ejb.Stateless;
javax.persistence.EntityManager;
javax.persistence.PersistenceContext;
org.sansani.lafia.Cars;
org.sansani.lafia.Customers;
org.sansani.lafia.Orders;
org.sansani.lafia.Pictures;
org.sansani.lafia.Sales;
org.sansani.lafia.TblCard;
org.sansani.lafia.Users;
/**
*
* @author mrbadara
*/
@Stateless
public class MainSession implements MainSessionLocal {
@PersistenceContext(unitName = "SansaniMotors-ejbPU")
private EntityManager em;
public void persist(Object object) {
em.persist(object);
}
// Add business logic below. (Right-click in editor and
choose
// "Insert Code > Add Business Method")
@Override
public boolean loginUser(String username, String password)
{
boolean isLogin = false;
Users us = (Users)em.find(Users.class, username);
if(us.getPassword().equals(password))
{
isLogin = true;
}
return isLogin;
}
@Override
public String returnRole(String username) {
Users us = (Users)em.find(Users.class, username);
return us.getRole();
}
45
@Override
public String addNewCar(Cars car) {
int id =0;
try
{
Cars c = new Cars(null, car.getMake(), car.getModel(),
car.getYear(),
car.getCondition(),
car.getColour(),
car.getEngineno(),
car.getChasisno(),
car.getPrice(),
car.getQuantity(),car.getDetails());
em.persist(c);
id = c.getId();
}
catch(Exception ec)
{
System.out.println("Error
in
Session::::;
"+ec.getMessage());
ec.printStackTrace();
}
return new Integer(id).toString();
}
@Override
public int getApplicatPassport(String carid) {
int id = 0;
int newid =0;
try
{
Pictures
p
=
new
Pictures(null,new
Integer(carid).intValue());
em.persist(p);
id = p.getId();
}
catch(Exception ex)
{
System.out.println("Error
in
Picture
Upload
"+ex.getMessage());
}
return id;
}
@Override
public byte[] viewPassport(String id) {
try
{
Pictures p1 = (Pictures) em.find(Pictures.class,
new Integer(id).intValue());
return p1.getPicture();
}
catch(Exception ex){}
return null;
}
@Override
public int uploadPassport(int parameter, byte[] passport) {
46
Pictures
p1
=
(Pictures)
parameter);
p1.setPicture(passport);
em.merge(p1);
return p1.getId();
}
em.find(Pictures.class,
@Override
public List viewCars() {
List<Cars> list = null;
try
{
list
=(List<Cars>)em.createNamedQuery("Cars.findAll").getResultList();
}
catch(Exception ex)
{
System.out.println("Error
while
viewing
cars
"+ex.getMessage());
}
return list;
}
@Override
public byte[] viewPassport1(String id) {
byte[] pic = null;
try
{
List<Pictures>
p1
=
(List<Pictures>)
em.createNamedQuery("Pictures.findByCarid").setParameter("carid",
Integer.parseInt(id)).getResultList();
Iterator it = p1.iterator();
while(it.hasNext())
{
Pictures p = (Pictures)it.next();
pic = p.getPicture();
break;
}
}
catch(Exception ex){}
return pic;
}
@Override
public void deleteCar(int id) {
try
{
Cars c = (Cars)em.find(Cars.class, id);
em.remove(c);
}
catch(Exception ex){}
}
@Override
public List listSingleCar(int id) {
List<Cars> list = null;
47
try
{
list
=(List<Cars>)em.createNamedQuery("Cars.findById").setParameter("i
d", id).getResultList();
}
catch(Exception ex)
{}
return list;
}
@Override
public List listCarPictures(int id) {
List<Pictures> pic = null;
try
{
pic
=
(List<Pictures>)
em.createNamedQuery("Pictures.findByCarid").setParameter("carid",
id).getResultList();
}
catch(Exception ex){}
return pic;
}
@Override
public byte[] viewPassport2(String id) {
byte[] pic = null;
try
{
Pictures p1 = (Pictures)em.find(Pictures.class,
Integer.parseInt(id));
pic = p1.getPicture();
}
catch(Exception ex){}
return pic;
}
@Override
public int getCarIdFromPictures(int id) {
int pic = 0;
try
{
List<Pictures>
p1
=
(List<Pictures>)
em.createNamedQuery("Pictures.findByCarid").setParameter("carid",
id).getResultList();
Iterator it = p1.iterator();
while(it.hasNext())
{
Pictures p = (Pictures)it.next();
pic = p.getId();
break;
}
}
catch(Exception ex){}
48
return pic;
}
private String getCurrentDate() {
GregorianCalendar cal = new GregorianCalendar();
String mon = "";
String da = "";
String year = (cal.get(Calendar.YEAR))+"";
String month = (cal.get(Calendar.MONTH) + 1)+"";
String day = (cal.get(Calendar.DAY_OF_MONTH))+"";
try {
if (month.length() < 2) {
mon = "0" + month;
} else {
mon = month;
}
if (day.length() < 2) {
da = "0" + day;
} else {
da = day;
}
} catch (Exception ex) {
}
return year + "-" + mon + "-" + da;
}
@Override
public String addOrders(Orders od) {
try
{
Orders
orr
=
new
Orders(null,
od.getCarid(),
this.getCurrentDate(),
od.getAmount(),
od.getHaspaid(),
od.getCustomerid());
em.persist(orr);
return "DONE";
}
catch(Exception ex){}
return null;
}
@Override
public String addCustomer(Customers cst) {
try
{
Customers
cs
=
new
Customers(cst.getEmail(),
cst.getSurname(),
cst.getMidname(),
cst.getFirstname(),
cst.getAddress(),
cst.getPhone(),
cst.getEmail(),
cst.getCountry(), cst.getState());
em.persist(cs);
}
catch(Exception ex){}
try
{
Users
us
=
Users(cst.getEmail(),cst.getEmail(),"Customer");
new
49
em.persist(us);
java.util.ArrayList;
java.util.Calendar;
java.util.GregorianCalendar;
java.util.Iterator;
java.util.List;
javax.ejb.Stateless;
javax.persistence.EntityManager;
javax.persistence.PersistenceContext;
org.sansani.lafia.Cars;
org.sansani.lafia.Customers;
org.sansani.lafia.Orders;
org.sansani.lafia.Pictures;
org.sansani.lafia.Sales;
org.sansani.lafia.TblCard;
org.sansani.lafia.Users;
/*
*/
@Stateless
public class MainSession implements MainSessionLocal {
@PersistenceContext(unitName = "SansaniMotors-ejbPU")
private EntityManager em;
public void persist(Object object) {
em.persist(object);
}
// Add business logic below. (Right-click in editor and
choose
// "Insert Code > Add Business Method")
@Override
public boolean loginUser(String username, String password)
{
boolean isLogin = false;
Users us = (Users)em.find(Users.class, username);
if(us.getPassword().equals(password))
{
isLogin = true;
}
return isLogin;
}
@Override
public String returnRole(String username) {
Users us = (Users)em.find(Users.class, username);
return us.getRole();
}
50
@Override
public String addNewCar(Cars car) {
int id =0;
try
{
Cars c = new Cars(null, car.getMake(), car.getModel(),
car.getYear(), car.getCondition(), car.getColour(),
car.getEngineno(), car.getChasisno(), car.getPrice(),
car.getQuantity(),car.getDetails());
em.persist(c);
id = c.getId();
}
catch(Exception ec)
{
System.out.println("Error in Session::::;
"+ec.getMessage());
ec.printStackTrace();
}
return new Integer(id).toString();
}
@Override
public int getApplicatPassport(String carid) {
int id = 0;
int newid =0;
try
{
Pictures p = new Pictures(null,new
Integer(carid).intValue());
em.persist(p);
id = p.getId();
}
catch(Exception ex)
{
System.out.println("Error in Picture Upload
"+ex.getMessage());
}
return id;
}
@Override
public byte[] viewPassport(String id) {
try
{
Pictures p1 = (Pictures) em.find(Pictures.class,
new Integer(id).intValue());
return p1.getPicture();
}
catch(Exception ex){}
return null;
}
@Override
public int uploadPassport(int parameter, byte[] passport) {
51
Pictures p1 = (Pictures) em.find(Pictures.class,
parameter);
p1.setPicture(passport);
em.merge(p1);
return p1.getId();
}
@Override
public List viewCars() {
List<Cars> list = null;
try
{
list
=(List<Cars>)em.createNamedQuery("Cars.findAll").getResultList();
}
catch(Exception ex)
{
System.out.println("Error while viewing cars
"+ex.getMessage());
}
return list;
}
@Override
public byte[] viewPassport1(String id) {
byte[] pic = null;
try
{
List<Pictures> p1 = (List<Pictures>)
em.createNamedQuery("Pictures.findByCarid").setParameter("carid",
Integer.parseInt(id)).getResultList();
Iterator it = p1.iterator();
while(it.hasNext())
{
Pictures p = (Pictures)it.next();
pic = p.getPicture();
break;
}
}
catch(Exception ex){}
return pic;
}
@Override
public void deleteCar(int id) {
try
{
Cars c = (Cars)em.find(Cars.class, id);
em.remove(c);
}
catch(Exception ex){}
}
@Override
public List listSingleCar(int id) {
List<Cars> list = null;
52
try
{
list
=(List<Cars>)em.createNamedQuery("Cars.findById").setParameter("i
d", id).getResultList();
}
catch(Exception ex)
{}
return list;
}
@Override
public List listCarPictures(int id) {
List<Pictures> pic = null;
try
{
pic = (List<Pictures>)
em.createNamedQuery("Pictures.findByCarid").setParameter("carid",
id).getResultList();
}
catch(Exception ex){}
return pic;
}
@Override
public byte[] viewPassport2(String id) {
byte[] pic = null;
try
{
Pictures p1 = (Pictures)em.find(Pictures.class,
Integer.parseInt(id));
pic = p1.getPicture();
}
catch(Exception ex){}
return pic;
}
@Override
public int getCarIdFromPictures(int id) {
int pic = 0;
try
{
List<Pictures> p1 = (List<Pictures>)
em.createNamedQuery("Pictures.findByCarid").setParameter("carid",
id).getResultList();
Iterator it = p1.iterator();
while(it.hasNext())
{
Pictures p = (Pictures)it.next();
pic = p.getId();
break;
}
}
catch(Exception ex){}
53
return pic;
}
private String getCurrentDate() {
GregorianCalendar cal = new GregorianCalendar();
String mon = "";
String da = "";
String year = (cal.get(Calendar.YEAR))+"";
String month = (cal.get(Calendar.MONTH) + 1)+"";
String day = (cal.get(Calendar.DAY_OF_MONTH))+"";
try {
if (month.length() < 2) {
mon = "0" + month;
} else {
mon = month;
}
if (day.length() < 2) {
da = "0" + day;
} else {
da = day;
}
} catch (Exception ex) {
}
return year + "-" + mon + "-" + da;
}
@Override
public String addOrders(Orders od) {
try
{
Orders orr = new Orders(null, od.getCarid(),
this.getCurrentDate(), od.getAmount(), od.getHaspaid(),
od.getCustomerid());
em.persist(orr);
return "DONE";
}
catch(Exception ex){}
return null;
}
@Override
public String addCustomer(Customers cst) {
try
{
Customers cs = new Customers(cst.getEmail(),
cst.getSurname(), cst.getMidname(), cst.getFirstname(),
cst.getAddress(), cst.getPhone(), cst.getEmail(),
cst.getCountry(), cst.getState());
em.persist(cs);
}
catch(Exception ex){}
try
{
Users us = new
Users(cst.getEmail(),cst.getEmail(),"Customer");
54
em.persist(us);
return "<p class=success>Account created
successfully... click <a href=login.jsp>here</a> and login with
your email as username/password to continue</p>";
}
catch(Exception ex1){}
return null;
}
@Override
public List getCustomerByUsername(String username) {
List<Customers> cus = null;
try
{
cus =
(List<Customers>)em.createNamedQuery("Customers.findByCode").setP
arameter("code", username).getResultList();
}
catch(Exception wx){}
return cus;
}
@Override
public String checkMyCard(String cardno, String pin, String
cvv2, String amount, String dateExp) {
String msg = "Waiting...";
TblCard cardLocal = null;
try {
cardLocal =
(TblCard)em.createNamedQuery("TblCard.findByCardnoAndPinAndCvv2")
.setParameter("cardno", cardno)
.setParameter("pin", pin)
.setParameter("cvv2", cvv2)
.getSingleResult();
} catch (Exception ex) {
System.out.println("Error in getting card
details;;;;;" + ex.getMessage());
}
if (cardLocal != null) {
//String[] expDate =
cardLocal.getExpirydate().split("/");
int expMonth =
Integer.parseInt(cardLocal.getMonth());
int expYear =
Integer.parseInt(cardLocal.getYear());
String[] currentDate = dateExp.split("-");
int currentYear = Integer.parseInt(currentDate[0]);
int currentMonth =
Integer.parseInt(currentDate[1]);
55
if (currentYear > expYear && currentMonth >
expMonth) {
msg = "Card is Expired!!!";
} else if (expYear > currentYear && expMonth >
currentMonth) {
msg = "Card is Expired!!!";
} else {
if (cardLocal.getAmount() <
Double.parseDouble(amount)) {
msg = "Insufficient Amount";
} else {
msg = cardLocal.getAmount()+"";
}
}
} else {
msg = "Invalid Card";
}
return msg;
}
@Override
public String makePayment(Sales parameter) {
try
{
Sales s = new Sales(null, parameter.getOrderid(),
parameter.getCarid(), this.getCurrentDate(),
parameter.getAmount(),parameter.getCustomerid());
em.persist(s);
return "DONE";
}
catch(Exception ex){}
return null;
}
@Override
public List getCarsByMake(String make) {
List<Cars> list = null;
try
{
list
=(List<Cars>)em.createNamedQuery("Cars.findByMake").setParameter(
"make", make).getResultList();
}
catch(Exception ex)
{}
return list;
}
@Override
public List searchCarsByMakeModel(String make, String
model) {
List<Cars> car = null;
try
{
if(!model.equals("00") && make != "")
56
{
car =
(List<Cars>)em.createNamedQuery("Cars.findByModel")
.setParameter("model", model)
.getResultList();
}
else
{
car =
(List<Cars>)em.createNamedQuery("Cars.findByMake")
.setParameter("make", make)
.getResultList();
}
}
catch(Exception ex){}
return car;
}
@Override
public void deleteOrder(String id) {
int nid = Integer.parseInt(id);
try
{
Orders c = (Orders)em.find(Orders.class, nid);
em.remove(c);
}
catch(Exception ex){}
}
@Override
public void updateOrders(String username) {
List<Orders> ord = null;
try
{
ord =
(List<Orders>)em.createNamedQuery("Orders.findByCustomerid")
.setParameter("customerid",
username).getResultList();
Iterator it = ord.iterator();
while(it.hasNext())
{
Orders od = (Orders)it.next();
od.setHaspaid("YES");
}
em.merge(ord);
}
catch(Exception ex){}
}
@Override
public void newSales(Sales cs) {
//Sales(Integer id, int orderid, int carid, String
date, String amount, String customerid)
try
57
{
List det =
this.getOrderByUsernameHaspaid(cs.getCustomerid(), "NO");
Iterator it = det.iterator();
while(it.hasNext())
{
Orders o=(Orders)it.next();
Sales sale = new
Sales(null,o.getId(),0,this.getCurrentDate(),o.getAmount(),cs.get
Customerid());
em.persist(sale);
}
}
catch(Exception ex){}
}
@Override
public List salesReport(String date1, String date2) {
List<Sales> list = null;
try
{
list
=(List<Sales>)em.createNamedQuery("Sales.findByDate1AndDate2").se
tParameter("date", date1).setParameter("date",
date2).getResultList();
}
catch(Exception ex)
{}
return list;
}
@Override
public Cars viewSingleCar(int id) {
Cars car = null;
try
{
Cars c =(Cars)em.find(Cars.class, id);
car = new
Cars(c.getId(),c.getMake(),c.getModel(),c.getYear(),c.getConditio
n(),c.getColour(),c.getEngineno(),c.getChasisno(),c.getPrice(),c.
getQuantity(),c.getDetails());
}
catch(Exception ex)
{
System.out.println("Error while viewing cars
"+ex.getMessage());
}
return car;
}
@Override
public String modifyCar(Integer id, String make, String
model, String year, String condition, String colour, String
engineno, String chasisno, String price, String quantity,String
details) {
58
String ok="NOT";
try
{
Cars c =(Cars)em.find(Cars.class, id);
c.setChasisno(chasisno);
c.setColour(colour);
c.setCondition(condition);
c.setDetails(details);
c.setEngineno(engineno);
c.setMake(make);
c.setModel(model);
c.setPrice(price);
c.setQuantity(quantity);
c.setYear(year);
em.merge(c);
ok="DONE";
}
catch(Exception ex){}
return ok;
}
@Override
public List viewPicturesByCardId(int carid) {
List<Pictures> pic = null;
try
{
pic =
(List<Pictures>)em.createNamedQuery("Pictures.findByCarid").setPa
rameter("carid", carid).getResultList();
}
catch(Exception ex){}
return pic;
}
@Override
public void deletePic(int id) {
try
{
Pictures pic = (Pictures)em.find(Pictures.class,
id);
em.remove(pic);
}
catch(Exception ex){}
}
@Override
public List viewDistinctCar() {
List<Cars> list = new ArrayList();
try
{
list
=(List<Cars>)em.createNamedQuery("Cars.findAll").getResultList();
}
catch(Exception ex)
{
59
System.out.println("Error while viewing cars
"+ex.getMessage());
}
return list;
}
@Override
public List getOrderByUsernameHaspaid(String username,
String haspaid) {
List<Orders> ord = null;
try
{
ord =
(List<Orders>)em.createNamedQuery("Orders.findByCustomeridAndHasp
aid")
.setParameter("customerid", username)
.setParameter("haspaid", haspaid)
.getResultList();
}
catch(Exception ex){}
return ord;
}
@Override
public List getOrderByUsernameHaspaidAndId(String username,
String haspaid, int id) {
List<Orders> ord = null;
try
{
ord =
(List<Orders>)em.createNamedQuery("Orders.findByCustomeridAndHasp
aidAndId")
.setParameter("customerid", username)
.setParameter("haspaid", haspaid)
.setParameter("id", id)
.getResultList();
}
catch(Exception ex){}
return ord;
}
@Override
public List allOrders(String date) {
List<Orders> ord = null;
try
{
ord =
(List<Orders>)em.createNamedQuery("Orders.findByDate")
.setParameter("date", date)
.getResultList();
}
catch(Exception ex){}
return ord;
}
}
60
//**
*//
package org.sansani.session;
import
import
import
import
import
import
java.util.List;
javax.ejb.Local;
org.sansani.lafia.Cars;
org.sansani.lafia.Customers;
org.sansani.lafia.Orders;
org.sansani.lafia.Sales;
/**
*
* @author mradamu
*/
@Local
public interface MainSessionLocal {
boolean loginUser(String username, String password);
String returnRole(String username);
String addNewCar(Cars car);
int getApplicatPassport(String carid);
byte[] viewPassport(String id);
int uploadPassport(int parameter, byte[] passport);
List viewCars();
byte[] viewPassport1(String id);
void deleteCar(int id);
List listSingleCar(int id);
List listCarPictures(int id);
byte[] viewPassport2(String id);
int getCarIdFromPictures(int id);
String addOrders(Orders od);
String addCustomer(Customers cst);
List
haspaid);
getOrderByUsernameHaspaid(String
username,
String
61
String makePayment(Sales parameter);
List getCarsByMake(String make);
List searchCarsByMakeModel(String make, String model);
void deleteOrder(String id);
void updateOrders(String username);
void newSales(Sales cs);
List salesReport(String date1, String date2);
Cars viewSingleCar(int id);
String modifyCar(Integer id, String make, String model,
String year, String condition, String colour, String engineno,
String chasisno, String price, String quantity,String details);
List viewPicturesByCardId(int carid);
void deletePic(int id);
List viewDistinctCar();
List getOrderByUsernameHaspaidAndId(String username, String
haspaid, int id);
List allOrders(String date);
}