Anda di halaman 1dari 113

A Project Report On

(Submitted in partial fulfillment of the requirement for the Award of Degree) Master in Computer Application

Under the Guidance of: Mr. Naresh Gulati

Submitted by: Bhagya Shree (1060512189) MCA

Department of Computer Science


Ozark Global Information Services

Maharishi Dayanand University,

Rohtak (Haryana)
________________________________________________________________________

Certificate
This is to certify that the Project entitled Inventory Control Management which is being submitted by Bhagyashree (1060512189) to the Deptt. Of Master in Computer Application from OGIS, Gurgaon, for the award of Master of Engg. degree in Computer Sc. is a record of bonafide project work, they have carried out under our supervision and guidance. The result contained in this project has not been submitted to any other university or institute for the award of a degree or diploma.

Mr. Atual Goyal Head, OGIS

Mr. Naresh Gulati (Project Guide)

________________________________________________________________________

II

Declaration
I am Bhagyashree hereby declare that the work presented in the project report titled Inventory Control Management submitted to the Deptt. Of Master in Computer Application from OGIS, Gurgaon, for the partial fulfillment of the requirement for the award of Degree of Master of Engineering in Computer Sc. is our authentic record of my work carried out during the final semester, 2011 at Ozark Global Information Services, Gurgaon, under the supervision of Mr. Naresh Gulati, Lecturer, Deptt. Of Computer Sc. & Engg., OGIS, Gurgaon. The matter embodied in this project report has not been submitted elsewhere by anybody for the award of any degree or diploma.

Bhagyashree 1060512189

III

Acknowledgement
This project work is an outcome of continual work over a period of six months and drew intellectual support from various sources. Its therefore almost impossible to express adequately the debts to many persons who have been instrumental in parting this work a successful status. We express our gratitude towards Mr. Naresh Gulati, our guide for allocating us such a nice project. She has always been the source of inspiration and has provided us with the most needed help and support. We are also thankful to our friends who supported us a lot and helped us where ever we went wrong or where ever we could not understand anything.

Bhagyashree (1060512189)

IV

Abstract
An Inventory Control System is an integrated package of software and hardware used in warehouse operation, and elsewhere, to monitor the quantity, location and status of inventory as well as the related shipping, receiving, picking and put away process. In common usage, the term may also refer to just the software components.
The system will keep a log of the spares available and also be intelligent enough which spares have been taken from which supplier and in which quantity plus the amount of spares being sold to individual customer under what requirement. It will also indicate how many spares will be available for individual sectors and what should be the buying price so that we have a selling profit

An Inventory Control System include java source code, class files, odbc, .mdb, Ms-Access file.

Contents
Topic Introduction Objective. Tools/Platform, Language(s) to be used Validation Checks System Study Existing System with Limitation Proposed system with objective Feasibility Study Economical Feasibility Technical Feasibility Operational Feasibility Duration System Analysis Data-Flow Diagram (DFDs) Process Logic of Each Module Requirement Specifications System Design File/Database Design Connectivity form design Form Interface Coding Test Data (Testing Phase) Implementation System Implementation Types of Implementation Page No.

VI

Preparation of Implementation Result

Introduction
The present manual Inventory Control System for a Companys Strategic Goals requires daily updating of a number of registers. It requires huge manpower, effort and money. Even though, Maintenance of registers is not done properly. This project results in transformation from conventional type system to computerized system with day-to-day information. It deals with the whole information of the Inventory like Item details, Customer details and their Purchase, Sales Record etc. It takes a lot of space to keep the records. The Inventory Control Process provides information to efficiently manage the flow of materials, effectively utilize people and equipment, coordinate internal activities, and communicate with customers. Inventory Management and the activities of Inventory Control do not make decisions or manage operations; they provide the information to Managers who make more accurate and timely decisions to manage their operations. It is strategic in the sense that top management sets goals . These include deployment strategies ( Push versus Pull ) , control policies , the determination of the optimal levels of order quantities and reorder points and setting safety stock levels . These levels are critical , since they are primary determinants of customer service levels. Traditional Supply Chain solutions such as Materials Requirement Planning , Inventory Control , typically focuses on implementing more rapid and efficient systems to reduce the cost of communicating information between and across the Inventory links in the SCM.COM focuses in optimizing the total investment of materials cost and workload for every Inventory item throughout the chain from procurement of raw materials to finished goods Inventory . Optimization means providing a balance of supply to meet the demand at a minimum total cost , Inventory level and workload to meet customers service goal for each items in the link of Inventory Chain .

VII

Objective
Inventory Management must tie together the following objectives, to ensure that there is continuity between functions : To Find and track down all the processing datas in an inventory system repository . Define a procedure by which assets are identified and maintained in the Inventory System. Provideall necessary personnel (data entry, update and deletion). Restrict access of certain members ,Complete range of reports that will satisfy informational requirements. To file the Inventory Management System within the Standards and Procedures Manual. To provide coaching to personnel responsible for supporting the Inventory Management System.

