Professional Documents
Culture Documents
i
ABSTRACT
Having good decision support is absolutely necessary nowadays because of the need
to improve and gain value. For any organization, it is vital to obtain accurate knowledge
of inventory level is key for staying in business and making it a profitable one. If inventory
tracking is not efficient would lead to major trouble in any business. For a business to
thrive, it is essential to find the ideal level of inventory where it can sufficiently meet demand
without under or overstocking value from anything it can. To understand the flow of any
business it is essential to ensure the profitability of the product and the performing level. To
make sense of what is happening and what had happened and to get important hints and
directions. The impediment in the normal Inventory valuation reports is to obtain support as
visualization to get a clear picture, in real time if possible and the solution used needs to be
very malleable. To ease in managing data we chose to use Elastic Stack to manage
organization data. The process of making sense of plain database is based on three big steps:
collect, process and use. In order to do so and to make sense of all of this, this project
proposes to use an Elastic Stack solution, also known as ELK (Elasticsearch , Logstash and
Kibana), to easily and rapidly manage and to search and to create dashboard for better sense
to extract valuable information to stand as decision support. In order to achieve that purpose
and obtain valuable information from data all components are used to process data and
analyze the result to offer support for decision making
The main goal of this system can be used to store the details of the inventory, stock
maintenance, update the inventory based on the sales details, generate sales and inventory
report daily or weekly based and to analyze and visualizing the report from the old plain
database not only helps the companies in their decision making but also in improving their
products and services.
ii
LIST OF FIGURES
LIST OF TABLES
CONTENTS
iii
Title Page No
Abstract……...……………………………………………………………………………...….i
List of Table…………………………………………………………………………………...vi
List of Figures……………………………………………………………………………...….vii
Chapter I: Introduction
1.1 Organization profile…………………………………………………..……….…..01
Chapter II: System Study
2.1Existing System ………………………………...………………….…….……......02
2.2 Problem Definition………………………………………………….…………….02
2.3Proposed System …………….……………………………………....….……........03
Chapter III: System Analysis and Feasibility Study
3.1Hardware Requirements…………...………………………………...………….....04
3.2 Software Requirements…………………...…………………………….................04
3.3 Software Description………………………………………..…….……...…….....05
3.4 Feasibility Study …………………………………..……..……………...…….....07
3.4.1 Economical feasibility ……………………………...………...…….....07
3.4.2 Operational Feasibility ………………………………...…….....07
3.4.3Technical Feasibility………………………………..…………...…….....08
Chapter X: Appendices-II
10.1Journal Publication….............................................................................................99
v
vi
I. INTRODUCTION
1
CHAPTER: II
SYSTEM ANALYSIS
System Analysis is a combined process dissecting the system responsibilities that
are based on the problem domain characteristics and user requirements it is a process of col-
lecting and interpreting facts, identifying the problems, and decomposition of a system into
its components.
System analysis is conducted for the purpose of studying a system or its parts in order to
identify its objectives. Analysis can also be a series of components that perform organic
functions together.
2
All information is not placed separately.
Proposed system is a software application which avoids more manual hours that need
to spend in record keeping and generating reports.
It is very easy to manage historical data in database. No specific training is required
for the employees to use this application. They can easily use the tool that decreases manual
hours spending for normal things and hence increases the performance. As the data is
centralized it is very easy to maintain the stocks of the various items in all godowns. Real
time tracking with elastic search in order to ensure the need is satisfied to user or client.Can
generate required reports in a visualization manner.Easy to take decision based on clear
report.To achieve that level of visibility.This helps to view the reports in an efficient manner.
ADVANTAGE:
The following are the advantages of proposed system
Easy to manage all the daily transactions
Can generate required reports easily
Easy to manage historical data in a secure manner
Centralized database helps in avoiding conflicts
Easy to use GUI that does not requires specific training
3
CHAPTER III
SYSTEM ANALYSIS AND FEASABILITY STUDY
3. SYSTEM ANALYSIS:
The system analysis is produced at the culmination of the analysis task. The function and
performance allocated to software as part of system engineering are refined by
establishing a complete information description as functional representation of system
behavior, an indication of performance requirements and design constraints, appropriate
validation criteria.
SYSTEM REQUIREMENT
4
3.3 SOFTWARE DESCRIPTION
JAVA SWING INTRODUCTION:
Java Swing or Swing was developed based on earlier APIs called Abstract Windows
Toolkit (AWT).Swing provides richer and more sophisticated GUI components than AWT.
The GUI components are ranging from a simple label to complex tree and table
Swing is platform independent and enhanced MVC (Model -View -Controller) frame-
work for Java application. Here are the most important features in Swing architecture.
Lightweight components:
o All swing components are lightweight except some top-level
containers.
o Lightweight means component renders or paints itself using
drawing primitives of the Graphics object instead of relying on
the host operating system (OS).
Simplified MVC:
o Swing uses simplified model-view-architecture (MVC) as the
core design behind each of its components called model-delegate.
o Based on this architecture, each swing component contains a
model and a UI delegate.
HIBERNATE FRAMEWORK
5
H2 Database
In many cases H2 is faster than other (open source and not open source) database
engines. Please note this is mostly a single connection benchmark run on one computer, with
many very simple operations running against the database. This benchmark does not include
very complex queries. The embedded mode of H2 is faster than the client-server mode be-
cause the per-statement overhead is greatly reduced.
FEATURES OF H2 DATABASE
It is an extremely fast database engine.
H2 is open source and written in java .
Elastic search
Elasticstack is open source they can easily afford. There is no need of the technical
expertise in-order to generate the report and to create a dashboard. The heart of the Elastic
stack is Elasticsearch. Elasticsearch is a search engine and it is based on top of Apache's
Lucene engine. Elasticsearch is easy to scale the business with total data size. Elasticsearch is
capable in indexing and searching. search tool. Elasticsearch makes an index of the content
and it looks to the indexes as opposed to the contents. There is number of tools to ingest data
into elasticsearch.Elastic Search is a robust search and analytics tool that stores data in a
document oriented data store. The most popular usage of ElasticSearch today is Log
Management The documented oriented storage differs sharply from traditional table oriented
RDBMS (Such as Oracle, MS SQL Server). With document oriented data storage, data is
stored as structured JSON (JavaScript Object Notation) documents. Every field is indexed by
default.
LOGSTASH
Logstash is the workhorse that collects the log files from Application Servers, parses
them, formats them and sends them to Elastic Search.We using Logstash tool to get data into
elasticsearch from the database. Elasticsearch is a content indexing web Thus, it is quick.
Logstash is a tool for managing and to Collect data, parse them, and store them for later use
(like, for searching). Logstash is an open source, server-side data processing pipeline. We can
use it to ingest data from multiple sources, transform it and send to the Elasticsearch.
Logstash can dynamically combine data from various sources and normalize the data into
destinations of your choice.
6
KIBANA
If we store them in Elasticsearch, we can view and analyze them with Kibana. The
Kibana web interface is an adjustable dashboard that we can stretch out and change to suit
our surroundings. It permits tables and diagrams creation and in addition complex
representations. The Kibana web interface utilizes the Apache Lucene question linguistic
structure to permit us to make inquiries.
3.4 FEASIBILITY STUDY
The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is to ensure
that the proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential. Three key
considerations involved in the feasibility analysis are
• OPERATIONAL FEASIBILITY
• ECONOMIC FEASIBILITY
• TECHNICAL FEASIBILITY
7
3.4.3 Technical Feasibility
The technical feasibility is used to explain the technical requirements of the
system in the current project, we mainly used open source tool. Which will show
8
CHAPTER IV
SYSTEM DESIGN
System Design involves identification of classes their relationship as well as their
collaboration. In objector, classes are divided into entity y classes and control classes. The
Computer Aided Software Engineering (CASE) tools that are available commercially do not
provide any assistance in this transition. CASE tools take advantage of Meta modeling that is
helpful only after the construction of the class diagram. In the FUSION method some object-
oriented approach likes Object Modeling Technique (OMT), Classes, and Responsibilities.
Collaborators (CRC), etc, are used. Objector used the term” agents” to represent some of the
hardware and software system. In Fusion method, there is no requirement phase, where a user
will supply the initial requirement document. Any software project is worked out by both the
analyst and the designer. The analyst creates the user case diagram. The designer creates the
class diagram. But the designer can do this only after the analyst creates the use case diagram.
Once the design is over, it is essential to decide which software is suitable for the application
9
4.1.1 ENTITY RELATIONSHIP DIAGRAM
Is a
Is a
Part
of
Part of
10
4.1.2 TABLE DESIGN :
11
Table Name :MachineMaster
Purpose :MachineMaster table is used to get machine details
13
4.1.3 Data Dictionary
14
23 Std Std of the customer
24 Pager Pager of the customer
4.1.4 NORMALIZATION
Normalization is a formal process for assigning attributes to entities.
It reduces and controls data redundancies .Helps eliminate data anomalies where
insertions, deletions, updates destroy the integrity of the database .At the conclusion
of this process the database will be logically correct
15
Second Normal Form
16
Fig 4.2.1Architecture Diagram
17
Fig 4.2.2.1: DFD level 0
18
Fig4.2.2.3:DFD level 2
19
model. To model a system the most important aspect is to capture the dynamic behavior
which has some internal or external factors for making the interaction. These internal or
external agents are known as actors. It consists of actors, use cases and their relationships. In
this fig we represent the Use Case diagram for our project.
4.2.3.1 Use case diagram:
A use case is a set of scenarios that describing an interaction between a user and a
system. A use case diagram displays the relationship among actors and use cases. The two
main components a user or another system that will interact with the system modeled. A use
case is an external view of the system that represents some action the user might perform in
order to complete a task.
20
diagrams .Typically used during analysis and design to document and understand the logical
flow of your system
21
Class diagram is a static diagram. It represents the static view of an application. Class
diagram is not only used for visualizing, describing, and documenting different aspects of a
system but also for constructing executable code of the software application.
22
4.2.3.4 ACTIVITY DIAGRAM
An activity diagram also called interaction diagram is an illustration of the
relationships and interaction among software objects in the Unified Modeling Language.
CHAPTER – V
23
SOFTWARE DEVELOPMENT
24
Systems design is the phase where system engineers analyze and understand the busi-
ness of the proposed system by studying the user requirements document. They figure out
possibilities and techniques by which the user requirements can be implemented. To analyze
and design the systems and products transformation. The nodejs is an open-source software
framework for dataflow programming across a range of tasks. It is a symbolic math library, and is
also used for developing web-applications . It is used for both research and production at
Google, Facebook often replacing its closed-source predecessor, not only that it can only
build a website to make it work for the smart it accept all to provide.
25
The project entitled that Inventory Management System explains each module in a detail
form. Every module has some operation to be performed in this project in the following
modules are follows.
Masters
Transaction
Reports
1. Master
Masters Module holds details of the following sub Modules and they are as follows
Customer Master:
This Customer Master holds the detail of customers. We can update, delete and
insert the Customer. Admin can access this customer master to add new customer ,and
admin can update customer details and even admin delete the customer.
Component Master:
This Component Master holds the detail of customers. We can update, delete and
insert the Component. Admin can access this customer master to add new customer ,and
admin can update customer details and even admin delete the customer.
Vendor Master:
This Vendor Master holds the detail of customers. We can update, delete and
insert the Component. . Admin can access this customer master to add new vendor,
and admin can update vendor details and even admin delete the vendor
Raw Master:
This Raw Master holds the detail of customers. We can update, delete and
insert the Raw Material details. . Admin can access this raw master to add new
raw ,and admin can update raw details and even admin delete the raw.
Mould Master:
This Mould Master holds the detail of customers. We can update, delete and
insert the Mould details. Admin can access this mould master to add new mould ,and
admin can update mould details and even admin delete the mould.
26
Machine Master:
This Machine Master holds the detail of customers. We can update, delete and
insert the Machine details. Admin can access this machine master to add new machine
,and admin can update machine details and even admin delete the machine.
This Purchase Order Master holds the detail of customers. We can update,
delete and insert the Purchase Order details. Admin can access this purchase order
master to add new purchase ,and admin can update purchase details and even admin
delete the purchase order
Transaction:
This Module describes the transaction between customer ,vendor and organization.
Purchase Order
This module describes the client purchase details depending on the material they
choose sub module is triggered
Raw Material:
If the customer has their own material then the material cost is
excluded and following receipt will be generated.
Casting:
If the customer chose to buy raw material from vendor this module will
be executed.
Reports:
This module is to generate the reports in an visualization manner to otrack the
organization bussinessflow to understand what is happening in an environment.
27
CHAPTER VI
TESTING
6.1 TESTING ON APPLICATION PART
Validation is the process of evaluating the final product to check whether the software
meets the business needs. In simple words, the test execution which we do in our day to day
life is actually the validation activity which includes smoke testing, functional testing,
regression testing, systems testing etc…
28
6.1.3 INTEGRATION TESTING:
Interrupt testing is a process of testing a mobile application that functions may get
interrupted while using the application. Those interruptions can be; incoming and outgoing
SMS/MMS/calls, incoming notifications, battery/cable insertion and removal for better uses,
network outage and recovery, switch off/switch on of the media player and other connecting
devices, Low memory warning, and device power cycle (like; low battery notification).
An application should be capable to hold these interruptions by going into a suspended state
and restarting afterwards.
Unit testing is a software development process in which the smallest testable parts of
an application, called units, are individually and independently scrutinized for proper
operation. The testing process makes sure that the mobile app is now easy to use and offers a
suitable user experience to the customers.
Mobile devices hold two types of applications; the one which automatically comes
with mobile OS (while installing OS, it automatically get installed), and another one you have
to install specially from the store to use the particular application.Installation testing is used
to test the particular application is installing, uninstalling, and updating properly without any
interruption (user is smoothly and flexibly installing the application).
29
CHAPTER VII
SYSTEM IMPLEMENTATION
7.1. INTRODUCTION
It is the process of bringing developed system into operational use. If the
implementation phase is not carefully planned and controlled, it can be lead to many critical
problems. Thus proper implementation is essential to provide a reliable system to meet
managerial requirements.
Implementation is one of the most important tasks in project. Implementation is the
phase, in which one has to be cautions, because all the efforts undertaken during the project
will be fruitful only if the tool is properly implemented according to the plans made.
The implementation phase is less creative than system design. It is primarily
concerned with user training; site preparation and file-sites, the test of the network along with
the system are also included under implementation.
Depending on the nature of the system extensive user training maybe required
programming is itself a design works. The initial parameters of the management information
system should be modified as a result of programming efforts. Programming provides a real
test for the assumption made by the analyst.
Implementation is used here to mean the process of converting a new or revised
system into an operation one. Here the new system is implemented to an operational use.
Maintenance is far more than fixing mistakes. The maintenance can be defined using four
activities that are undertaken after a program is released for use.
The second activity that contribute to a definition of maintenance occurs because of
the rapid change that encountered in every aspect of computing. Adaptive maintenance – as
activity that modifies software to properly interface with a changing environment – is both
necessary and common place.
The third activity that may be applied to definition of maintenance occurs when
software package is successful. As the software is used new recommendations for new
capabilities, modifications to existing function and general enhancements are received from
the user, to satisfy this request perceptive maintenance is used.
The fourth maintenance activity occurs when software is changed to improve future
maintainability or reliability, or to provide a better basic for future enhancements. This is
often called preventive maintenance, which is characterized by reverse engineering and
reengineering technique.
30
7.2. IMPLEMENTATION
The system has been tested in the location of the developer. But it is not possible to
find all errors here. It may be that even after through testing the user will find errors. In such
a case the user when reports the errors it is possible to correct those errors as that coding has
been documents and it is possible to find out the location where the error is occurring and the
reason for error can be analyzed and corrected. This developed system supports for corrective
maintenance.
As this software can be run with the requirements given above and it does not
involve any particular hardware as such and it can be run with the rapid development that is
being encountered in the computer industry. If there is a need to include any new modules
then it has been externally and then includes to it with the exits architecture. But up to now
the system holds all the possible reports generation tools, which a team needs. Later on it
correspondence with this limitation may upgrade the system. In the process of coding, the
lines of code keep multiplying, thus, size of the software increases. Gradually, it becomes
next to impossible to remember the flow of program. If one forgets how software and its
underlying programs, files, procedures are constructed it then becomes very difficult to share,
debug and modify the program. The solution to this is structured programming. It encourages
the developer to use subroutines and loops instead of using simple jumps in the code, thereby
bringing clarity in the code and improving its efficiency Structured programming also helps
programmer to reduce coding time and organize code properly.
During implementation, the project team creates the actual product. Product
implementation can be an exciting phase for the customer, because their idea for the project
becomes something tangible. Project developers begin building and coding the software.
The objective of the Implementation Phase is: first to install the system in the produc-
tion environment and to bring it into operation; and second, to ensure that the system, as de-
veloped:
31
CHAPTER VIII
8.3 CONCLUSION:
It has every basic items which are used for the small organization. Our team is
successful in making the application where we can update insert and delete the item as per
their requirements. This application also provides a simple report on daily basis to know the
daily sales and purchase details. This application matches for small organization where the
small limited through it has some will surely benefit the organization. This system helps
organization to achieve level of visibility and flow of any business it is essential to ensure
the profitability of the product and the performing level. To make sense of what is
happening and what had happened and to get important hints and directions.
32
SAMPLE CODE:
Component Master
package com.inventory.frames;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import javax.swing.JComboBox;
import java.awt.Color;
import java.awt.SystemColor;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.fasterxml.classmate.members.RawConstructor;
import com.inventory.model.ComponentModel;
import com.inventory.model.CustomerModel;
import com.inventory.model.MouldModel;
import com.inventory.model.RawModel;
import javax.swing.JTextField;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTable;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
33
import java.util.Date;
import java.util.List;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JScrollPane;
34
private JComboBox cusCombo;
private JComboBox rawCombo;
private JButton button;
private JButton button_1;
private JButton button_2;
private JLabel rawName;
private JLabel cusName;
private JScrollPane scrollPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
ComponentMaster frame = new
ComponentMaster();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public ComponentMaster() {
setTitle("Component Master");
addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent arg0) {
35
DefaultComboBoxModel coModel =
(DefaultComboBoxModel) cusCombo.getModel();
coModel.addElement(customerModel1.getCode());
cusCombo.setModel(coModel);
/*
* session.getTransaction().commit(); //session.flush();
* session.close(); sessionFactory.close();
*
*
* SessionFactory sessionFactory1 = new
* Configuration().configure().buildSessionFactory();
Session
* session1 = sessionFactory1.openSession();
* session1.beginTransaction();
*/
List<RawModel> raw = session.createQuery(" from
RawModel ").list();
// System.out.println(customerModel.get());
DefaultComboBoxModel model =
(DefaultComboBoxModel) rawCombo.getModel();
// DefaultComboBoxModel
model=(DefaultComboBoxModel)
// comboBox.getModel();
// coModel.removeAllElements();
for (RawModel rawModel : raw) {
// System.out.println("helllo");
model.addElement(rawModel.getCode());
rawCombo.setModel(model);
36
// System.out.println(customerModel.get());
DefaultComboBoxModel model1 =
(DefaultComboBoxModel) mouldCombo.getModel();
model1.addElement(mouldModel.getMouldCode());
mouldCombo.setModel(model1);
session.getTransaction().commit();
// session.flush();
session.close();
sessionFactory.close();
@Override
public void windowClosed(WindowEvent arg0) {
}
});
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 998, 772);
contentPane = new JPanel();
contentPane.setBackground(SystemColor.control);
contentPane.setBorder(new EmptyBorder(0, 0, 0, 0));
setContentPane(contentPane);
contentPane.setLayout(null);
37
cusCombo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
cusName.setText(customerModel.getName());
session.getTransaction().commit();
session.close();
sessionFactory.close();
}
});
cusCombo.setBackground(SystemColor.window);
cusCombo.setBounds(211, 68, 86, 20);
contentPane.add(cusCombo);
38
RawModel rawModel = (RawModel)
session.get(RawModel.class, rawCombo.getSelectedItem().toString());
rawName.setText(rawModel.getDes());
session.getTransaction().commit();
session.close();
sessionFactory.close();
}
});
rawCombo.setBackground(Color.WHITE);
rawCombo.setBounds(211, 111, 86, 20);
contentPane.add(rawCombo);
39
JLabel lblPartCode = new JLabel("Part Code");
lblPartCode.setFont(new Font("Times New Roman", Font.BOLD,
14));
lblPartCode.setBounds(482, 191, 61, 17);
contentPane.add(lblPartCode);
40
norm1.setText("0");
norm1.setFont(new Font("Monospaced", Font.PLAIN, 14));
norm1.setColumns(10);
norm1.setBounds(48, 314, 115, 28);
contentPane.add(norm1);
41
from3 = new JTextField();
from3.setFont(new Font("Monospaced", Font.PLAIN, 14));
from3.setColumns(10);
from3.setBounds(194, 397, 115, 28);
contentPane.add(from3);
42
contentPane.add(lblAmortiosationQty);
43
packMode = new JComboBox();
packMode.setModel(new DefaultComboBoxModel(new String[]
{ "Tray", "Gunny Bag", "Box", "Bag" }));
packMode.setBackground(Color.WHITE);
packMode.setBounds(400, 516, 110, 20);
contentPane.add(packMode);
mouldCombo.getSelectedItem().toString());
mouldName.setText(mouldModel.getMouldName());
session.getTransaction().commit();
session.close();
sessionFactory.close();
44
}
});
mouldCombo.setBackground(Color.WHITE);
mouldCombo.setBounds(123, 553, 132, 20);
contentPane.add(mouldCombo);
mouldName = new JLabel("");
mouldName.setFont(new Font("Monospaced", Font.PLAIN, 14));
mouldName.setBackground(Color.WHITE);
mouldName.setBounds(273, 556, 280, 20);
contentPane.add(mouldName);
// to save
@SuppressWarnings("deprecation")
public void actionPerformed(ActionEvent arg0) {
// String date =
//
DateFormat.getDateInstance().format(amFrom.getText());
componentModel.setcCode(cusCombo.getSelectedItem().toString());
componentModel.setcName(cusName.getText());
componentModel.setRawCode(rawCombo.getSelectedItem().toString());
45
componentModel.setRawName(rawName.getText());
componentModel.setComponenetName(comName.getText());
componentModel.setCompPartno(Long.parseLong(comPartno.getText()));
componentModel.setPartCode(comPartCode.getText());
componentModel.setHsnCode(hsnCode.getText());
componentModel.setMouldCode(hsnCode.getText());
componentModel.setFrom1(new
Date(from1.getText()));
if (!from2.getText().isEmpty()) {
componentModel.setFrom2(new
Date(from2.getText()));
}
if (!from3.getText().isEmpty()) {
componentModel.setFrom3(new
Date(from3.getText()));
}
if (!from4.getText().isEmpty()) {
componentModel.setFrom4(new
Date(from4.getText()));
}
if (!to1.getText().isEmpty()) {
componentModel.setTo1(new
Date(to1.getText()));
}
if (!to2.getText().isEmpty()) {
componentModel.setTo2(new
Date(to2.getText()));
}
if (!to3.getText().isEmpty()) {
componentModel.setTo3(new
Date(to3.getText()));
}
46
if (!to4.getText().isEmpty()) {
componentModel.setTo4(new
Date(to4.getText()));
}
componentModel.setNorm1(Long.parseLong(norm1.getText()));
if (!norm2.getText().isEmpty()) {
componentModel.setNorm2(Long.parseLong(norm2.getText()));
}
if (!norm3.getText().isEmpty()) {
componentModel.setNorm3(Long.parseLong(norm3.getText()));
}
if (!norm4.getText().isEmpty()) {
componentModel.setNorm4(Long.parseLong(norm4.getText()));
}
// componentModel.setTo1(new Date(to1.getText()));
componentModel.setAmValue(Long.parseLong(aValue.getText()));
componentModel.setAmFrom(new
Date(amFrom.getText()));
componentModel.setAmQty(Long.parseLong(amQty.getText()));
componentModel.setFettlingRate(Long.parseLong(fRate.getText()));
componentModel.setNoCavities(Long.parseLong(noCav.getText()));
componentModel.setMouldCode(mouldCombo.getSelectedItem().toString());
componentModel.setMouldName(mouldName.getText());
componentModel.setPackMode(packMode.getSelectedItem().toString());
session.save(componentModel);
session.getTransaction().commit();
47
JOptionPane.showMessageDialog(null, "saved");
session.close();
sessionFactory.close();
@SuppressWarnings("unchecked")
List<ComponentModel> products =
session1.createQuery("from ComponentModel").list();
48
tableHeaders.add("mould name");
// tableHeaders.add("name");
for (Object o : products) {
ComponentModel model = (ComponentModel)
o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getcCode());
oneRow.add(model.getcName());
oneRow.add(model.getRawCode());
oneRow.add(model.getRawName());
oneRow.add(model.getComponenetName());
oneRow.add(model.getCompPartno());
oneRow.add(model.getPartCode());
oneRow.add(model.getHsnCode());
oneRow.add(model.getNorm1());
oneRow.add(model.getNorm2());
oneRow.add(model.getNorm3());
oneRow.add(model.getNorm4());
oneRow.add(model.getFrom1());
oneRow.add(model.getFrom2());
oneRow.add(model.getFrom3());
oneRow.add(model.getFrom4());
oneRow.add(model.getTo1());
oneRow.add(model.getTo2());
oneRow.add(model.getTo3());
oneRow.add(model.getTo4());
oneRow.add(model.getAmValue());
oneRow.add(model.getAmFrom());
oneRow.add(model.getAmQty());
oneRow.add(model.getFettlingRate());
oneRow.add(model.getPackMode());
oneRow.add(model.getNoCavities());
oneRow.add(model.getMouldCode());
oneRow.add(model.getMouldName());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session1.getTransaction().commit();
49
session1.close();
sessionFactory1.close();
}
});
button.setIcon(new
ImageIcon(ComponentMaster.class.getResource("/inventory/save.png")));
button.setFont(new Font("Tahoma", Font.BOLD, 14));
button.setBounds(10, 0, 102, 29);
contentPane.add(button);
componentModel.setcCode(cusCombo.getSelectedItem().toString());
componentModel.setcName(cusName.getText());
componentModel.setRawCode(rawCombo.getSelectedItem().toString());
componentModel.setRawName(rawName.getText());
componentModel.setComponenetName(comName.getText());
componentModel.setCompPartno(Long.parseLong(comPartno.getText()));
componentModel.setPartCode(comPartCode.getText());
componentModel.setHsnCode(hsnCode.getText());
componentModel.setMouldCode(hsnCode.getText());
/*
* Date str = new Date(from1.getText()); String
* s=from1.getText(); String newString = s.replace('/',
'X');
*
* componentModel.setFrom1(new Date();
50
*/
componentModel.setFrom1(new
Date(from1.getText()));
componentModel.setFrom2(new
Date(from2.getText()));
componentModel.setFrom3(new
Date(from3.getText()));
componentModel.setFrom4(new
Date(from4.getText()));
componentModel.setNorm1(Long.parseLong(norm1.getText()));
componentModel.setNorm2(Long.parseLong(norm2.getText()));
componentModel.setNorm3(Long.parseLong(norm3.getText()));
componentModel.setNorm4(Long.parseLong(norm4.getText()));
componentModel.setTo1(new Date(to1.getText()));
componentModel.setTo2(new Date(to2.getText()));
componentModel.setTo3(new Date(to3.getText()));
componentModel.setTo4(new Date(to4.getText()));
componentModel.setAmValue(Long.parseLong(aValue.getText()));
componentModel.setAmFrom(new
Date(amFrom.getText()));
componentModel.setAmQty(Long.parseLong(amQty.getText()));
componentModel.setFettlingRate(Long.parseLong(fRate.getText()));
componentModel.setNoCavities(Long.parseLong(noCav.getText()));
componentModel.setMouldCode(mouldCombo.getSelectedItem().toString());
componentModel.setMouldName(mouldName.getText());
componentModel.setPackMode(packMode.getSelectedItem().toString());
session.update(componentModel);
session.getTransaction().commit();
session.close();
sessionFactory.close();
51
SessionFactory sessionFactory1 = new
Configuration().configure().buildSessionFactory();
Session session1 = sessionFactory1.openSession();
session1.beginTransaction();
@SuppressWarnings("unchecked")
List<ComponentModel> products =
session1.createQuery("from ComponentModel").list();
// tableHeaders.add("name");
for (Object o : products) {
52
ComponentModel model = (ComponentModel)
o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getcCode());
oneRow.add(model.getcName());
oneRow.add(model.getRawCode());
oneRow.add(model.getRawName());
oneRow.add(model.getComponenetName());
oneRow.add(model.getCompPartno());
oneRow.add(model.getPartCode());
oneRow.add(model.getHsnCode());
oneRow.add(model.getNorm1());
oneRow.add(model.getNorm2());
oneRow.add(model.getNorm3());
oneRow.add(model.getNorm4());
oneRow.add(model.getFrom1());
oneRow.add(model.getFrom2());
oneRow.add(model.getFrom3());
oneRow.add(model.getFrom4());
oneRow.add(model.getTo1());
oneRow.add(model.getTo2());
oneRow.add(model.getTo3());
oneRow.add(model.getTo4());
oneRow.add(model.getAmValue());
oneRow.add(model.getAmFrom());
oneRow.add(model.getAmQty());
oneRow.add(model.getFettlingRate());
oneRow.add(model.getPackMode());
oneRow.add(model.getNoCavities());
oneRow.add(model.getMouldCode());
oneRow.add(model.getMouldName());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session1.close();
sessionFactory1.close();
53
});
button_1.setIcon(new
ImageIcon(ComponentMaster.class.getResource("/inventory/view all.png")));
button_1.setFont(new Font("Tahoma", Font.BOLD, 14));
button_1.setBounds(112, 0, 116, 29);
contentPane.add(button_1);
componentModel.setPartCode(comPartCode.getText());
session.delete(componentModel);
session.getTransaction().commit();
session.close();
sessionFactory.close();
@SuppressWarnings("unchecked")
List<ComponentModel> products =
session1.createQuery("from ComponentModel").list();
54
tableHeaders.add("hsn/sac code");
tableHeaders.add("norm 1");
tableHeaders.add("norm 2");
tableHeaders.add("norm 3");
tableHeaders.add("norm4");
tableHeaders.add("from date1");
tableHeaders.add("from date 2");
tableHeaders.add("from date 3");
tableHeaders.add("from date 4");
tableHeaders.add("to date 1");
tableHeaders.add("to datte 2");
tableHeaders.add("to date 3");
tableHeaders.add("to datte 4");
tableHeaders.add("amortisation value");
tableHeaders.add("amortisation from date");
tableHeaders.add("amortisation qty");
tableHeaders.add("fettling rate");
tableHeaders.add("packing mode");
tableHeaders.add("no of cavities");
tableHeaders.add("mould code");
tableHeaders.add("mould name");
// tableHeaders.add("name");
for (Object o : products) {
ComponentModel model = (ComponentModel)
o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getcCode());
oneRow.add(model.getcName());
oneRow.add(model.getRawCode());
oneRow.add(model.getRawName());
oneRow.add(model.getComponenetName());
oneRow.add(model.getCompPartno());
oneRow.add(model.getPartCode());
oneRow.add(model.getHsnCode());
oneRow.add(model.getNorm1());
oneRow.add(model.getNorm2());
oneRow.add(model.getNorm3());
oneRow.add(model.getNorm4());
oneRow.add(model.getFrom1());
oneRow.add(model.getFrom2());
oneRow.add(model.getFrom3());
55
oneRow.add(model.getFrom4());
oneRow.add(model.getTo1());
oneRow.add(model.getTo2());
oneRow.add(model.getTo3());
oneRow.add(model.getTo4());
oneRow.add(model.getAmValue());
oneRow.add(model.getAmFrom());
oneRow.add(model.getAmQty());
oneRow.add(model.getFettlingRate());
oneRow.add(model.getPackMode());
oneRow.add(model.getNoCavities());
oneRow.add(model.getMouldCode());
oneRow.add(model.getMouldName());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session1.getTransaction().commit();
session1.close();
sessionFactory1.close();
}
});
button_2.setIcon(new
ImageIcon(ComponentMaster.class.getResource("/inventory/delete.png")));
button_2.setFont(new Font("Tahoma", Font.BOLD, 14));
button_2.setBounds(228, 0, 102, 29);
contentPane.add(button_2);
@SuppressWarnings("unchecked")
56
List<ComponentModel> products =
session.createQuery("from ComponentModel").list();
// tableHeaders.add("name");
for (Object o : products) {
ComponentModel model = (ComponentModel)
o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getcCode());
oneRow.add(model.getcName());
57
oneRow.add(model.getRawCode());
oneRow.add(model.getRawName());
oneRow.add(model.getComponenetName());
oneRow.add(model.getCompPartno());
oneRow.add(model.getPartCode());
oneRow.add(model.getHsnCode());
oneRow.add(model.getNorm1());
oneRow.add(model.getNorm2());
oneRow.add(model.getNorm3());
oneRow.add(model.getNorm4());
oneRow.add(model.getFrom1());
oneRow.add(model.getFrom2());
oneRow.add(model.getFrom3());
oneRow.add(model.getFrom4());
oneRow.add(model.getTo1());
oneRow.add(model.getTo2());
oneRow.add(model.getTo3());
oneRow.add(model.getTo4());
oneRow.add(model.getAmValue());
oneRow.add(model.getAmFrom());
oneRow.add(model.getAmQty());
oneRow.add(model.getFettlingRate());
oneRow.add(model.getPackMode());
oneRow.add(model.getNoCavities());
oneRow.add(model.getMouldCode());
oneRow.add(model.getMouldName());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session.getTransaction().commit();
session.close();
sessionFactory.close();
}
});
btnNewButton.setBounds(334, 0, 109, 29);
contentPane.add(btnNewButton);
58
public void actionPerformed(ActionEvent e) throws
java.lang.NullPointerException {
cusCombo.setSelectedItem(model.getValueAt(index,
0).toString());
cusName.setText(model.getValueAt(index,
1).toString());
rawCombo.setSelectedItem(model.getValueAt(index,
2).toString());
rawName.setText(model.getValueAt(index,
3).toString());
comName.setText(model.getValueAt(index,
4).toString());
comPartno.setText(model.getValueAt(index,
5).toString());
comPartCode.setText(model.getValueAt(index,
6).toString());
hsnCode.setText(model.getValueAt(index,
7).toString());
norm1.setText(model.getValueAt(index,
8).toString());
norm2.setText(model.getValueAt(index,
9).toString());
norm3.setText(model.getValueAt(index,
10).toString());
norm4.setText(model.getValueAt(index,
11).toString());
59
String from12 = str1.replace('-', '/');
from2.setText(from12);
aValue.setText(model.getValueAt(index,
20).toString());
60
fRate.setText(model.getValueAt(index,
23).toString());
packMode.setSelectedItem(model.getValueAt(index,
24).toString());
noCav.setText(model.getValueAt(index,
25).toString());
mouldCombo.setSelectedItem(model.getValueAt(index, 26).toString());
mouldName.setText(model.getValueAt(index,
27).toString());
// session.getTransaction().commit();
// session.close();
// sessionFactory.close();
}
});
btnNewButton_1.setIcon(new
ImageIcon(ComponentMaster.class.getResource("/inventory/viw.png")));
btnNewButton_1.setBounds(863, 661, 89, 40);
contentPane.add(btnNewButton_1);
}
}
Customer Detail
package com.inventory.frames;
import java.awt.Component;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.FlowLayout;
import javax.swing.JLabel;
import com.jgoodies.forms.layout.FormLayout;
import com.inventory.model.CustomerModel;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import net.proteanit.sql.DbUtils;
import com.jgoodies.forms.layout.FormSpecs;
61
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
//import org.hibernate.mapping.List;
import javax.swing.JTextArea;
import javax.swing.JScrollBar;
import javax.swing.JSeparator;
import javax.swing.JTable;
import java.awt.event.ActionListener;
import java.util.List;
import java.util.Vector;
import java.awt.event.ActionEvent;
import javax.persistence.Query;
import javax.swing.JButton;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import java.awt.Color;
62
public JTextField fax;
public JTextField factory;
public JTextField mobile;
public JTextField pager;
public JTextField email;
public JTextField url;
public JTextField pan;
public JTextField ecc;
public JTextField gst;
public JTextField vendor;
public JTextField div;
public JTextField range;
public JTextField std;
private JTextField textField_15;
private final JSeparator separator_4 = new JSeparator();
private final JSeparator separator_5 = new JSeparator();
public JTextArea deliver;
public JTextArea remarks;
private JTable table;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
CustomerForm window = new
CustomerForm();
window.frmCustomerDetail.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public CustomerForm() {
initialize();
}
63
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmCustomerDetail = new JFrame();
frmCustomerDetail.getContentPane().setFont(new Font("Times
New Roman", Font.BOLD, 16));
frmCustomerDetail.setTitle("Customer Detail");
frmCustomerDetail.setBounds(250, 250, 931, 772);
frmCustomerDetail.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frmCustomerDetail.getContentPane().setLayout(null);
64
JLabel lblContact = new JLabel("Contact");
lblContact.setFont(new Font("Times New Roman", Font.BOLD,
18));
lblContact.setBounds(10, 221, 73, 14);
frmCustomerDetail.getContentPane().add(lblContact);
65
city.setBounds(399, 217, 159, 26);
frmCustomerDetail.getContentPane().add(city);
66
lblDestination.setBounds(424, 113, 89, 22);
frmCustomerDetail.getContentPane().add(lblDestination);
67
lblFactory.setBounds(519, 323, 59, 22);
frmCustomerDetail.getContentPane().add(lblFactory);
68
frmCustomerDetail.getContentPane().add(pager);
69
JLabel lblGstNo = new JLabel("GST no");
lblGstNo.setFont(new Font("Times New Roman", Font.BOLD,
18));
lblGstNo.setBounds(10, 570, 60, 22);
frmCustomerDetail.getContentPane().add(lblGstNo);
70
div.setFont(new Font("Times New Roman", Font.PLAIN, 16));
div.setColumns(10);
div.setBounds(727, 534, 124, 29);
frmCustomerDetail.getContentPane().add(div);
71
JScrollPane scrollPane = new JScrollPane();
scrollPane.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
}
});
scrollPane.setBounds(10, 611, 879, 122);
frmCustomerDetail.getContentPane().add(scrollPane);
customerModel.setContact(Long.parseLong(contact.getText()));
customerModel.setDelivered(deliver.getText());
customerModel.setDesignation(designation.getText());
customerModel.setDestiation(destination.getText());
customerModel.setDiv(div.getText());
customerModel.setEcc(ecc.getText());
customerModel.setEmail(email.getText());
customerModel.setFactory(Long.parseLong(factory.getText()));
customerModel.setFax(Long.parseLong(fax.getText()));
customerModel.setGst(gst.getText());
72
customerModel.setMobile(Long.parseLong(mobile.getText()));
customerModel.setName(name.getText());
customerModel.setOffice(Long.parseLong(office.getText()));
customerModel.setPager(Long.parseLong(pager.getText()));
customerModel.setPan(pan.getText());
customerModel.setPinCode(Long.parseLong(pincode.getText()));
customerModel.setRange(range.getText());
customerModel.setRemarks(remarks.getText());
customerModel.setStd(std.getText());
customerModel.setUrl(url.getText());
customerModel.setVendor(vendor.getText());
if (address.getText().length() == 0) {
JOptionPane.showMessageDialog(null,
"valuue");
}
JOptionPane.showMessageDialog(null, "saved");
session.save(customerModel);
@SuppressWarnings("unchecked")
List<CustomerModel> products =
session.createQuery("from CustomerModel").list();
73
tableHeaders.add("fax");
tableHeaders.add("gst");
tableHeaders.add("pincode");
tableHeaders.add("remarks");
tableHeaders.add("office");
tableHeaders.add("mobile");
tableHeaders.add("pager");
tableHeaders.add("pan");
tableHeaders.add("std");
tableHeaders.add("url");
tableHeaders.add("vendor");
tableHeaders.add("range");
// tableHeaders.add("name");
for (Object o : products) {
CustomerModel model = (CustomerModel) o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getCode());
oneRow.add(model.getName());
oneRow.add(model.getAddress());
oneRow.add(model.getCity());
oneRow.add(model.getContact());
oneRow.add(model.getDelivered());
oneRow.add(model.getDesignation());
oneRow.add(model.getDestiation());
oneRow.add(model.getDiv());
oneRow.add(model.getEcc());
oneRow.add(model.getEmail());
oneRow.add(model.getFactory());
oneRow.add(model.getFax());
oneRow.add(model.getGst());
oneRow.add(model.getPinCode());
oneRow.add(model.getRemarks());
oneRow.add(model.getOffice());
oneRow.add(model.getMobile());
oneRow.add(model.getPager());
oneRow.add(model.getPan());
oneRow.add(model.getStd());
oneRow.add(model.getUrl());
oneRow.add(model.getVendor());
oneRow.add(model.getRange());
74
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session.getTransaction().commit();
session.close();
sessionFactory.close();
}
});
75
tableHeaders.add("div");
tableHeaders.add("ecc");
tableHeaders.add("email");
tableHeaders.add("factory");
tableHeaders.add("fax");
tableHeaders.add("gst");
tableHeaders.add("pincode");
tableHeaders.add("remarks");
tableHeaders.add("office");
tableHeaders.add("mobile");
tableHeaders.add("pager");
tableHeaders.add("pan");
tableHeaders.add("std");
tableHeaders.add("url");
tableHeaders.add("vendor");
tableHeaders.add("range");
// tableHeaders.add("name");
for (Object o : products) {
CustomerModel model = (CustomerModel) o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getCode());
oneRow.add(model.getName());
oneRow.add(model.getAddress());
oneRow.add(model.getCity());
oneRow.add(model.getContact());
oneRow.add(model.getDelivered());
oneRow.add(model.getDesignation());
oneRow.add(model.getDestiation());
oneRow.add(model.getDiv());
oneRow.add(model.getEcc());
oneRow.add(model.getEmail());
oneRow.add(model.getFactory());
oneRow.add(model.getFax());
oneRow.add(model.getGst());
oneRow.add(model.getPinCode());
oneRow.add(model.getRemarks());
oneRow.add(model.getOffice());
oneRow.add(model.getMobile());
oneRow.add(model.getPager());
oneRow.add(model.getPan());
oneRow.add(model.getStd());
76
oneRow.add(model.getUrl());
oneRow.add(model.getVendor());
oneRow.add(model.getRange());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session.getTransaction().commit();
session.flush();
session.close();
sessionFactory.close();
}
});
mntmViewalll.setIcon(new
ImageIcon(CustomerForm.class.getResource("/inventory/view all.png")));
mntmViewalll.setFont(new Font("Arial", Font.BOLD, 14));
mntmViewalll.setBounds(92, 4, 198, 29);
frmCustomerDetail.getContentPane().add(mntmViewalll);
customerModel.setContact(Long.parseLong(contact.getText()));
customerModel.setDelivered(deliver.getText());
customerModel.setDesignation(designation.getText());
customerModel.setDestiation(destination.getText());
customerModel.setDiv(div.getText());
customerModel.setEcc(ecc.getText());
customerModel.setEmail(email.getText());
77
customerModel.setFactory(Long.parseLong(factory.getText()));
customerModel.setFax(Long.parseLong(fax.getText()));
customerModel.setGst(gst.getText());
customerModel.setMobile(Long.parseLong(mobile.getText()));
customerModel.setName(name.getText());
customerModel.setOffice(Long.parseLong(office.getText()));
customerModel.setPager(Long.parseLong(pager.getText()));
customerModel.setPan(pan.getText());
customerModel.setPinCode(Long.parseLong(pincode.getText()));
customerModel.setRange(range.getText());
customerModel.setRemarks(remarks.getText());
customerModel.setStd(std.getText());
customerModel.setUrl(url.getText());
customerModel.setVendor(vendor.getText());
session.update(customerModel);
session.getTransaction().commit();
@SuppressWarnings("unchecked")
List<CustomerModel> products =
session.createQuery("from CustomerModel").list();
// tableHeaders.add("name");
for (Object o : products) {
CustomerModel model = (CustomerModel) o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getCode());
oneRow.add(model.getName());
oneRow.add(model.getAddress());
oneRow.add(model.getCity());
oneRow.add(model.getContact());
oneRow.add(model.getDelivered());
oneRow.add(model.getDesignation());
oneRow.add(model.getDestiation());
oneRow.add(model.getDiv());
oneRow.add(model.getEcc());
oneRow.add(model.getEmail());
oneRow.add(model.getFactory());
oneRow.add(model.getFax());
oneRow.add(model.getGst());
oneRow.add(model.getPinCode());
oneRow.add(model.getRemarks());
oneRow.add(model.getOffice());
oneRow.add(model.getMobile());
oneRow.add(model.getPager());
oneRow.add(model.getPan());
oneRow.add(model.getStd());
oneRow.add(model.getUrl());
oneRow.add(model.getVendor());
oneRow.add(model.getRange());
79
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
JOptionPane.showMessageDialog(null, "updated");
// it will close the particular session after completing
the
// process
session.flush();
session.close();
sessionFactory.close();
}
});
mntmUpdate.setIcon(new
ImageIcon(CustomerForm.class.getResource("/inventory/update.png")));
mntmUpdate.setFont(new Font("Arial", Font.BOLD, 14));
mntmUpdate.setBounds(290, 4, 129, 29);
frmCustomerDetail.getContentPane().add(mntmUpdate);
80
tableHeaders.add("city");
tableHeaders.add("contact");
tableHeaders.add("deliver");
tableHeaders.add("designation");
tableHeaders.add("destination");
tableHeaders.add("div");
tableHeaders.add("ecc");
tableHeaders.add("email");
tableHeaders.add("factory");
tableHeaders.add("fax");
tableHeaders.add("gst");
tableHeaders.add("pincode");
tableHeaders.add("remarks");
tableHeaders.add("office");
tableHeaders.add("mobile");
tableHeaders.add("pager");
tableHeaders.add("pan");
tableHeaders.add("std");
tableHeaders.add("url");
tableHeaders.add("vendor");
tableHeaders.add("range");
// tableHeaders.add("name");
for (Object o : products) {
CustomerModel model = (CustomerModel) o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getCode());
oneRow.add(model.getName());
oneRow.add(model.getAddress());
oneRow.add(model.getCity());
oneRow.add(model.getContact());
oneRow.add(model.getDelivered());
oneRow.add(model.getDesignation());
oneRow.add(model.getDestiation());
oneRow.add(model.getDiv());
oneRow.add(model.getEcc());
oneRow.add(model.getEmail());
oneRow.add(model.getFactory());
oneRow.add(model.getFax());
oneRow.add(model.getGst());
oneRow.add(model.getPinCode());
oneRow.add(model.getRemarks());
81
oneRow.add(model.getOffice());
oneRow.add(model.getMobile());
oneRow.add(model.getPager());
oneRow.add(model.getPan());
oneRow.add(model.getStd());
oneRow.add(model.getUrl());
oneRow.add(model.getVendor());
oneRow.add(model.getRange());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session.close();
sessionFactory.close();
}
});
mntmDelete.setIcon(new
ImageIcon(CustomerForm.class.getResource("/inventory/delete.png")));
mntmDelete.setFont(new Font("Arial", Font.BOLD, 14));
mntmDelete.setBounds(413, 6, 129, 29);
frmCustomerDetail.getContentPane().add(mntmDelete);
table.getSelectedRow();
code1.setText(model.getValueAt(index, 0).toString());
name.setText(model.getValueAt(index, 1).toString());
address.setText(model.getValueAt(index,
2).toString());
82
city.setText(model.getValueAt(index, 3).toString());
contact.setText(model.getValueAt(index,
4).toString());
deliver.setText(model.getValueAt(index,
5).toString());
designation.setText(model.getValueAt(index,
6).toString());
destination.setText(model.getValueAt(index,
7).toString());
div.setText(model.getValueAt(index, 8).toString());
ecc.setText(model.getValueAt(index, 9).toString());
email.setText(model.getValueAt(index,
10).toString());
factory.setText(model.getValueAt(index,
11).toString());
fax.setText(model.getValueAt(index, 12).toString());
gst.setText(model.getValueAt(index, 13).toString());
pincode.setText(model.getValueAt(index,
14).toString());
remarks.setText(model.getValueAt(index,
15).toString());
office.setText(model.getValueAt(index,
16).toString());
mobile.setText(model.getValueAt(index,
17).toString());
pager.setText(model.getValueAt(index,
18).toString());
pan.setText(model.getValueAt(index, 19).toString());
std.setText(model.getValueAt(index, 20).toString());
url.setText(model.getValueAt(index, 21).toString());
vendor.setText(model.getValueAt(index,
22).toString());
range.setText(model.getValueAt(index,
23).toString());
}
});
btnNewButton_2.setBounds(894, 655, 27, 53);
frmCustomerDetail.getContentPane().add(btnNewButton_2);
83
JSeparator separator_7 = new JSeparator();
separator_7.setBounds(10, 30, 204, 0);
frmCustomerDetail.getContentPane().add(separator_7);
customerModel.setFax(Long.parseLong(fax.getText()));
customerModel.setGst(gst.getText());
customerModel.setMobile(Long.parseLong(mobile.getText()));
customerModel.setName(name.getText());
customerModel.setOffice(Long.parseLong(office.getText()));
84
customerModel.setPager(Long.parseLong(pager.getText()));
customerModel.setPan(pan.getText());
customerModel.setPinCode(Long.parseLong(pincode.getText()));
customerModel.setRange(range.getText());
customerModel.setRemarks(remarks.getText());
customerModel.setStd(std.getText());
customerModel.setUrl(url.getText());
customerModel.setVendor(vendor.getText());
if (address.getText().length() == 0) {
JOptionPane.showMessageDialog(null,
"valuue");
}
JOptionPane.showMessageDialog(null, "saved");
session.save(customerModel);
@SuppressWarnings("unchecked")
List<CustomerModel> products =
session.createQuery("from CustomerModel").list();
85
model = (CustomerModel) o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getCode());
oneRow.add(model.getName());
oneRow.add(model.getAddress());
oneRow.add(model.getCity());
oneRow.add(model.getContact());
oneRow.add(model.getDelivered());
oneRow.add(model.getDesignation());
oneRow.add(model.getDestiation());
oneRow.add(model.getDiv());
oneRow.add(model.getEcc());
oneRow.add(model.getEmail());
oneRow.add(model.getFactory());
oneRow.add(model.getFax());
oneRow.add(model.getGst());
oneRow.add(model.getPinCode());
oneRow.add(model.getRemarks());
oneRow.add(model.getOffice());
oneRow.add(model.getMobile());
oneRow.add(model.getPager());
oneRow.add(model.getPan());
oneRow.add(model.getStd());
oneRow.add(model.getUrl());
oneRow.add(model.getVendor());
oneRow.add(model.getRange());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session.getTransaction().commit();
session.close();
sessionFactory.close();
}
});
86
JMenuItem mntmViewalll = new JMenuItem("view all customer");
mntmViewalll.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
87
tableHeaders.add("range");
// tableHeaders.add("name");
for (Object o : products) {
CustomerModel model = (CustomerModel) o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getCode());
oneRow.add(model.getName());
oneRow.add(model.getAddress());
oneRow.add(model.getCity());
oneRow.add(model.getContact());
oneRow.add(model.getDelivered());
oneRow.add(model.getDesignation());
oneRow.add(model.getDestiation());
oneRow.add(model.getDiv());
oneRow.add(model.getEcc());
oneRow.add(model.getEmail());
oneRow.add(model.getFactory());
oneRow.add(model.getFax());
oneRow.add(model.getGst());
oneRow.add(model.getPinCode());
oneRow.add(model.getRemarks());
oneRow.add(model.getOffice());
oneRow.add(model.getMobile());
oneRow.add(model.getPager());
oneRow.add(model.getPan());
oneRow.add(model.getStd());
oneRow.add(model.getUrl());
oneRow.add(model.getVendor());
oneRow.add(model.getRange());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
session.getTransaction().commit();
session.flush();
session.close();
sessionFactory.close();
}
});
88
mntmViewalll.setIcon(new
ImageIcon(CustomerForm.class.getResource("/inventory/view all.png")));
mntmViewalll.setFont(new Font("Arial", Font.BOLD, 14));
mntmViewalll.setBounds(92, 4, 198, 29);
frmCustomerDetail.getContentPane().add(mntmViewalll);
customerModel.setContact(Long.parseLong(contact.getText()));
customerModel.setDelivered(deliver.getText());
customerModel.setDesignation(designation.getText());
customerModel.setDestiation(destination.getText());
customerModel.setDiv(div.getText());
customerModel.setEcc(ecc.getText());
customerModel.setEmail(email.getText());
customerModel.setFactory(Long.parseLong(factory.getText()));
customerModel.setFax(Long.parseLong(fax.getText()));
customerModel.setGst(gst.getText());
customerModel.setMobile(Long.parseLong(mobile.getText()));
customerModel.setName(name.getText());
customerModel.setOffice(Long.parseLong(office.getText()));
customerModel.setPager(Long.parseLong(pager.getText()));
customerModel.setPan(pan.getText());
customerModel.setPinCode(Long.parseLong(pincode.getText()));
customerModel.setRange(range.getText());
89
customerModel.setRemarks(remarks.getText());
customerModel.setStd(std.getText());
customerModel.setUrl(url.getText());
customerModel.setVendor(vendor.getText());
session.update(customerModel);
session.getTransaction().commit();
@SuppressWarnings("unchecked")
List<CustomerModel> products =
session.createQuery("from CustomerModel").list();
// tableHeaders.add("name");
for (Object o : products) {
90
CustomerModel model = (CustomerModel) o;
Vector<Object> oneRow = new
Vector<Object>();
oneRow.add(model.getCode());
oneRow.add(model.getName());
oneRow.add(model.getAddress());
oneRow.add(model.getCity());
oneRow.add(model.getContact());
oneRow.add(model.getDelivered());
oneRow.add(model.getDesignation());
oneRow.add(model.getDestiation());
oneRow.add(model.getDiv());
oneRow.add(model.getEcc());
oneRow.add(model.getEmail());
oneRow.add(model.getFactory());
oneRow.add(model.getFax());
oneRow.add(model.getGst());
oneRow.add(model.getPinCode());
oneRow.add(model.getRemarks());
oneRow.add(model.getOffice());
oneRow.add(model.getMobile());
oneRow.add(model.getPager());
oneRow.add(model.getPan());
oneRow.add(model.getStd());
oneRow.add(model.getUrl());
oneRow.add(model.getVendor());
oneRow.add(model.getRange());
tableData.add(oneRow);
}
table.setModel(new DefaultTableModel(tableData,
tableHeaders));
JOptionPane.showMessageDialog(null, "updated")
session.flush();
session.close();
sessionFactory.close();
}
});
}}
Logstash Configuring
91
9.2 SAMPLE SCREEN:
FORM DESIGN:
Login Page
92
Home Page:
Customer Form
93
Component Form
94
Purchase Order
Machine Master
9.2.1REPORTS:
95
If we store them in Elasticsearch, we can view and analyze them with Kibana. The Kibana
web interface is an adjustable dashboard that we can stretch out and change to suit our
surroundings. It permits tables and diagrams creation and in addition complex
representations. The Kibana web interface utilizes the Apache Lucene question linguistic
structure to permit us to make inquiries.
Flexible data modeling in elasticsearch means you can represent your data involving with two
different ways mimicking how application will consume. Example, adding a list of categories
in each document directly instead of maintaining multiple tables and creating complex
queries between those tables to determine document categories
96
97
CHAPTER XI
REFERENCES
BOOK REFERENCE
[1] Richard Fairley, “ Software Engineering Concepts” Tata McGraw Hill Edition, 2008
[2] Herbert Schildt, The Complete Reference – Java 2, 4 th Edition, Tata McGraw Hill, 2001
[3] Herbert Schildt, Dale Skrien, “Java Fundamentals – A Comprehensive Introduction”,
TataMc Graw Hill, 2013
[4] E Balagurusamy, “Object oriented Programming with Java”, edition, 2006, Tata McGraw
Hill
[5] Software Engineering A practitioner’s Approach. 6th edition –Roger Pressman. (Mcgraw-
hill international edition)
[6] Database System Concepts (4th Edition), By: Abraham Silberschatz, Henry F.Korth and
S.Sudarshan McGraw Hill Publication.
[7] Core Java volume I & II By: Cays Horstmann, Gary Cornell (7th edition) Pearson
Publication
[8] “Complete Reference for JAVA” By: Herbelt Schildt
Website Reference:
[1]https://www.tutorialspoint.com/java/
[2]https://www.H2.com/java/
[3]https://Hibernate.com/home/
Journal Referernce:
[1] Carlos Teixeira1, José Braga de Vasconcelos2 , Gabriel Pestana3 , A Knowledge Management System for
Analysis of Organisational Log Files, Lisboa, Portugal, Universidade Europeia, Laureate International
Universities
[2] Niu Gaifang, The Development of Logging Large-scale Management Information System, College of
Computer and Information Technology, Henan Normal University, Xinxiang, China.
[3] Tian Yue1, Li Xiaobin2, Yang Zhengqiu3, The Research And Design Of Log Management System Based On
Struts Frame, School of CST Beijing University of Posts and Telecommunications, Beijing, China
[4] Jing Li1, Xing Li2, Gang Liu3, Zhenwen He4, Log Management Approach in Three-Dimensional
Spatial Data Management System, School of Computer Science and Technology China University of
Geosciences, Wuhan, China
[5] Minoru Ikebe1, Kazuyuki Yoshida2, An Integrated Distributed Log Management System with Metadata for
Network Operation, Department of Computer Science and Intelligence Systems, Faculty of Engineering, Oita
University, Oita, Japan
98
99