Professional Documents
Culture Documents
Jimma, Ethiopia
January, 2017
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
Acknowledgement
First of all we would like thanks Jimma University department of Electrical and Computer
Engineering coordinator for giving us this golden opportunity to identify the problem of the
community and finding out a solution based on the knowledge we get. Next, we also present my
deepest thank to my Advisors:- Alebachew.Tenna (MSc) to for his sacrifice in my all activities
while doing the project and giving us useful comments and valuable directions until it end and
again also store keeper for giving us useful information about Store managing system In JIT and
problems they face during their work.
By Habtamu Zeleke I
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
Abstract
My project is to improve JIT store management system from manual to automated system. Which
is used to avoid problem faced by store keeper when store material manually. Store is the place
where many varieties of materials are kept for the purpose of work. So at a time of storage is hard
to write in document all material listing by their name, id, model, price and quantity; and is also
boring to search specific material from whole material for human being but is easy for computer
that loaded with a program called store management to JIT. The program contain add frame to add
new material by their name, id, model, price, quantity, a gene calculating total price that means
unit price times quantity, date of registered, month, and year. The other one is search frame to
search material by name or by id. When the store kipper search the materials either the name or id.
The third is view frame to view all material stored. Another is delete frame to delete released
material from store. When the store kipper to release the material from the store clicking on the
delete frame the system asks the materials name and materials id, entering the materials name and
id it deleted. When the materials id or materials name is incorrectly the message dialog show that
there is no material in this name and in this id on the message box. The other was logout button.
When the person (store kipper) finished the work he must be logout. The last one was exit, used
to exit the frame directly.
By Habtamu Zeleke II
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
List of Acronyms
JU------------------------------------------------------Jimma University
JIT……………………………………………..Jimma institute of technology
ECE……………………………………………Electrical and computer engineering
GUI----------------------------------------------------Graphical user interface
ODBC--------------------------------------------------Open data base connectivity
JDBC---------------------------------------------------Java database connectivity
SQL…………………………………………….Secure quarry language
Table of Contents
Acknowledgement ........................................................................................................................ I
Abstract ........................................................................................................................................ II
1.5 Methodology.......................................................................................................................... 2
By Habtamu Zeleke IV
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
APPENDAX .............................................................................................................................. 19
REFERENCE ............................................................................................................................ 19
By Habtamu Zeleke V
CHAPTER ONE
1.1 Introduction
Store is the place where many varieties of materials are kept for the purpose of capital work. In
Jimma University there is around there section.
They are: stationary, building and spare part, furniture, equipment, Aided materials, salvage store
and cleaning, clothing and kitchen materials stores. The main function this stores is receive, store
and issue materials. In addition to this, stores are needed for the following purposes:-
Capital works.
Operation and Maintenances works.
Other Commercial activities like hiring equipment
To provide services to operating functions by balanced flow of raw materials, components,
tools and tackles and other consumable materials.
To account for all the materials received and issued proper storage to avoid deterioration
and loss of materials, economical material handling, stock verification and reconciliation
of discrepancies.
To receive scrap and other discarded materials and arrange prompt and most economical
disposal.
Maintain proper coordination and cordial relationship with departments.
I have found the following problems in existing manual store management system of JIT. Loss of
Items and materials record files: - when items and materials are enter to the store, the storekeeper
records the items and materials on paper. Due to this problem records of items and materials are
lost and expose the store for data loss. This problem not only affects the store but also affect the
work system of the JIT Therefore, I will develop a system that used to record items and materials
to improve the problem. Store keepers didn’t manage status of equipment that means whether it is
break or not. The time it takes for head offices such as college heads to order equipment manually
is very boring and it also makes overload of work on administrators and head offices.
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
The general objective of this project is to change the manual Store system of Jimma University to
Automated system.
For the collection of data I use: observation, Interview, Questionnaires and document analysis.
Observation: Observation is common methods of scientific research to collect the data. I use
observation to know the existing system of Jimma University store management office, different
sub offices and how office member are handling the work in the office.
Interview: Interview is particularly useful for getting the history behind the participant’s
experiences. I used interview to get information about the existing system for developing my
project. The interview will be conducted on the head of store manager office and store keeper
member.
Document Analysis: Document analysis is used to understand how the system was worked. I used
this method to know all about the staff mission, vision, function and overall of their work in short
and brief.
By Habtamu Zeleke 2
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
To develop the system, different software, hardware tools and programming language are very
important. Hardware tools such as computer (laptop), flash disk, network cable and CD, software
tool such as Net beans, Microsoft office word and PowerPoint and programming language are
used. I use OOP (object oriented programming) language in my implementation of my project.
Because of my title has a lots of objects which coherently Organized and built the system and also
to show their inheritance and plat form independent of the system in detail.
In addition, the GUI (graphical user interface) of the object oriented programming language is too
easy to the end user of the system as well as it is easy to program and handle exceptional thrown.
1.5.2.1 Software Tools
Microsoft office word:-It is very useful because it takes less time to write and format the text,
communicative effectively smart diagram and chart tools, quickly assemble document. By looking
its useful properties I use Microsoft office word to type my project work to get all the above
benefits of it. Power point: use to present the document in abstract forms. I use it to present my
presentation in short and brief way.
Net beans: software used to develop java program. To develop my java implementation net beans
is very important. The main properties of the Java, which made Java so popular, are as follows:
1. Simple
2. Secure
3. Portable
4. Object-Oriented
Computer: - computer is an electronics device that used to doing many things. I use it to type on
it and install all software and programming language. All tasks are done on computer.
Network cable: used to run the proposed system and get the internet access by connecting
internet line from internet hub to computer for further read and search information from internet.
By Habtamu Zeleke 3
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
Flash Disk and CD Hardware: used for the movement of data from one computer to another. I use
both of them when I move my data from one computer to another.
1.6.1 Scope
Add resources:-The proposed system registers all the resources that are entered to the
organization.
Send request:-the request sent from Head of colleges to get any service from the store.
Register Salvage resource: To register resources such as computers, furniture’s and
others. It helps to know the number of resources that are used and returned to the store.
Update Resources Data: It updates the resource information when needed.
Search resource Data: To search resource data within short period of time.
Generate report: To generate monthly as well as yearly report.
1.6.2 Limitation
• The system cannot provide online buying materials because online buying is another system.
By Habtamu Zeleke 4
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
CHAPTER TWO
The design part is very important so as to make the implementation very easy. The different types
of the system modeling techniques that are used for the implementation of the system such as
deployment and component modeling are show in detail. Not only the system modeling techniques
but also some system design techniques such as system decomposition design are cover in detail
in this project. The non-functional requirement is the description of the feature characters and
attributes of the system.
Reliability- The system has the ability to perform its required functions under stated conditions.
Fault Tolerance-The system should be able to give response (Error Message) when the user enter
incorrect input. This recommends the user to enter correct input.
Throughput: Since JU has both desktop application and web application it is able to perform
many tasks in fixed period of time. Different service center do different tasks in their working time
without worrying the other service center are using the same system.
Robustness: The system has the ability to survive wrong user’s inputs it didn’t accept it instead it
show error message and continue to enter correct input.
Modifiability: If there is any change to the system or fault it can be modified easily.
Usability: JIT store management provide easy user friendly interface for users of the systems. It
also provides help menu which gives brief description how to use the system so that user can be
able to use it easily.
Memory: JIT store management requires the following space to run the system. Desktop or laptop
computers and web server computers having more than 1GB of RAM and high storage capacity
and processing speed.
2.3 Description of the System
In Jimma institute of technology starting from the establishment there is a manual Store keeping
system to manage the university resources. Currently, the store system of Jimma institute of
By Habtamu Zeleke 5
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
technology works manually. This working condition has major drawbacks. These major drawbacks
are
• Loss of materials record files
• Time consuming.
• It is very tedious.
• All information is not placed separately.
• Lot of paper work.
• Difficult to find records.
• Slow data processing
2.4 Proposed System
User interface: the system provides java user interfaces that are compatible with windows
platform.
Hardware consideration:-the organization should have computers having typical storage
capacity and processing speed.
Error handling: my system handles error by showing the message” invalid input” when
the user inters invalid input.
Security: the system should have a security privilege that secures the system. And also
there must be a physical security that secures (especially) the server computer. That means
the server computer is only allowed for the server person.
Performance characteristics: the end user computer should have medium processor and
the server computer should have large processor. It’s measured by its speed of processor.
Physical environment: The system needs good environment.
Back up: The system should have back up using external hard disk. The backup is taken
weekly.
By Habtamu Zeleke 6
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
Functional Requirements are those that refer to the functionality of the system, i.e., what services
it will provide to the user. Statements of services the system should provide how the system should
react to particular inputs and how the system should behave in particular situations.
The system would be able to add the received materials.
The system would be able to add material resources...
The system would be able to search and update the material information when it is needed.
Record items and materials when items and materials are received.
Change Status of items and materials when items and materials are used.
Receive request and reply for the request.
The system should generate timely or year report about the allocation of resources.
The system should store all the data related with all the tasks performed into a database.
By Habtamu Zeleke 7
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
JIT STORE
By Habtamu Zeleke 8
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
I had discussed in the above, my University (Jimma University) is the first one from other Ethiopia
University. I have designed this project in order to improve such to change manual system to
automated system in jimma university and I’m hope this project could improve the JIT store system
problem to some extent with respective to their background
By Habtamu Zeleke 9
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
CHAPTER THREE
3.1 DISCUSSION
Generally the purpose and the aim of this project is to create automated store management system
to jimma University Institute of Technology.
In this project I have used the following basic devices and showing my output:-
Using Net bean Setup to write a programming.
Using the computer that used to write and to run output on the screen.
I design my project based on the methods of evaluating appropriateness of technology which are
technical, cultural, and economic appropriateness. When I first see its technicality, it is not difficult
for the users of this technology to control and manage it properly. Secondly, it has no any adverse
effect of the community. This gives to my project its cultural appropriateness. Finally when I come
to its economical appropriateness I use less coasty and equipment to write a programming.
3.2. RESULT TO MY PROJECT
By Habtamu Zeleke 10
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
Store kipper enter the password and username in the panel then click on the login. When the
username or password is incorrect the system sad it is incorrect username or password. After check
username and password go to the next
By Habtamu Zeleke 11
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
To add material to JIT store the above box ask must be. In this box the quantity means the numbers
of the material but in the view all box it is amount. In my program I changed quantity to amount
why because int amount=Integer.parseInt (t_itemquantity.getText ()); parseInt(it is computers
keyword that change any value to integer type)
By Habtamu Zeleke 12
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
To search the materials from the store they have to options button that are materials name and
materials id. Clicking from this go to the next.
The store kipper add the name of material in the penal to search only one material from all material.
The material name is correct the system show that material from all materials, otherwise the name
is not Mache he show empty box.
By Habtamu Zeleke 13
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
The store kipper add the id of material in the penal to search only one material from all material.
The material id is correct the system show that material from all materials, otherwise the name is
not Mache he show empty box.
The store kipper click on the view all he see all materials in JIT store. This place include all
information about the material. That means id number of the material, name of the material, model
of the material, quantity of the material, unit price of the materials, total price of the material(unit
price * quantity) and registered date or add date. This all information is very important to know
material information.
By Habtamu Zeleke 14
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
To delete (remove) the material from the store the store kipper must be entering the name and id
of material. In this store kipper is not enter only one because to remove material from store the
name of material and the id must be much as the material.
By Habtamu Zeleke 15
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
The entered name and id is not mached the system show on the missege dilogy it is not mached
or ther is no material in yhis name and id.
When the name and the id of material is correct the delete is successfully deleted.
By Habtamu Zeleke 16
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
In this sub section, I going to discuss the quantity and price of materials in which I used in my
project design. In order to achieve this project, I have used simplest materials which could be
bought from electronic shop and other setup or application. Now the following table show that the
material lists and there cost.
Materials type Cost
Net bean -
Microsoft office -
Cable 50 birr
By Habtamu Zeleke 17
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
CHAPTER FOUR
4.1 Conclusion
This project provided automated system to JIT store management. Automated store management
system help that how store kipper add, search, remove (delete) and see all materials in the store.
when the store keeper use automated system that Add materials to JIT store, search the materials
from JIT store by materials name and materials id, to see all JIT store materials at ones and to
delete (remove) materials from JIT store. Firstly the store keeper must be connecting data base on
the Net beans after that the system was simple run and starting the work.
4.2 Recommendation
Using the automated store management system is the best thing. I have used Net bean setup
(Application) to write a programming and others like Microsoft office 2007 to write manual
peeper, computer to run program that to produce automated store management system for JIT
store. But its (automated system) scope is not restricted for only this purpose but also automated
system is used for many different purposes. I recommend to the others or a person want to doing
in this area to use automated store management system and for other different store.
This Project is the First Project in my BSc level in 3rd year of Electrical Engineering and when you
see some mistake you understand with yours. I used the simplest method, also simplest words.
By Habtamu Zeleke 18
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
REFERENCE
[1] Introduction to java programming Eighth Edition Y. Daniel Liang Objects and Classes page
263-301, Inheritance and Polymorphism and GUI Basics page373-405, 447.
[2] C. Thomas Wu, Fifth Edition in Naval Postgraduate School Inheritance and polymorphism733
759 GUI and Event Driven Program 787-861
[3] Java How to program Ninth edition by Paul Deitel and Harvey Deitel page 1000-1042,
[4] http://www.agilemodeling.com/artifacts/deploymentDiagram.DataBase
[5] www.tutorialspoint.com Simply easy learning 12-45;
By Habtamu Zeleke 19
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
APPENDAX
By Habtamu Zeleke 20
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
By Habtamu Zeleke 21
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
By Habtamu Zeleke 22
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
setLocation(250, 50);
setSize(800, 600);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
bclear.addActionListener(this);
bcancel.addActionListener(this);
blogin.addActionListener(this);
setBackground(Color.LIGHT_GRAY);
}
public static void main(String[] args)throws SQLException {
StoreManagement gg=new StoreManagement(); // TODO code application logic here
}
@Override
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();
tempbutton = (JButton) obj;
if (tempbutton == bcancel) {
System.exit(0);
}
if(tempbutton==bclear){
tusername.setText(null);
passwordfield.setText(null);
}
if(tempbutton==blogin){
String user = "ECE";
String pass = "GROUP4";
if (tusername.getText().equals("") && passwordfield.getText().equals("")) {
JOptionPane.showMessageDialog(this, "Please Enter User Name and Password! ");
}
By Habtamu Zeleke 23
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
else if (tusername.getText().equals("")) {
JOptionPane.showMessageDialog(this, "Please Enter User Name! ");
}
else if (passwordfield.getText().equals("")) {
JOptionPane.showMessageDialog(this, "Please Enter Password! ");
}
else
if (user.equals(tusername.getText()) && pass.equals(passwordfield.getText())) {
homepage = new JFrame(" WELCOME TO JIMMA INSTITUTE OF TECHNOLOGY
STORE MANAGEMENT SYSTEM!");
GridLayout m = new GridLayout(5, 1);
bAdd = new JButton("Add");
bsearch = new JButton("Search");
bviewall = new JButton("View all");
bdelete = new JButton("Delete");
bexit = new JButton("Exit");
blogout = new JButton("Logout");
bname = new JButton("NAME");
bback = new JButton("Back");
bById = new JButton("BY ID");
blogout.setFont(new Font(null,Font.BOLD,20));
bAdd.setFont(new Font(null,Font.BOLD,20));
bsearch.setFont(new Font(null,Font.BOLD,20));
bviewall.setFont(new Font(null,Font.BOLD,20));
bdelete.setFont(new Font(null,Font.BOLD,20));
bexit.setFont(new Font(null,Font.BOLD,20));
bname.addActionListener(this);
bback.addActionListener(this);
bById.addActionListener(this);
By Habtamu Zeleke 24
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
JLabel lo = new JLabel("Choose from the button what you want to do!!!");
lo.setFont(new Font(null,Font.BOLD,30));
JPanel o1 = new JPanel(new FlowLayout());
JPanel o2 = new JPanel(new FlowLayout());
JPanel o3 = new JPanel(new FlowLayout());
JPanel o4 = new JPanel();
JPanel o5 = new JPanel();
o1.add(bAdd);
o1.add(bsearch);
o1.add(bviewall);
o2.add(bdelete);
o2.add(blogout);
o5.add(bexit);
o4.add(lo);
homepage.add(o3).setBackground(Color.LIGHT_GRAY);
homepage.add(o4).setBackground(Color.LIGHT_GRAY);
homepage.add(o1).setBackground(Color.LIGHT_GRAY);
homepage.add(o2).setBackground(Color.LIGHT_GRAY);
homepage.add(o5).setBackground(Color.LIGHT_GRAY);
blogout.addActionListener(this);
bexit.addActionListener(this);
bdelete.addActionListener(this);
bviewall.addActionListener(this);
bsearch.addActionListener(this);
bAdd.addActionListener(this);
homepage.setLocation(250, 50);
homepage.setLayout(m);
homepage.setSize(800, 600);
this.setVisible(false);
By Habtamu Zeleke 25
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
homepage.setVisible(true);
homepage.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
else {
JOptionPane.showMessageDialog(null, "Error", "Incorrect user name and/or password",
WIDTH);
}
}
if(tempbutton==bclear){
tusername.getText().equals("");
passwordfield.getText().equals("");
}
if(tempbutton==blogout){
homepage.setVisible(false);
this.setVisible(false);
}
if(tempbutton==bdelete){
deleteframe=new JFrame("DELETE MATERIAL FROM JIT STORE");
ldelete=new JLabel("DELETE MATERIAL FROM JIT STORE BY NAME AND BY ID");
ldi=new JLabel("INSERT ID OF MATERIAL");
ldn=new JLabel("INSERT NAME OF MATERIAL");
t_itemid=new JTextField(10);
t_nametodelete=new JTextField(10);
b_delete=new JButton("delete");
back5=new JButton("back");
JPanel d1 = new JPanel();
JPanel d2 = new JPanel(new FlowLayout());
JPanel d3 = new JPanel(new FlowLayout());
JPanel d4 = new JPanel(new FlowLayout());
By Habtamu Zeleke 26
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
d1.add(ldelete);d2.add(ldi);d2.add(t_itemid);
d3.add(ldn);d3.add(t_nametodelete);
d4.add(b_delete);d4.add(back5);
b_delete.addActionListener(this);
back5.addActionListener(this);
GridLayout x = new GridLayout(4,1);
deleteframe.add(d1).setBackground(Color.cyan);
deleteframe.add(d2).setBackground(Color.cyan);
deleteframe.add(d3).setBackground(Color.cyan);
deleteframe.add(d4).setBackground(Color.cyan);
deleteframe.setLocation(250, 50);
deleteframe.setLayout(x);
deleteframe.setSize(800, 600);
homepage.setVisible(false);
deleteframe.setVisible(true);
deleteframe.setDefaultCloseOperation(EXIT_ON_CLOSE);/////////////////////////////where is delete
program?
}
if(tempbutton==back5){//back
deleteframe.setVisible(false);
homepage.setVisible(true);
}
if(tempbutton==bAdd){
String
dat[]={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","2
0","21","22","23","24","25","26","27","28","29","30","31"};
String months[] = { "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" };
By Habtamu Zeleke 27
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
String
year[]={"2016","2017","2018","2019","2020","2021","2022","2023","2024","2025","2026","20
27","2028","2029","2030",
"2031","2032","2033","2034","2035","2036","2037","2038","2039","2040","2041","2042","204
3","2044","2045","2046","2047","2048","2049","2050"};
Addframe = new JFrame("ADD MATERIAL TO JIT STORE");/////frame item
litemid=new JLabel("Insert material id");
litemname=new JLabel("Insert material name");
litemmodel=new JLabel("Insert material model");
litemquantity=new JLabel("Insert material Quantity ");
ldate=new JLabel("Add date",JLabel.LEFT);
lmonth1=new JLabel("Insert material unit price");
lmt=new JLabel("Total price");
lday=new JLabel("day");
lmonth=new JLabel("month");
lyear=new JLabel("year");
comb=new JComboBox(dat);
comb1=new JComboBox(months);
comb2=new JComboBox(year);
bsubmit=new JButton("Submit");
clear=new JButton("Clear");
back=new JButton("Back");
exit=new JButton("Exit");
caltotal =new JButton("Calc total");
t_id=new JTextField(15);
t_itemname=new JTextField(15);
t_itemmodel=new JTextField(15);
t_itemquantity=new JTextField(15);
t_itemprice=new JTextField(15);
By Habtamu Zeleke 28
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
t_totalprice=new JTextField(15);
JPanel o6 = new JPanel(new FlowLayout());
JPanel o7 = new JPanel(new FlowLayout());
JPanel o8 = new JPanel(new FlowLayout());
JPanel o9 = new JPanel(new FlowLayout());
JPanel o11 = new JPanel(new FlowLayout());
JPanel o12 = new JPanel(new FlowLayout());
JPanel o13=new JPanel(new FlowLayout());
JPanel pp = new JPanel();
o6.add(litemid); o6.add(t_id);
o7.add(litemname); o7.add(t_itemname);
o8.add(litemmodel); o8.add(t_itemmodel);
o9.add(litemquantity); o9.add(t_itemquantity);
o11.add(ldate); o11.add(lday);
o11.add(comb);o11.add(lmonth);
o11.add(comb1);o11.add(lyear); o11.add(comb2);
o12.add(lmonth1); o12.add(t_itemprice);
o13.add(lmt);o13.add(t_totalprice);o13.add(caltotal);
pp.add(bsubmit).setBackground(Color.yellow);
pp.add(clear).setBackground(Color.yellow);
pp.add(back).setBackground(Color.yellow);
pp.add(exit).setBackground(Color.yellow);
bsubmit.addActionListener(this);
clear.addActionListener(this);
back.addActionListener(this);
exit.addActionListener(this);
caltotal.addActionListener(this);
this.setVisible(false);
GridLayout x = new GridLayout(8,2);
By Habtamu Zeleke 29
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
Addframe.add(o6).setBackground(Color.pink);
Addframe.add(o7).setBackground(Color.pink);
Addframe.add(o8).setBackground(Color.pink);
Addframe.add(o9).setBackground(Color.pink);
Addframe.add(o11).setBackground(Color.pink);
Addframe.add(o12).setBackground(Color.pink);
Addframe.add(o13).setBackground(Color.pink);
Addframe.add(pp).setBackground(Color.pink);
Addframe.setLocation(250, 50);
Addframe.setLayout(x);
Addframe.setSize(800, 600);
homepage.setVisible(false);
Addframe.setVisible(true);
Addframe.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
if(tempbutton==caltotal){
int flt=Integer.parseInt(t_itemprice.getText())*Integer.parseInt(t_itemquantity.getText());
t_totalprice.setText(""+flt);
}
if(tempbutton==clear){
t_id.setText("");
t_itemname.setText("");
t_itemmodel.setText("");
t_itemquantity.setText("");
t_itemprice.setText("");
t_totalprice.setText("");
}
if(tempbutton==bsearch){
searchframe=new JFrame("SERCH MATERIAL FROM JIT STORE");
By Habtamu Zeleke 30
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
By Habtamu Zeleke 31
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
Addframe.setVisible(false);
homepage.setVisible(true);
}
if(tempbutton==back2){
searchframe.setVisible(false);
homepage.setVisible(true);
}
if(tempbutton==bexit){
System.exit(0);
}
if(tempbutton==bsearchIdOfItem){
searchbyidframe=new JFrame("SEARCH MATERIAL BY ID FROM JIT STORE");
labelid=new JLabel("TYPE ID OF MATERIAL");
search=new JButton("SEARCH");
back3=new JButton("BACK");
t_searchid=new JTextField(10);
JPanel zz=new JPanel(new FlowLayout());
JPanel zzz=new JPanel();
zz.add(labelid);zz.add(t_searchid);
zzz.add(search); zzz.add(back3);
search.addActionListener(this);
back3.addActionListener(this);
GridLayout x = new GridLayout(2,1);
searchbyidframe.add(zz).setBackground(Color.LIGHT_GRAY);
searchbyidframe.add(zzz).setBackground(Color.LIGHT_GRAY);
searchbyidframe.setLocation(250, 50);
searchbyidframe.setLayout(x);
searchbyidframe.setSize(800, 600);
searchframe.setVisible(false);
By Habtamu Zeleke 32
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
searchbyidframe.setVisible(true);
searchbyidframe.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
if(tempbutton==back3){
searchbyidframe.setVisible(false);
searchframe.setVisible(true);
}
if(tempbutton==bsearchNameOfItem){
searchbynameframe=new JFrame("SEARCH MATERIAL BY NAME FROM JIT STORE");
lsearchname=new JLabel("WRITE NAME OF MATERIAL");
searchbyname=new JButton("SEARCH");
back4=new JButton("BACK");//////////////////////////////
t_searchbyname=new JTextField(10);
JPanel zz=new JPanel(new FlowLayout());
JPanel zzz=new JPanel();
zz.add(lsearchname);zz.add(t_searchbyname);
zzz.add(searchbyname); zzz.add(back4);
searchbyname.addActionListener(this);
back4.addActionListener(this);
GridLayout x = new GridLayout(2,1);
searchbynameframe.add(zz).setBackground(Color.LIGHT_GRAY);
searchbynameframe.add(zzz).setBackground(Color.LIGHT_GRAY);
searchbynameframe.setLocation(250,50);
searchbynameframe.setLayout(x);
searchbynameframe.setSize(800,600);
searchframe.setVisible(false);
searchbynameframe.setVisible(true);
searchbynameframe.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
By Habtamu Zeleke 33
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
if(tempbutton==back4){
searchbynameframe.setVisible(false);
searchframe.setVisible(true);
}
if(tempbutton==bsubmit){////////////////////////////////////registers item
try{
String id=t_id.getText();
String name=t_itemname.getText();
String model=t_itemmodel.getText();
int amount=Integer.parseInt(t_itemquantity.getText());
int price=Integer.parseInt(t_itemprice.getText());
int total=Integer.parseInt(t_totalprice.getText());
// String s6=t_totalprice.getText();
String day=(String)comb.getSelectedItem();
String month=(String)comb1.getSelectedItem();
String year=(String)comb2.getSelectedItem();
String reg_date=" ";
reg_date+=year+"-"+month+"-"+day;
Class.forName(driver);//1
con=DriverManager.getConnection(url, user, pass);//2
stm=con.createStatement();//3
String sql="Insert into store
values('"+(id)+"','"+(name)+"','"+(model)+"',"+(amount)+","+(price)+","+(total)+",'"+(reg_date)
+"')";
int result = stm.executeUpdate(sql);
t_id.setText("");
t_itemname.setText("");
t_itemmodel.setText("");
t_itemquantity.setText("");
By Habtamu Zeleke 34
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
t_itemprice.setText("");
t_totalprice.setText("");
if (result > 0) {
JOptionPane.showMessageDialog(this, "Successfully Saved!");
}
else {
JOptionPane.showMessageDialog(this, "Registration Is failed! Please Try again!!");
}
}
catch(Exception y){
JOptionPane.showMessageDialog(this,y.getMessage() );//y.getMessage()
}
finally{
try{ //Closing the connection
rs.close();
stm.close();
con.close();
}
catch(SQLException et){
System.out.println(et.toString());
}
}
}
if(tempbutton==bviewall){/////////////////////////////////////select all operation
final Vector columnNames=new Vector();
final Vector data=new Vector();
JPanel panell= new JPanel();
showframe=new JFrame("JIMMA INSTITUTE OF TECHNOLOGY STORE ");
exit2=new JButton("exit");
By Habtamu Zeleke 35
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
diplayback=new JButton("back");
try{
Class.forName(driver);
con=DriverManager.getConnection(url, user, pass);
stm=con.createStatement();
String sql = "select * from store";
rs= stm.executeQuery(sql);
ResultSetMetaData md = rs.getMetaData();
int columns=md.getColumnCount();
for(int i=1;i<=columns;i++){
columnNames.addElement(md.getColumnName(i));
}
while(rs.next()){
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++){
row.addElement(rs.getObject(i));
}
data.addElement(row);
}
showframe.setSize(650,400);
showframe.setVisible(true);
JTable table = new JTable(data, columnNames);
JScrollPane scrollPane = new JScrollPane(table);
exit2.addActionListener(this);
panell.add(scrollPane);
panell.add(exit2);
showframe.add(panell);
diplayback.addActionListener(this);
panell.add(diplayback);
By Habtamu Zeleke 36
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
}
catch(Exception y){
JOptionPane.showMessageDialog(this, y.getMessage());
}
finally{
try{ //Closing the connection
rs.close();
stm.close();
con.close();
}
catch(SQLException et){
System.out.println(et.toString());
}
}
}
if(tempbutton==exit2){
System.exit(0);
}
if(tempbutton==diplayback){
this.setVisible(false);
homepage.setVisible(true);
}
//
if(tempbutton==exit3){
System.exit(0);
}
if(tempbutton==b_delete){//delete operation
String id=t_itemid.getText();
String itemname=t_nametodelete.getText();
By Habtamu Zeleke 37
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
try{
Class.forName(driver);
con=DriverManager.getConnection(url, user, pass);
stm=con.createStatement();
String sql = "delete from store where id='"+id+"' and name='"+itemname+"' ";
int del = stm.executeUpdate(sql);
if (del > 0) {
JOptionPane.showMessageDialog(this, "ARE YOU SHURE WANT TO DELETE!");
JOptionPane.showMessageDialog(this, " Delete Is Successfully From store!");
}
else {
JOptionPane.showMessageDialog(this, "THERE IS NO MATERIAL IN THIS NAME AND
ID");
By Habtamu Zeleke 38
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
String si=t_searchid.getText();
final Vector columnNames=new Vector();
final Vector data=new Vector();
JPanel panell= new JPanel();
showframe=new JFrame();
exit3=new JButton("exit");
try{
Class.forName(driver);
con=DriverManager.getConnection(url, user, pass);
stm=con.createStatement();
String sql = "select * from store where id='"+si+"'";
rs = stm.executeQuery(sql);
ResultSetMetaData md = rs.getMetaData();
int columns=md.getColumnCount();
for(int i=1;i<=columns;i++){
columnNames.addElement(md.getColumnName(i));
}
while(rs.next()){
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++){
row.addElement(rs.getObject(i));
}
data.addElement(row);
}
showframe.setSize(650, 400);
showframe.setVisible(true);
JTable table = new JTable(data, columnNames);
JScrollPane scrollPane = new JScrollPane(table);
exit3.addActionListener(this);
By Habtamu Zeleke 39
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
panell.add(scrollPane);
panell.add(exit3);
showframe.add(panell);
JButton b1=new JButton("ok");
}
catch(ClassNotFoundException | SQLException y){
JOptionPane.showMessageDialog(this, y.getMessage());
}
finally{
try{ //Closing the connection
rs.close();
stm.close();
con.close();
}catch(SQLException et){
System.out.println(et.toString());
}
}
}
if(tempbutton==searchbyname){
String sname=t_searchbyname.getText();
final Vector columnNames=new Vector();
final Vector data=new Vector();
JPanel panell= new JPanel();
showframe=new JFrame();
try{
Class.forName(driver);
con=DriverManager.getConnection(url, user, pass);
stm=con.createStatement();
String sql ="select * from store where name='"+sname+"'";
By Habtamu Zeleke 40
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
rs = stm.executeQuery(sql);
ResultSetMetaData md = rs.getMetaData();
int columns=md.getColumnCount();
for(int i=1;i<=columns;i++){
columnNames.addElement(md.getColumnName(i));
}
while(rs.next()){
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++){
row.addElement(rs.getObject(i));
}
data.addElement(row);
}
showframe.setSize(650, 400);
showframe.setVisible(true);
JTable table = new JTable(data, columnNames);
JScrollPane scrollPane = new JScrollPane(table);
panell.add(scrollPane);
showframe.add(panell);
}
catch(ClassNotFoundException | SQLException y){
JOptionPane.showMessageDialog(this, y.getMessage());
}
finally{
try{ //Closing the connection
rs.close();
stm.close();
con.close();
}catch(SQLException et){
By Habtamu Zeleke 41
STORE MANAGEMENT SYSTEM TO JIT January 2017/2009
System.out.println(et.toString());
}
}}}}
By Habtamu Zeleke 42