Inventory is usually a distributors largest asset. But many distributors arent satisfied with the contribution inventory makes towards the overall success of their business: The wrong quantities of the wrong items are often found on warehouse shelves. Even though there may be a lot of surplus inventory and dead stock in their warehouse(s), backorders and customer lost sales are common. The material a distributor has committed to stock isnt available when customers request it. Computer inventory records are not accurate. Inventory balance information in the distributors expensive computer system does not accurately reflect what is available for sale in the warehouse. The return on investment is not satisfactory. The companys profits, considering its substantial investment in inventory, is far less than what could be earned if the money were invested elsewhere.

VIII

Tools/Platform and Languages


System requirements specification must reflect the actual applications to be handled by and system and including system objectives flowcharts, input-output requirements, file structure and costs. The specification must also describe each aspect of the system clarity, consistently and completely. Thus system requirement specifications are the key information for programming, testing and implementing the projects. The specification of hardware and software is as follows: Language: NetBeans

Most developers recognize the NetBeans IDE as the original free Java IDE. It is that, and much more! The NetBeans IDE provides support for several languages (PHP, JavaFX, C/C++, JavaScript, etc.) and frameworks. NetBeans is an open-source project dedicated to providing rock solid software development products (the NetBeans IDE and the NetBeans Platform) that address the needs of developers, users and the businesses who rely on NetBeans as a basis for their products. In June 2000, NetBeans was made open source by Sun Microsystems, which remained the project sponsor until January 2010 when Sun Microsystems became a subsidiary of Oracle. Hardware: Processor RAM Hard disk Monitor Software: Back End: Ms-Access Operating System: Windows 7, WindowXP : Pentium 800 MHz : 512 MB : 650 MB free disk space. : SVGA color with 640 x 480

Mother Board : Intel 810

IX

Validation Checks User Name and Password cannot be left blank. User Name and Password cannot exceed 50 characters in length. Code Number should be unique and it is Auto generated. Title and Publisher cannot exceed 20 characters in length. Author, Subject and Language cannot be more than 40 characters in length. Price should not be less than zero Remarks must not be more than 50 characters.

Item Name, Company Name, and Product Detail collectively could not be same for any two Item.
Date of Entry must not be greater than today's date. Stock level should always be greater than Zero. Member Identification Number should be unique and it is automatically generated. Name of the Member cannot exceed 30 characters in length. Address cannot be more than 115 characters. Name, Address and phone number fields collectively cannot be same for any two Members. Issue Date should not exceed the current date. Proposed Date should be calculated automatically by the software as Date of Issue plus seven days.

Only one Item Code can be used on one code number. Item Number of a particular Item cannot exceed the total stock of that Item.
Actual Date cannot be less than the Issue date and cannot be greater than the current date.

XI

System Analysis
The System Analysis phase is considered to one of the most important phases in the System Development Life Cycle (SDLC). It is immensely important that the Software Developer makes through study of the existing system through study of the system is made and need i.e. features.

Initial Investigation: In order to identify the need of the client/user, Initial investigation is the initial steps towards the system development life cycle the objective is to determine whether the request is valid and feasible before a recommendation is reached to do nothing, improve or modify the existing system or build a new one. In this entire business transaction and basic input/output have been studied. Feasibility Study: To do feasibility study used to consider the economic, technical and behavioral factors in system development The most successful system projects are not necessarily the biggest or more visible in a business but rather those that truly meets user expectations. More projects fail because of inflated expectations than for any other reasons. The objective of feasibility is not to solve the problem but to acquire a sense of its scope. The result of the feasibility study is a formal proposal. This is simply a report a formal document detailing the nature and scope of the proposed solution. The proposal summarizes is known and what is going to be done. It consist of the following: a) b) c) d) Statement of the Problem Summary of finding and Recommend Actions Details of findings Recommendations and Conclusions

XII

Economic Feasibility: In economic feasibility in order to weigh the costs of developing and implementing a new system, against the benefits that would accrue from having a new system in place the following factors are considered. a) Procurement Costs: This would include the following Cost of equipment: Installation Cost Cost of site preparation Cost of hiring consultants b) Start up costs: This would include the following

Cost of system software: Communication software Cost of recruiting additional manpower c) Projects Costs: This would include the following

Development cost of the project Cost of management time Training costs Data preparation cost Conversion cost Other

d)

Ongoing costs: Maintenance cost (hardware): Maintenance cost (software): Maintenance cost (manpower):

XIII

Depreciation Additional Training. Technical Feasibility In order to study technical feasibility the following factor are considered. a) Technologies involved: Front end: frameworks. Backend: MS-Access NetBeans

Since NetBeans IDE provides support for several languages (PHP, JavaFX, C/C++, JavaScript, etc.) and

b) Does Organization possess these technologies? NetBeans is widely used products in software industry. Obtaining these technologies wont be difficult. Any organization, which wishes to use these products, can purchase them easily. Organizations which are already into software training / development possess these technologies. c) Does necessary expertise available: Since NetBeans is a language in which many applications are developed, expertise in this language is abundance. Legal Feasibility: Since the proposed project is on Employees performance monitoring system copyrights can be easily obtainable and legally there is no problem regarding the development of the project. Evaluation Alternatives: Packages related to Inventory Management system are already available in the software market so lot of care should be taken in order to develop a very good product.

XIV

Make ready or Prototype development time: This is the time taken for developing of prototype & installation. The time taken include is Coding (development of programs, inputs & outputs.). For Inventory Control System prototype development took 5 weeks.

XV

System installation, checking, improvement & Training: This is time taken for installation of prototype, Testing, checking system security, findings, limitations, improvements & trainings.

XVI

System Analysis It is a detailed study of the various operation performed by a system and their relationship within and outside of the system. During analysis data are collected on the available files, decision points, and transaction handled by the present system. Analysis of this system will be performed in the given tools: DFD Data Flow Diagram: DFD depict information flow and the transforms that are applied as data moves from input to output. This enables us to develop module of the information domain and functional domain of the same time. As the DFD is refined into greater levels of details, the analyst performs an implicit functional decomposition of the system.

0 - Level DFD (Context) The data dictionary

XVII

1 - Level DFD (Context) Exploding the processes

XVIII

2 - Level DFD (Context)

Entity Relation Diagram: 1. Entities :


i. Item { Item Name, Code, Rate, Stock-in-Hand, Max-level, Min- Level, Reorder- Level.} ii. Customer {Customer Name, Customer Code, Address, City, State, Pin No., Phone No.} iii. Supplier { Supplier Name, Supplier Code, Address, City, State, Pin No., Phone No.} 2. Relationship : i. Sales { Bill No, Customer Code, Item Code, Quantity, Price, Amount, Discount, Net Payable}

XIX

ii.

Purchase {Bill No, Supplier Code, Item Code, Quantity, Price, Amount, Discount, Net Payable}

E R-Diagram
System Design
File/Database Design

XX

XXI

XXII

XXIII

XXIV

XXV

XXVI

Form Interface
First Form of the Project in which copyright and developers information are shown

In this screen the user click the insert and enter the following:

Then Enter the code no., Item name, Rate, Stock-in-Hand, Min-Level, Max-Level, Re-order Level and click on Insert Button

XXVII

Then u will find a Record Inert Message and Click on OK

XXVIII

XXIX

XXX

XXXI

XXXII

XXXIII

XXXIV

XXXV

XXXVI

XXXVII

XXXVIII

XXXIX

XL

XLI

XLII

XLIII

XLIV

XLV

XLVI

XLVII

XLVIII

XLIX

LI

LII

LIII

LIV

LV

LVI

SOURCE CODE
//***************************************** * ItemInsert.java * * Created on Jun 15, 2011, 7:10:06sPM *****************************************// package inventorycontrol; import java.sql.*; /** @author Bhagyashree **/ public class ItemInsert extends javax.swing.JFrame { /** Creates new form ItemInsert */ public ItemInsert() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Insert into Item values(?,?,?,?,?,?,?)"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.setString(2,jTextField2.getText()); ps.setString(3,jTextField3.getText()); ps.setString(4,jTextField4.getText()); ps.setString(5,jTextField5.getText()); ps.setString(6,jTextField6.getText()); ps.setString(7,jTextField7.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Insert"); con.close();

LVII

} catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ItemInsert().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration

LVIII

} //***************************************** * ItemShow.java * * Created on Jun 22, 2011, 7:29:39 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class ItemShow extends javax.swing.JFrame { /** Creates new form ItemShow */ public ItemShow() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Item where itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(String.valueOf(rs.getInt(3))); jTextField4.setText(String.valueOf(rs.getInt(4))); jTextField5.setText(String.valueOf(rs.getInt(5))); jextField6.setText(String.valueOf(rs.getInt(6))); jTextField7.setText(String.valueOf(rs.getInt(7))); }

LIX

else javax.swing.JOptionPane.showMessageDialog(this,"Item Code Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ItemShow().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * ItemUpdate.java * * Created on Jun 22, 2011,8:54:47 PM *****************************************//

LX

package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class ItemUpdate extends javax.swing.JFrame { /** Creates new form ItemUpdate */ public ItemUpdate() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Item where itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(String.valueOf(rs.getInt(3))); jTextField4.setText(String.valueOf(rs.getInt(4))); jTextField5.setText(String.valueOf(rs.getInt(5))); jTextField6.setText(String.valueOf(rs.getInt(6))); jTextField7.setText(String.valueOf(rs.getInt(7))); } else javax.swing.JOptionPane.showMessageDialog(this,"Item Code Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { int x=javax.swing.JOptionPane.showConfirmDialog(this,"Do You Want Update"); if(x==0) try {

LXI

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="update Item set Itemname=?,Rate=?,stockinhand=?,minlevel=?,maxlevel=?,reorderlevel=? where itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField2.getText()); ps.setString(2,jTextField3.getText()); ps.setString(3,jTextField4.getText()); ps.setString(4,jTextField5.getText()); ps.setString(5,jTextField6.getText()); ps.setString(6,jTextField7.getText()); ps.setString(7,jTextField1.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Updated"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ItemUpdate().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1;

LXII

private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * ItemDelete.java * * Created on Jun 22, 2011, 8:31:49 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class ItemDelete extends javax.swing.JFrame { /** Creates new form ItemDelete */ public ItemDelete() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory");

LXIII

String query="Select * from Item where itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(String.valueOf(rs.getInt(3))); jTextField4.setText(String.valueOf(rs.getInt(4))); jTextField5.setText(String.valueOf(rs.getInt(5))); jTextField6.setText(String.valueOf(rs.getInt(6))); jTextField7.setText(String.valueOf(rs.getInt(7))); } else javax.swing.JOptionPane.showMessageDialog(this,"Item Code Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { int x=javax.swing.JOptionPane.showConfirmDialog(this,"Do You Want Delete"); if(x==0) try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="delete from Item where Itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Deleted"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); }

LXIV

} /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ItemDelete().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * ItemRate.java * * Created on Jun 22, 2011, 9:07:08 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class ItemRate extends javax.swing.JFrame { /** Creates new form ItemRate */ public ItemRate() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); }

LXV

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Item where Rate=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); int r=0; while(rs.next()) { jTable1.setValueAt(rs.getString(1),r,0); jTable1.setValueAt(rs.getString(2),r,1); jTable1.setValueAt(rs.getString(3),r,2); jTable1.setValueAt(rs.getString(4),r,3); jTable1.setValueAt(rs.getString(5),r,4); jTable1.setValueAt(rs.getString(6),r,5); jTable1.setValueAt(rs.getString(7),r,6); r++; } if(r==0) { javax.swing.JOptionPane.showMessageDialog(this,"Rate is Not Found"); con.close(); } } catch (SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ItemRate().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2;

LXVI

private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private javax.swing.JTextField jTextField1; // End of variables declaration } //***************************************** * QuerrybyItemName.java * * Created on Jun 22, 2011, 9:09:28 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class ItemName extends javax.swing.JFrame { /** Creates new form ItemName */ public ItemName() { initComponents(); SetDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Item where itemname=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField2.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField1.setText(rs.getString(1)); jTextField3.setText(String.valueOf(rs.getInt(3))); jTextField4.setText(String.valueOf(rs.getInt(4))); jTextField5.setText(String.valueOf(rs.getInt(5))); jTextField6.setText(String.valueOf(rs.getInt(6))); jTextField7.setText(String.valueOf(rs.getInt(7))); } else javax.swing.JOptionPane.showMessageDialog(this,"Item Code Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s);

LXVII

} catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ItemName().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * QuerrybyItemCode.java * * Created on Jun 22, 2011, 9:089:30 PM *****************************************// package inventorycontrol; import java.sql.*; /** * * @author Bhagyashree */ public class ItemCode extends javax.swing.JFrame

LXVIII

{ /** Creates new form ItemCode */ public ItemCode() { initComponents(); SetDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Item where itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(String.valueOf(rs.getInt(3))); jTextField4.setText(String.valueOf(rs.getInt(4))); jTextField5.setText(String.valueOf(rs.getInt(5))); jTextField6.setText(String.valueOf(rs.getInt(6))); jTextField7.setText(String.valueOf(rs.getInt(7))); } else javax.swing.JOptionPane.showMessageDialog(this,"Item Code Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } /** * @param args the command line arguments

LXIX

*/ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ItemCode().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * CustomerInsert.java * * Created on Jun 22, 2011, 10:27:15 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class CustomerInsert extends javax.swing.JFrame { /** Creates new form CustomerInsert */ public CustomerInsert() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null);

LXX

jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Insert into customer values(?,?,?,?,?,?,?)"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.setString(2,jTextField2.getText()); ps.setString(3,jTextField3.getText()); ps.setString(4,jTextField4.getText()); ps.setString(5,jTextField5.getText()); ps.setString(6,jTextField6.getText()); ps.setString(7,jTextField7.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Insert"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CustomerInsert().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3;

LXXI

private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * CustomerShow.java * * Created on Jun 22, 2011, 10:42:19 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class CustomerShow extends javax.swing.JFrame { /** Creates new form CustomerShow */ public CustomerShow() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Customer where customercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery();

LXXII

if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Customer Code is Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CustomerShow().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6;

LXXIII

private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * CustomerUpdate.java * * Created on Jun 22, 2011, 10:56:11 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class CustomerUpdate extends javax.swing.JFrame { /** Creates new form CustomerUpdate */ public CustomerUpdate() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from customer where customercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else

LXXIV

javax.swing.JOptionPane.showMessageDialog(this,"Customer Code Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { int x=javax.swing.JOptionPane.showConfirmDialog(this,"Do You Want Update"); if(x==0) try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="update Customer set Customername=?,Address=?,City=?,State=?,Pinno=?,Phoneno=? where Customercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField2.getText()); ps.setString(2,jTextField3.getText()); ps.setString(3,jTextField4.getText()); ps.setString(4,jTextField5.getText()); ps.setString(5,jTextField6.getText()); ps.setString(6,jTextField7.getText()); ps.setString(7,jTextField1.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Updated"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CustomerUpdate().setVisible(true); } }); } // Variables declaration - do not modify

LXXV

private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * CustomerDelete.java * * Created on Jun 22, 2011, 10:50:50 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class CustomerDelete extends javax.swing.JFrame { /** Creates new form CustomerDelete */ public CustomerDelete() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try {

LXXVI

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from customer where customercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Customer Code Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { int x=javax.swing.JOptionPane.showConfirmDialog(this,"Do You Want Delete"); if(x==0) try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="delete from Customer where Customercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Deleted"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /**

LXXVII

* @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CustomerDelete().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * CustomerAddress.java * * Created on Jun 22, 2011, 11:22:09 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class CustomerAddress extends javax.swing.JFrame { /** Creates new form CustomerAddress */ public CustomerAddress() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

LXXVIII

try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Customer where Address=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); int r=0; while(rs.next()) { jTable1.setValueAt(rs.getString(1),r,0); jTable1.setValueAt(rs.getString(2),r,1); jTable1.setValueAt(rs.getString(3),r,2); jTable1.setValueAt(rs.getString(4),r,3); jTable1.setValueAt(rs.getString(5),r,4); jTable1.setValueAt(rs.getString(6),r,5); jTable1.setValueAt(rs.getString(7),r,6); r++; } if(r==0) { javax.swing.JOptionPane.showMessageDialog(this,"Address is Not Found"); con.close(); } } catch (SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CustomerAddress().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1;

LXXIX

private javax.swing.JTextField jTextField1; // End of variables declaration } //***************************************** * QuerrybyCustomerCode.java * * Created on Jun 22, 2011, 11:14:03 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class QuerrybyCustomerCode extends javax.swing.JFrame { /** Creates new form CustomerCode */ public QuerrybyCustomerCode() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from customer where customercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Customer Code Not Found");

LXXX

con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new QuerrybyCustomerCode().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * QuerrybyCustomerName.java * * Created on Jun 22, 2011, 10:27:15 PM *****************************************// package inventorycontrol; import java.sql.*;

LXXXI

/** * @author Bhagyashree */ public class QuerrybyCustomerName extends javax.swing.JFrame { /** Creates new form CustomerName */ public QuerrybyCustomerName() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from customer where customerName=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField2.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField1.setText(rs.getString(1)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Customer Name Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /**

LXXXII

* @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new QuerrybyCustomerName().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * SupplierInsert.java * * Created on Jun 22, 2011, 11:31:22 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class SupplierInsert extends javax.swing.JFrame { /** Creates new form SupplierInsert */ public SupplierInsert() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try {

LXXXIII

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Insert into Supplier values(?,?,?,?,?,?,?)"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.setString(2,jTextField2.getText()); ps.setString(3,jTextField3.getText()); ps.setString(4,jTextField4.getText()); ps.setString(5,jTextField5.getText()); ps.setString(6,jTextField6.getText()); ps.setString(7,jTextField7.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Insert"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SupplierInsert().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3;

LXXXIV

private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * SupplierShow.java * * Created on Jun 23, 2011, 10:42:18 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class SupplierShow extends javax.swing.JFrame { /** Creates new form SupplierShow */ public SupplierShow() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Supplier where Suppliercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery();

LXXXV

if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Supplier Code is Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SupplierShow().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7;

LXXXVI

// End of variables declaration } //***************************************** * SupplierUpdate.java * * Created on Jun 24, 2011, 12:20:02 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class SupplierUpdate extends javax.swing.JFrame { /** Creates new form SupplierUpdate */ public SupplierUpdate() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Supplier where Suppliercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Supplier Code is Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } }

LXXXVII

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { int x=javax.swing.JOptionPane.showConfirmDialog(this,"Do You Want Update"); if(x==0) try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="update Supplier set Suppliername=?,Address=?,City=?,State=?,Pinno=?,Phoneno=? where Suppliercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField2.getText()); ps.setString(2,jTextField3.getText()); ps.setString(3,jTextField4.getText()); ps.setString(4,jTextField5.getText()); ps.setString(5,jTextField6.getText()); ps.setString(6,jTextField7.getText()); ps.setString(7,jTextField1.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Updated"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SupplierUpdate().setVisible(true); } }); }

LXXXVIII

// Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * SupplierDelete.java * * Created on Jun 23, 2011, 11:04:22 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class SupplierDelete extends javax.swing.JFrame { /** Creates new form SupplierDelete */ public SupplierDelete() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try

LXXXIX

{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Supplier where Suppliercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Supplier Code is Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { int x=javax.swing.JOptionPane.showConfirmDialog(this,"Do You Want Delete"); if(x==0) try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="delete from Supplier where Suppliercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Deleted"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) {

XC

javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SupplierDelete().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * SupplierAddress.java * * Created on Jun 24, 2011, 12:20:55 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class SupplierAddress extends javax.swing.JFrame { /** Creates new form SupplierAddress */ public SupplierAddress() { initComponents();

XCI

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Supplier where Address=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); int r=0; while(rs.next()) { jTable1.setValueAt(rs.getString(1),r,0); jTable1.setValueAt(rs.getString(2),r,1); jTable1.setValueAt(rs.getString(3),r,2); jTable1.setValueAt(rs.getString(4),r,3); jTable1.setValueAt(rs.getString(5),r,4); jTable1.setValueAt(rs.getString(6),r,5); jTable1.setValueAt(rs.getString(7),r,6); r++; } if(r==0) { javax.swing.JOptionPane.showMessageDialog(this,"Address is Not Found"); con.close(); } } catch (SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SupplierAddress().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1;

XCII

private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private javax.swing.JTextField jTextField1; // End of variables declaration } //***************************************** * QuerrybySupplierCode.java * * Created on Jun 24, 2011, 12:20:27 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class QerrybySupplierCode extends javax.swing.JFrame { /** Creates new form SupplierCode */ public QerrybySupplierCode() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null); jTextField7.setText(null); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Supplier where Suppliercode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField2.setText(rs.getString(2)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7));

XCIII

} else javax.swing.JOptionPane.showMessageDialog(this,"Supplier Code is Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new QerrybySupplierCode().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * QuerrybySupplierName.java * * Created on Jun 24, 2011, 12:20:40 PM

XCIV

*****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class QuerryBySupplierName extends javax.swing.JFrame { /** Creates new form SupplierName */ public QuerryBySupplierName() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Supplier where SupplierName=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField2.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { jTextField1.setText(rs.getString(1)); jTextField3.setText(rs.getString(3)); jTextField4.setText(rs.getString(4)); jTextField5.setText(rs.getString(5)); jTextField6.setText(rs.getString(6)); jTextField7.setText(rs.getString(7)); } else javax.swing.JOptionPane.showMessageDialog(this,"Supplier Name is Not Found"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { jTextField1.setText(null); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null); jTextField6.setText(null);

XCV

jTextField7.setText(null); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new QuerryBySupplierName().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration } //***************************************** * Sales.java * * Created on Jun 24, 2011, 12:22:36 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class Sales extends javax.swing.JFrame { /** Creates new form Sales */ public Sales() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); }

XCVI

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Item where itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField3.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { int a,b,c,d,e,f,s; a=Integer.parseInt(jTextField4.getText()); s=rs.getInt(4); if(a>s) javax.swing.JOptionPane.showMessageDialog(this,"Insufficient Quantity"); else { jTextField5.setText(String.valueOf(rs.getString(3))); b=Integer.parseInt(jTextField5.getText()); c=a*b; jTextField6.setText(String.valueOf(c)); d=Integer.parseInt(jTextField6.getText()); e=d*4/100; jTextField7.setText(String.valueOf(e)); f=d-e; jTextField8.setText(String.valueOf(f)); } } else javax.swing.JOptionPane.showMessageDialog(this,"Item Code Not Found"); String query1="update item set stockinhand=stockinhand-? where itemcode=?"; PreparedStatement ps1=con.prepareStatement(query1); ps1.setString(1,jTextField4.getText()); ps1.setString(2,jTextField3.getText()); ps1.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Updated Details"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } }

XCVII

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Insert into Sales values(?,?,?,?,?,?,?,?)"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.setString(2,jTextField2.getText()); ps.setString(3,jTextField3.getText()); ps.setString(4,jTextField4.getText()); ps.setString(5,jTextField5.getText()); ps.setString(6,jTextField6.getText()); ps.setString(7,jTextField7.getText()); ps.setString(8,jTextField8.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Saved"); con.close(); } catch(SQLException s) { javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Sales().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8;

XCVIII

private javax.swing.JLabel jLabel9; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; private javax.swing.JTextField jTextField8; // End of variables declaration } //***************************************** * Purchase.java * * Created on Jun 24, 2011, 12:22:55 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree */ public class Purchase extends javax.swing.JFrame { /** Creates new form Purchase */ public Purchase() { initComponents(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Insert into Purchase values(?,?,?,?,?,?,?,?)"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField1.getText()); ps.setString(2,jTextField2.getText()); ps.setString(3,jTextField3.getText()); ps.setString(4,jTextField4.getText()); ps.setString(5,jTextField5.getText()); ps.setString(6,jTextField6.getText()); ps.setString(7,jTextField7.getText()); ps.setString(8,jTextField8.getText()); ps.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Record Saved"); con.close(); } catch(SQLException s) {

XCIX

javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Inventory"); String query="Select * from Item where itemcode=?"; PreparedStatement ps=con.prepareStatement(query); ps.setString(1,jTextField3.getText()); ResultSet rs=ps.executeQuery(); if(rs.next()) { int a,b,c,d,e,f,s; a=Integer.parseInt(jTextField4.getText()); s=rs.getInt(4); if(a>s) javax.swing.JOptionPane.showMessageDialog(this,"Insufficient Quantity"); else { jTextField5.setText(String.valueOf(rs.getString(3))); b=Integer.parseInt(jTextField5.getText()); c=a*b; jTextField6.setText(String.valueOf(c)); d=Integer.parseInt(jTextField6.getText()); e=(d*4/100); jTextField7.setText(String.valueOf(e)); f=(d-e); jTextField8.setText(String.valueOf(f)); } } else javax.swing.JOptionPane.showMessageDialog(this,"Item Code Not Found"); String query1="update item set stockinhand=stockinhand+? where itemcode=?"; PreparedStatement ps1=con.prepareStatement(query1); ps1.setString(1,jTextField4.getText()); ps1.setString(2,jTextField3.getText()); ps1.executeUpdate(); javax.swing.JOptionPane.showMessageDialog(this,"Updated Details"); con.close(); } catch(SQLException s) {

javax.swing.JOptionPane.showMessageDialog(this,s); } catch(ClassNotFoundException c) { javax.swing.JOptionPane.showMessageDialog(this,c); } } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Purchase().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; private javax.swing.JTextField jTextField8; // End of variables declaration } //***************************************** *MainMenu.java * * Created on Jun 24, 2011, 1:36:46 PM *****************************************// package inventorycontrol; import java.sql.*; /** * @author Bhagyashree

CI

*/ public class MainMenu extends javax.swing.JFrame { /** Creates new form MainMenu */ public MainMenu() { initComponents(); } private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) { ItemInsert II=new ItemInsert(); II.show(); } private void jMenuItem24ActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); } private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) { ItemShow IS=new ItemShow(); IS.show(); } private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) { ItemUpdate IU=new ItemUpdate(); IU.show(); } private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) { ItemDelete ID=new ItemDelete(); ID.show(); } private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) { ItemRate IR=new ItemRate(); IR.show(); } private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) { QuerrybyItemName IN=new QuerrybyItemName(); IN.show(); } private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) { QuerrybyItemCode IC=new QuerrybyItemCode(); IC.show(); } private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) { CustomerInsert CI=new CustomerInsert(); CI.show(); } private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) { CustomerShow CS=new CustomerShow(); CS.show(); } private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) { CustomerUpdate CU=new CustomerUpdate(); CU.show(); }

CII

private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) { CustomerDelete CD=new CustomerDelete(); CD.show(); } private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) { CustomerAddress CA=new CustomerAddress(); CA.show(); } private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) { QuerrybyCustomerName CN=new QuerrybyCustomerName(); CN.show(); } private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) { QuerrybyCustomerCode CC=new QuerrybyCustomerCode(); CC.show(); } private void jMenuItem15ActionPerformed(java.awt.event.ActionEvent evt) { SupplierInsert SI=new SupplierInsert(); SI.show(); } private void jMenuItem16ActionPerformed(java.awt.event.ActionEvent evt) { SupplierShow SS=new SupplierShow(); SS.show(); } private void jMenuItem17ActionPerformed(java.awt.event.ActionEvent evt) { SupplierUpdate SU=new SupplierUpdate(); SU.show(); } private void jMenuItem18ActionPerformed(java.awt.event.ActionEvent evt) { SupplierDelete SD=new SupplierDelete(); SD.show(); } private void jMenuItem19ActionPerformed(java.awt.event.ActionEvent evt) { SupplierAddress SA=new SupplierAddress(); SA.show(); } private void jMenuItem20ActionPerformed(java.awt.event.ActionEvent evt) { QuerryBySupplierName SN=new QuerryBySupplierName(); SN.show(); } private void jMenuItem21ActionPerformed(java.awt.event.ActionEvent evt) { QerrybySupplierCode SD=new QerrybySupplierCode(); SD.show(); } private void jMenuItem22ActionPerformed(java.awt.event.ActionEvent evt) { Sales S=new Sales(); S.show(); } private void jMenuItem23ActionPerformed(java.awt.event.ActionEvent evt) {

CIII

Purchase P=new Purchase(); P.show(); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new MainMenu().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenu jMenu5; private javax.swing.JMenu jMenu6; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem10; private javax.swing.JMenuItem jMenuItem11; private javax.swing.JMenuItem jMenuItem12; private javax.swing.JMenuItem jMenuItem13; private javax.swing.JMenuItem jMenuItem14; private javax.swing.JMenuItem jMenuItem15; private javax.swing.JMenuItem jMenuItem16; private javax.swing.JMenuItem jMenuItem17; private javax.swing.JMenuItem jMenuItem18; private javax.swing.JMenuItem jMenuItem19; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem20; private javax.swing.JMenuItem jMenuItem21; private javax.swing.JMenuItem jMenuItem22; private javax.swing.JMenuItem jMenuItem23; private javax.swing.JMenuItem jMenuItem24; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; private javax.swing.JMenuItem jMenuItem6; private javax.swing.JMenuItem jMenuItem7; private javax.swing.JMenuItem jMenuItem8; private javax.swing.JMenuItem jMenuItem9; // End of variables declaration }

CIV

System Testing
Test Strategy : Test strategy is to be developed for the projects . It defines the scope and general direction for testing in the project. It specifies the testing techniques (coverage) that will be followed for each stage of testing. There are 3 broad types of testing techniques: Flow/coverage based Domain based Population analysis Coverage based : Following Coverage based techniques can be used: Statement coverage 100% statement coverage means that test data will ensure that every statement is executed at least once during testing Branch coverage 100% branch coverage means that test data will ensure that every branch is executed at least once during testing. Branch coverage includes statement coverage Condition coverage 100% condition coverage means that test data will ensure that every unitary condition is executed at least once during testing. Condition coverage includes branch coverage. Multiple condition coverage 100% multiple condition coverage means that test data will ensure that every combination of unitary conditions (in compound conditions) is executed at least once during testing. As a bare minimum condition coverage is required. Full path coverage 100% path coverage means that test data will ensure that every path is executed at least once during testing.

CV

Domain based : Domain based testing techniques look at inputs and outputs and derive test cases based on the analysis of the input and output domains. These are: Equivalence partitioning: Steps followed are: Identify all inputs Identify all outputs Identify equivalence class for each input Identify equivalence class for each output Ensure that test cases test each input and output equivalence class at least once. Equivalence Class: is a partition testing strategy where we partition the I/O space into equivalence classes. Any member of the equivalence class is with respect to the relation equivalent to any other member of the class. The goal is to make the resulting classes so narrow that each aspect of the program, of the specification, of development, each programmer concern, etc. is separated into a separate class. Boundary value analysis Steps followed are: Identify all inputs Identify all outputs Identify equivalence class for each input Identify equivalence class for each output For each input equivalent class, ensure that test cases include: One interior point All extreme points Decision table Identify combinations of input that result in different output values. CVI

Population analysis is used to identify kinds and frequency of data in production environment. It uses existing production/live data, which could be in the following forms: Production files, tables Manual files Files from other similar systems

It gives the tester things not clear in/ in different form/ additional to specifications Codes/values used in production Unusual data conditions Type, frequency of transactions Types of incorrect transactions Production environment also gives model for flow of scripts

Prepare System Test Plan Prepare System test plan including the test cases according to Project Requirement Review and approve the plan

Prepare Unit Test Plan Prepare Unit Test Plan including the test cases according to the LLD Review and approve the plan Unit testing focuses on individual software units, groups of related units. A unit is the smallest testable piece of software Unit Testing is done to show that the unit does not satisfy the functional specification and/or its implemented structure does not match the intended design structure Conduct unit testing as per schedule . Conduct unit testing, and prepare the Unit test report Analyze the bugs reported and carry out bug fixing Re-conduct unit testing for test cases not tested earlier Store all the test reports in the project directory .

Conduct Unit Testing

CVII

Unit testing will not have more than 3 test cycles for any unit

Conduct System Testing System testing focuses on a complete integrated system to evaluate compliance with specified requirements (tests characteristics, i.e. the business functionality that are only present when the entire system is run). System testing is aimed at revealing bugs that cannot be attributed to a component as such, but to inconsistencies between components or planned interactions between components. System testing is concerned about issues, behaviors that can only be exposed by testing the entire integrated system (e.g.. performance, security, and recovery). Conduct system testing as per schedule . Conduct system testing, and prepare the System test report Analyze the bugs reported and carry out bug fixing Re-conduct System testing for test cases not tested earlier Store all the test reports in the project directory System testing will not have more than 3 test cycles

Test Cases Define the following for each unit test case: Check for success (define valid data) Boundary conditions (define the upper and lower limits of the values) Logical error conditions Define the following for each system and module test case: Business functionality Test Data This is the data that is required to run and verify the test. Test data includes Initial database contents Data to be transacted Expected results Execute the database generation script.

Classification of bugs Severity 1+: can be used in rare cases where immediate attention is required and solution needs to be delivered quickly, ahead of planned releases.

CVIII

Level 1: if the system shuts down or major functionality is incorrect and user cannot proceed further. Level 2: if major function is inoperable or incorrect but doesn't prevent user from using the system. Client approval is needed for releasing the software with Level 2 bugs. Level 3: if minor function is inoperable or incorrect and alternative solution is available and acceptable to the user on temporary basis. Client to be informed. Level 4: if it is a superficial or cosmetic error. Client to be informed. All Level 3 and 4 bugs are listed in the Software Release Note.

IMPLEMENTATION

3.1

SYSTEM IMPLEMENTATION

Implementation is the process of converting a new system design into operation. Conversion is an important aspect of implementation. It is a less creative phase than the system design. It is primarily concerned with user training, site preparation, and file conversion. Conversion entails following steps: Review project plan, test documents and implement plan. Convert files. Log the computer rum for reference. Discontinue old system. Plan for post implementation.

There are three types of implementation:Implementation of a computer system to replace a manual system. The problems encountered are converting files, training users, creating accurate files and verifying printouts for integrity.

CIX

Implementation of a new computer system to replace an existing one. This is usually a difficult conversion. If not properly planned, there can be many problems. Some large computer systems have taken as long as a year to convert.

Implementation of a modified application to replace an existing system. This type of Prime concern during conversion is copying the old files to new system. Once a particular file is selected the next step is to specify data to be converted. A file comparison program is best used for verifying accuracy of copying process. Well planned test files are important for successful conversion. A test file should contain results, simplified error finding routines and printed result in seconds. It should also show new system handles difficult tasks.

conversion is relatively easy to handle, provided there are no major changes in the file.

CX

3.2 TYPES OF IMPLEMENTATION


There are three types of implementation: Change over implementation Staged implementation Direct implementation In changeover implementation the old running system of organization is totally vanished and instead a new more advanced system has been made. In staged system, the changes in the system are made in a timely manner so that the working of the system wont affect. In direct implementation part of a current system is changed with the immediate affect by following a strategy.

CXI

3.3

PREPARATION OF IMPLEMENTATION

IMPLEMENTATION

COMPUTER TESTING IMPLEMENTATION

EDUCATION AND TRAINING

FULL SYSTEM TESTING

FILE SET UP

FILE CONVERSATION

Limitation Computerized System is than but better manual

CHANGEOVER

AMENDMENT

operating a computerized system requires training. So to handle and to maintain this system we require technically trained people. Result Result of this report is that this is a system developed in NetBeans and requires Windows or Dos operating system to run. It is a GUI based system from which you can choose drawing and painting options to perform operations. This system is flexible and less time consuming than Manual System.

CXII

CXIII

Anda mungkin juga menyukai