aminta report

Upload: kishorjacob

Post on 30-May-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Aminta Report

    1/97

    ACKNOWLEDGEMENT

    First of all we would like to thank almighty GOD for his mercy and love for keeping as in

    good health and sound mind to complete the project successfully. We express our heartfelt thanks

    to my individuals for their suggestions and comments during the project.

    At this time submitting this software, we would like to use this opportunity to express our

    deep and heart felt thanks to all other teachers, friends and well wishers who motivated as

    throughout this project work.

    We deem it a great pleasure to express our deep sense of the indebtedness and heartfelt

    thanks to Mrs. Suneetha S, The Principal, college of Applied Science Kattappana , for her

    valuable guidance and providing healthy environment within the lab and all help to complete this

    project.We express our deep sense of guidance to Mr. Jehan Shanth K.Kand DhanniyaP.J

    project guide, for his valuable encouragement, constant guidance and help rendered during tenure

    for this project.

    We take this opportunity to express our special thanks to all other teachers of computer

    department, for their selfless efforts in providing the useful information and remarkable

    suggestions throughout the project work. We also thank our parents, all faculty members, librarian,

    friends, other staffs and well wishers who have helped us to do this project well and successfully.

    Before closing we once again express our sincere thanks to God and allSubmitted in Fulfillment

    of the requirements for award of degree of B.Sc Computer Science.

    By

    Anu Mathew

    Aminta Liz

    Aswathy Unnikrishnan

    1

  • 8/14/2019 Aminta Report

    2/97

    DECLARATION

    We here by declare that the entire work embodied in this project report entitled BIKE

    SHOWROOM MANAGEMENT SYSTEM has been carried out by us at in the College of

    Applied System Kattappana under the supervision of Mr. Jehan Shanth K.K and successfully

    completed in December 2008. The contents have been presented in the form of dissertation in

    partial fulfillment of the requirement for the award of the Bachelor of science in Computer

    Science, at the department of computer Science, College of Applied Science Kattappana.

    We further declare that this dissertation or any part therefore has not been submitted elsewhere

    for any other degree.

    ANU MATHEW

    AMINTA LIZ

    ASWATHY UNNIKRISHNAN

    Place: Kattappana

    Date: 14-01-2010

    2

  • 8/14/2019 Aminta Report

    3/97

    SYNOPSIS

    This project is an attempt to computerize the working of aBIKESHOWROOM

    MANAGEMENT SYSTEM. This is an honest attempt to realize the need and to solve it.

    This project gives care for the user convenient and simplicity. The main objective is

    to minimize the drawbacks of the manual system. The system is tries to provide additionalincreased speed, more accuracy and efficiency.

    The project BIKE SHOWROOM MANAGEMENT SYSTEM for

    HONDAShowroom has been develop to work in Windows98 or above Operating System with

    java as front-end and MS Access as back end .This is because of the user interaction and better

    handling of report and forms java selected as front-end to the project.

    The following are the activities carried out in the concern.

    Registering Customers and saled items

    Keeping the Records of purchase and sales

    Billing

    TABLE OF CONTENTS

    3

  • 8/14/2019 Aminta Report

    4/97

    1. INTRODUCTION TO PROJECT

    2. SYSTEM STUDY

    2.1 STUDY PHASE

    2.2 DESIGN PHASE

    2.3 DEVELOPMENT PHASE

    2.4 OPERATION PHASE

    3. SOFTWARE DESCRIPTION

    3.1 INTRODUCTIONTO JAVA

    3.2 JDBC

    3.3 FRAME

    3.4 MICROSOFTT ACCESS

    5. TABLESTRUCTURE

    6. DATAFLOW DIAGRAM

    7. SOURCE CODE

    8. OUTPUT FORMS

    9. CONCLUSION

    10. BIBLIOGRAPHY

    INRODUCTION TO PROJECT

    4

  • 8/14/2019 Aminta Report

    5/97

    Today, computer specialists as other professionals are challenged to update with the

    growing technology. The project what we hava undertaken is Bike Showroom Management

    System for Honda Showroom. This project will help employees in the Bike Showroom to

    manage their activities.

    The project work includes following modules.1. Login Module.

    Password protected login to the system.

    2. Customer Module.

    Deals the details of customer of showroom.

    3. Stock Module.

    Contains stock details and a sub module called Description. In the stock module we enterthe stock of the vehicles in the showroom at present. In the Description module we describe all the

    details, characteristics and specification of the vehicle.

    4. Purchase Module.

    Contains purchase details.

    5. Sales Module.

    Contains sales details and a sub module called Billing. In the Billing module we are

    registering all the details about the customer and preparing the bill.

    5

  • 8/14/2019 Aminta Report

    6/97

    SYSTEM STUDY

    INITIAL INVESTIGATION

    It is an important virtual part in the system analysis .The preliminary investigation is

    aimed at classifying the operational and economic feasibility of the request for the new system

    .The initial has objective of determining the validity of the user request for a candidate system

    whether a feasibility study should be conducted .An initial investigation is to determine an

    alternative system can solve the problem of existing system .The initial investigation of the

    project was started with the visit ofHonda showroom at Kattappana.Inorder to study the

    existing system details ,we used the technique such as data collection ,personal interview and

    onsite observation etc.

    EXISTING SYSTEM

    The existing activities are done manually. Since all works are done manually, work done ismaximum and more man power is required. A data eatery process done manually, a lot of time and

    effort is needed for the proper functionality of the system .In existing system very large space is

    required to store all details .

    PROPOSED SYSTEM

    Main objective of the proposed is to eliminate their limitations of the existing manual

    system .Computers are fast tireless machines that are processed huge amount of data quickly and

    efficiently and give the output in the required format. The overhead cost reduction is also one of the

    objectives of the existing system .This achieved by reduced labor and reduced data maintenance.

    FEASIBILITY STUDY

    The feasibility of designing the system determined by evaluating alternative methods of

    converting available input data into required output .Each of these alternative methods that is

    termed as candidate system. The purpose of feasibility study is to identify various candidate

    systems and to evaluate system.

    STUDY PHASE

    The study phase is the first of the four phases in the system development life cycle. Study

    phase is the lifecycle phase in which a problem is defined and a system is recommended as a

    solution. Information service request identifies the perceived problem and the scope of the study to

    be under taken. Initial investigation is an investigation performed to clarify the business

    information system problem and a project directive.

    6

  • 8/14/2019 Aminta Report

    7/97

    Project directive is the final version of an information request. System performance

    definition is the transition form a logical performance requirement to a physical one. Feasibility

    analysis is a procedure for identifying candidate systems and selecting the most feasible. Study

    phase is a comprehensive report prepared at the conclusion of the study activities.

    DESIGN PHASE

    Design phase is the second phase is the system development life cycle. In this phase

    computer information system is designed in detailed from system specifications, generated during

    study phase. A data flow diagram that has been expanded in detail until each of the processing unit,

    processing function can be identified.

    A system flow chart that has been expanded in detail. Design phase report is a report

    prepared at the end of the design phase. Design specification is a baseline specification that serves

    as a blue print for the construction of a computer based business information system. Design phase

    review held with the user organization at the conclusion of the design phase.

    DEVELOPMENT PHASE

    In development phase the computer information system is constructed from the detailed

    specification prepared in the design phase. The system development life cycle phase in which the

    system is constructed according to the design phase specification.

    Implementation plan is a plan for implementing a system that includes test plan, an

    equipment acquisition plan, and a conversion plan. Development phase report is a report prepared

    at the end of the development phase. Other main activities in the development phase are system

    specification, user acceptance review, implementation, conversion and changeover.OPERATION PHASE

    The operation phase is the fourth and last phase of the system development life cycle phase.

    Operation phase is the phase involving changeover from the old system to the new system where

    the system is operated, evaluated and changed as necessary. The main operation phase activities are

    system changeover, routine operations, standards, response time and usability.

    SOFTWARE DESCRIPTION

    7

  • 8/14/2019 Aminta Report

    8/97

    INTRODUCTION TO JAVA

    Java is general purpose, object-oriented programming language developed by the sun

    Microsystems of USA in 1991. Originally called OAK James Gosling, one of the inventors of

    javas designed for the development of software for consumer electronic devices.

    Java can be used to create two types of programs. Application Programs and Applet

    Programs. Application Programs that run on your computer under the operating system of the

    computer. Applets are programs designed to be transmitted over the internet and executed by the

    java compatible web browser. It is tiny programs dynamically download across the network, can

    react to user input and dynamically change.

    JAVA BUZZWORDS

    Simple

    Object-oriented

    Distributed

    Interpreted

    Robust

    Secure

    Architecture-neutral

    Portable

    High Performance

    Multithread

    Dynamic

    SIMPLE

    Java is simpler to learn than other language like c++, because Java developers intentionally

    removed much of the difficulties programmers uncounted with earlier programming language.Indeed java was build to be easier to learn and use than c++, features that java omits are not used as

    might think and often they lead to overly complex software design and difficulties in maintaining

    code. While eliminating complexity, java team introduced garbage collection to further simplify the

    language.

    OBJECT ORIENTED

    Like, c++ java is an object oriented language. Object oriented language allows the

    programmers to organize the program so that it closely models the world in structure and in the

    interaction among its components. This is particularly valuable in implementing application using

    8

  • 8/14/2019 Aminta Report

    9/97

  • 8/14/2019 Aminta Report

    10/97

    We can use java with a variety of CPU and operating system architecture. To achieve this

    design goal java compiler provides architecture-neutral object files or java byte codes from the java

    source code you write. Assuming that the java runtimes environment exits on the client system end

    result, the byte code execute regardless of platforms. This architecture works not only for the

    network but also for the standard software distribution.

    PORTABLE

    Java system is highly portable. One part of the portability equation is javas representation

    of data types. Being implementation dependent, although being highly portable hampers C and C+

    +. That is the sizes and highly behavior of arithmetic on these types is explicitly specified. Their

    representation and arithmetic behavior are consistent from system to system. The java class

    libraries include portable interfaces for each platforms on which the runtimes environment is

    available. For example an abstract window class and implementation or it is available for Sun

    Solaris, Window and Macintosh. When using this graphics interfaces, java automatically loads the

    appropriate platforms specific interfaces for the current machine.

    HIGH PERFORMANCE

    Java performance is impressive for an interpreted mostly because of the development of

    Just In Time (JIT) compiler that optimize the codes on the fly. Java programs execute at speed

    Nearly undistinguished from native C/C++ programs. Although interpreting byte codes is faster

    than interpreting raw programming language. Since they are already in an intermediate stage, the

    java architecture is designed to reduce overhead during runtime,

    Additionally threads are incorporated into which further enhance the overall perceived

    speed of java executables. Although javas performance is impressive when compared to their

    interpreted language may developers are concerned that it is still to slow to use where raw speed is

    the factors. Some accounts have java program running anywhere from 10 to 30 times slower than

    C/C++ counter parts. Future release of java is likely to include and optimized compiler and a faster

    runtime environment.

    MULTITHREAD

    Multithreading is a major features of java giving executable the ability to maintain

    several threads of execution at one time. A good example of thread in action is the garbage

    collection features of the java language. This facility is low priority threads, which run in the

    background as other

    tasks, are executing. It monitors objects and all reference to them when they are no longer in use.

    Because a thread running in the background controls this processes other go on undistributed.

    DYNAMIC

    10

  • 8/14/2019 Aminta Report

    11/97

    Fundamentally distributed computing environment must be dynamic. Java was

    designed to adapt in a consistently involving environment. It is capable of incorporating new

    functionally regardless of where that functionally comes from the computer system, the local and

    wide area network and the internets are all potential contributors. In object oriented C++

    environment developers dont write every line of code themselves. Instead they relay on wide array

    of libraries to extend functionally of these programs.

    If the developers have the ability to simplify recompile the programs with the update library

    and then get it in customers hand in time, everything would be fine. In this regarded object oriented

    goal of C++ falls short of mark.

    THE THREE OPP PRINCIPLES

    ENCAPSULATIONEncapsulation is the mechanism that blinds together code and the data it manipulates and

    keeps both safe outside interferences and misuse. One way to think about encapsulation is as a

    wrapper that prevents the code and data from being arbitrary accessed by other code defined

    outsiders the wrapper is tightly controlled through a well-defined interface. To relate this to the real

    world, consider the automatic transmission on an automobile.

    In java the basic of encapsulation is a class. Although class will helpful examined in

    grater detail later in this book, he following brief discussion will be shared by a set objects are

    sometimes referred to as instance of a class. Thus a class is a logic construct an object has physical

    reality.

    The private methods and data can only accessed by code that is a member of the

    class. Therefore any other code that is not a member of the class cannot access a private method or

    variable.

    INHERITANCE

    Inheritance is the process by which one object the properties of another object. This is

    important because it supports the concepts of hierarchical classification. Inheritance subtracts with

    encapsulation as well. If a given class encapsulates some attributes, then a subclass will have the

    same attributes plus any that adds as a part of its specialization. This is key concept, which lets

    object-oriented programs grows in a complexity linearly rather than geometrically. A new subclass

    inherits and of the attributes of all its ancestors.

    POLYMORPHISM

    Polymorphism is feature that allows one interface to be used for general class of action. The

    specific action is determined by the exact nature of the situation. Consider the stack; you might

    have a program that requires three tops of the stacks. One stack is used for integer values, one for

    characters.

    11

  • 8/14/2019 Aminta Report

    12/97

    More generally the concept of polymorphism is often expressed by the phrase one interface

    multiple methods . This means that it is possible to design a generic interface to be used to specify

    a general class of action. It is the compilers job to select the specification as its applets to each

    situation.

    JDBC

    INTRODUCTION TO JDBC

    The JDBC interfaces are a pure java API used to executes SQL statements. The JDBC provides

    a set of and interfaces that can be used by the developers to write data base applications. BasicJDBC interactions can be broken down into four steps:-

    Open a connection to data base.

    12

  • 8/14/2019 Aminta Report

    13/97

    Executes an SQL statement.

    Process the result

    Close the connection to the database.

    JDBC DRIVER TYPES

    Sun has defined four JDBC driver types:-

    JDBC-ODBC Bridge Plus ODBC driver.

    Type 1 driver use a bridge technology to connect a java client to an ODBC database

    service.

    Native-API, partly-java driver.

    Type 2 driver wrap a thin layer of java around database specific native code

    libraries.

    JDBC-net, pure java driver.

    A type 3 driver communicates via a generic network protocol to a piece of custom

    middleware.

    Native-protocol, pure.

    Type 4 driver are the most direct of the lot.

    Getting a connection

    The first step is using a JDBC driver to get a database connection involves loading thespecific driver class into the application JVM. An easy way to load the driver Class.forName ()

    method. Class.forName (sun.jdbc.odbc.jdbcodbcdriver); when the driver is loaded into the

    memory, it register itself with the java.sql.DriverManager class as an available database driver.

    The next step to ask the driver Manager class to open a connection to a given database,

    where the database is specified by a specifically formed URL. The method used for the open the

    connection is DriverManager.getConnection (). It returns a class that implements the

    java.sql.Connection interface:

    Connection Con=DriverManager.getConnection (jdbc: odbc: Tddb,password);

    EXECUTING SQL QUERIES

    The simplest way to execute the query is to use the java.sql.statementclass.statement objects

    are never instantiated directly: instead a program call the Statement () method of connection

    st=con.createStatement ();

    A query insert data can be execute using the executeUpdate method statement and insert data intothe database.

    Sql=INSERT INTO marklist (name, regno) VALUES (a,b);

    13

  • 8/14/2019 Aminta Report

    14/97

    St.esecuteUpdate (sql);

    FRAMES

    A frame is a window with a title bar and a border. Frames are created with class

    Frame that extends class window that inherits from container. Class window contain methods for

    window management. Window objects do not have title bars or borders. The default layout

    manager for window and frames is Border Layout.

    Frame is typically used to build windowed application. Frames are occasionally used with applets.

    Frame methods are as follows:

    Show Frame ();

    14

  • 8/14/2019 Aminta Report

    15/97

    This method is used to show a frame.

    F.hide ();

    F.dispose ();

    Component method hide remove the frame from the screen so theframe is no longer visible.

    Frame method dispose free the resource that were allocated to the Frame by the windowing system.

    Creating a Frame object using the statement

    F=new Frame ();

    Label object 1 is instantiated with a call to Label constructor. The label font is set with

    the setfont method. The Layout for the frame is set to a Flow layout and then the Label is added to

    the Frame with:

    F.add (1);

    The component method resize is used the frame to the specified width and height. The statement,

    F.show ();

    Component method show displays a component. Frames are not visible by default.

    BACK END: M.S.ACCESS

    Before being to use this software product, it is important to understand its

    capabilities and types of tasks it is designed to perform. Access is a multifaceted product whose use

    bounded only by your imagination.

    Essentially, Access is a Database Management System (DBMS) like other

    products in these category access stores and retrieves data, presents information, and other

    automates repetitive tasks.

    15

  • 8/14/2019 Aminta Report

    16/97

    Access is also a powerful window Application. Both windows and Access are for

    Microsoft, the two products work very well together. Access run on the windows platform, so all

    the advantages of windows is available in Access.

    TABLE STRUCTURE

    Tablename - DD

    Field Name Data Type Description

    user Text username

    password Text password

    Tablename-tbl_Cust

    Field Name Data Type Description

    Day Date/Time Date of registrationOrder no Number Order number

    Name Text Name of customer

    16

  • 8/14/2019 Aminta Report

    17/97

    Sex Text Sex of customer

    Address Text Address of customer

    Place Text Place of customer

    Vehicle Text Vehicle purchased

    Num Number Numer of vehicles

    Netamt Number Total amount

    Tablename - tbl_Vehicle

    Field Name Data Type Description

    Item name Text Name of vehicle

    Amount Number Price of vehicle

    Stock Number Number of vehicles

    Tablename - tbl_Pvehicle

    Field Name Data Type DescriptionCuDate Date/Time Date of purchase

    Itemname Text Name of vehicle

    Stock Number Number of vehiclesPriceper Number Price of vehicleIncrement Number Increment value

    Total Number Total amount

    Tablename - tbl_Svehicle

    Field Name Data Type DescriptionCuDate Date/Time Date of sale

    Itemname Text Name of vehicle

    Nums Number Numer of vehiclesPriceper Number Price of vehicle

    Total Number Total amount

    Tablename - tbl_Billing

    Field Name Data Type Description

    Billdate Date/Time Date of billBillno Number Bill number

    Orderno Number Order number

    17

  • 8/14/2019 Aminta Report

    18/97

    BIKE SHOWROOM

    MANAGEMENT SYSTEM

    DATA FLOW DIAGRAM

    Data flow is one of the best ways of documenting entered functionality of the system. Data

    flow diagram has the purpose of clarifying system requirements and identifies the transformation

    that will become programs in system design. So it is starting point of design phase. A DFD consist

    of a series of bubbles joined by the lines. Bubbles represent process and lines, data flow in system.

    BASIC DFD SYMBOLS

    Represents data flows

    Represents Process

    Context diagram is the big picture diagram before decomposition; it identifies domains or

    boundaries of system.

    CONTEXT DIAGRAM

    Request

    USER

    Result

    18

  • 8/14/2019 Aminta Report

    19/97

    19

  • 8/14/2019 Aminta Report

    20/97

    20

  • 8/14/2019 Aminta Report

    21/97

    21

  • 8/14/2019 Aminta Report

    22/97

    22

  • 8/14/2019 Aminta Report

    23/97

    23

  • 8/14/2019 Aminta Report

    24/97

    24

  • 8/14/2019 Aminta Report

    25/97

    SOURCE CODE

    //start

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class start extends JFrame implements ActionListener

    {

    JButton b1;

    JLabel l1;

    login l;

    Container c;

    start()

    {

    c=getContentPane();

    setTitle("HONDA SHOWROOM");

    b1=new JButton("LOGIN");

    b1.setForeground(Color.white);

    b1.setBounds(425,525,120,80);

    b1.addActionListener(this);

    Color c1=new Color(0,0,0);

    b1.setBackground(c1);

    c.add(b1);

    l1=new JLabel("",new ImageIcon("first.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent e)

    {

    if(e.getSource()==b1)

    {

    l=new login();

    l.setSize(1375,950);

    l.setVisible(true);

    25

  • 8/14/2019 Aminta Report

    26/97

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    start s=new start();

    s.setSize(1375,950);

    s.setVisible(true);

    }

    }

    //Login

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    class login extends JFrame implements ActionListener

    {

    menu1 m;

    JButton b1,b2;

    TextField t1,t2;

    JLabel l1,l2,l3;

    Font f=new Font("Roman",Font.BOLD,25);

    Connection con;

    Statement Sta;

    Container c;

    ResultSet rs;

    login()

    {

    setTitle("HONDA SHOWROOM");

    c=getContentPane();

    Color c1=new Color(155,128,180);

    c.setBackground(c1);

    l1=new JLabel("USERNAME");

    l2=new JLabel("PASSWORD");

    t1=new TextField();

    t2=new TextField();

    26

  • 8/14/2019 Aminta Report

    27/97

  • 8/14/2019 Aminta Report

    28/97

    public void actionPerformed(ActionEvent e)

    {

    if(e.getSource()==b1)

    {

    try

    {

    String s1=t1.getText();

    String s2=t2.getText();

    rs=Sta.executeQuery("select * from DD where user='"+s1+"'");

    if(rs.next())

    {

    if(rs.getString(2).equals(s2))

    {

    m=new menu1();

    m.setVisible(true);

    m.setSize(1200,725);

    setVisible(false);

    }

    else

    {

    JOptionPane.showMessageDialog(this,"password is

    incorrect","MESSAGE",JOptionPane.ERROR_MESSAGE);

    }

    }

    else

    {

    JOptionPane.showMessageDialog(this,"user name is

    incorrect","MESSAGE",JOptionPane.ERROR_MESSAGE);

    }

    }

    catch(Exception a)

    {

    }

    }

    if(e.getSource()==b2)

    {

    System.exit(0);

    28

  • 8/14/2019 Aminta Report

    29/97

    }

    }

    public static void main(String s[])

    {

    login l=new login();

    l.setVisible(true);

    l.setSize(1375,950);

    }

    }

    //menu

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class menu1 extends JFrame implements ActionListener

    {

    Container c;

    JMenuItem mi1,mi2,mi3,mi4,mi5,mi6,mi7,mi8,mi9,mi10,mj1,mj2;

    JLabel l1;

    menu1()

    {

    setTitle("HONDA SHOWROOM");

    c=getContentPane();

    addWindowListener(new WindowAdapter()

    {

    public void windowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    JMenuBar mb=new JMenuBar();

    JMenu m=new JMenu("Customer Details");

    mj1=new JMenuItem("View customer details");

    mj2=new JMenuItem("Update customer details");

    JMenu m1=new JMenu("Stock Details");

    mi1=new JMenuItem("Add Stock Details");

    29

  • 8/14/2019 Aminta Report

    30/97

    mi2=new JMenuItem("Update Stock Details");

    mi3=new JMenuItem("Delete Stock Details");

    mi4=new JMenuItem("Find Stock Details");

    mi5=new JMenuItem("Description");

    JMenu m2=new JMenu("Purchase Details");

    mi6=new JMenuItem("Purchase Vehicle Details");

    JMenu m3=new JMenu("Sales Details");

    mi7=new JMenuItem("Saled Vehicles");

    mi8=new JMenuItem("Add bills");

    mi9=new JMenuItem("View bills");

    JMenu m4=new JMenu("Exit");

    mi10=new JMenuItem("Exit");

    m.add(mj1);

    m.add(mj2);

    m1.add(mi1);

    m1.add(mi2);

    m1.add(mi3);

    m1.add(mi4);

    m1.add(mi5);

    m2.add(mi6);

    m3.add(mi7);

    m3.add(mi8);

    m3.add(mi9);

    m4.add(mi10);

    mb.add(m);

    mb.add(m1);

    mb.add(m2);

    mb.add(m3);

    mb.add(m4);

    setJMenuBar(mb);

    mj1.addActionListener(this);

    mj2.addActionListener(this);

    mi1.addActionListener(this);

    mi2.addActionListener(this);

    mi3.addActionListener(this);

    mi4.addActionListener(this);

    mi5.addActionListener(this);

    mi6.addActionListener(this);

    30

  • 8/14/2019 Aminta Report

    31/97

    mi7.addActionListener(this);

    mi8.addActionListener(this);

    mi9.addActionListener(this);

    mi10.addActionListener(this);

    l1=new JLabel("",new ImageIcon("third.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent ae)

    {

    if(ae.getSource()==mj1)

    {

    custview c1=new custview();

    c1.setSize(1375,950);

    c1.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mj2)

    {

    custupdate c2=new custupdate();

    c2.setSize(1375,950);

    c2.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi1)

    {

    stkadd s3=new stkadd();

    s3.setVisible(true);

    s3.setSize(1375,950);

    setVisible(false);

    }

    if(ae.getSource()==mi2)

    {

    stkupdate s3=new stkupdate();

    s3.setVisible(true);

    s3.setSize(1375,950);

    setVisible(false);

    31

  • 8/14/2019 Aminta Report

    32/97

    }

    if(ae.getSource()==mi3)

    {

    stkdelete s2=new stkdelete();

    s2.setVisible(true);

    s2.setSize(1375,950);

    setVisible(false);

    }

    if(ae.getSource()==mi4)

    {

    stkfind s3=new stkfind();

    s3.setVisible(true);

    s3.setSize(1375,950);

    setVisible(false);

    }

    if(ae.getSource()==mi5)

    {

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi6)

    {

    purchase p=new purchase();

    p.setSize(1375,950);

    p.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi7)

    {

    sale s=new sale();

    s.setSize(1375,950);

    s.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi8)

    {

    32

  • 8/14/2019 Aminta Report

    33/97

    billadd b=new billadd();

    b.setSize(1375,950);

    b.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi9)

    {

    viewbill b1=new viewbill();

    b1.setSize(1375,950);

    b1.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi10)

    {

    System.exit(0);

    }

    }

    public static void main(String s[])

    {

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    }

    }//customer details

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.awt.*;

    import java.awt.event.*;

    import java.sql.*;

    public class custview extends JFrame implements ActionListener

    {

    JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;

    JTextField t1,t2,t3,t4,t5,t6,t7,t8,t9;

    JButton b1,b2,b3,b4,b5;

    String s,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10;

    Connection con;

    Statement sta;

    33

  • 8/14/2019 Aminta Report

    34/97

    Container c;

    ResultSet rs;

    custview()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    setTitle(" VIEW CUSTOMER DETAILES");

    Color c1=new Color(220,0,255);

    c.setBackground(c1);

    b1=new JButton("VIEW");

    b2=new JButton("EXIT");

    b3=new JButton("CLEAR");

    b4=new JButton("BACK");

    l1=new JLabel(" CUSTOMER DETAILES");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,19));

    l1.setForeground(Color.blue);

    l2=new JLabel("Date");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Order No*");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Name");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l5=new JLabel("Sex");

    l5.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l6=new JLabel("Address");

    l6.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l7=new JLabel("Place");

    l7.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l8=new JLabel("Vehicle");

    l8.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l9=new JLabel("Number");

    34

  • 8/14/2019 Aminta Report

    35/97

  • 8/14/2019 Aminta Report

    36/97

    b3.setBounds(125,580,100,45);

    b4.setBounds(250,580,100,45);

    b1.addActionListener(this);

    b2.addActionListener(this);

    b3.addActionListener(this);

    b4.addActionListener(this);

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:sample");

    sta=con.createStatement();

    }

    catch(Exception e)

    {

    }

    }

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="VIEW")

    {

    int a=Integer.parseInt(t2.getText());

    rs=sta.executeQuery("select * from tbl_cust where Orderno="+a);

    if(rs.next())

    {

    t1.setText(rs.getString(1));

    t3.setText(rs.getString(3));

    t4.setText(rs.getString(4));

    t5.setText(rs.getString(5));

    t6.setText(rs.getString(6));

    t7.setText(rs.getString(7));

    t8.setText(rs.getString(8));

    t9.setText(rs.getString(9));

    }

    else

    {

    36

  • 8/14/2019 Aminta Report

    37/97

    JOptionPane.showMessageDialog(this,"RECORD NOT

    FOUND","VIEW",JOptionPane.INFORMATION_MESSAGE);

    }

    }

    if(ae.getActionCommand()=="CLEAR")

    {

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    t6.setText(" ");

    t7.setText(" ");

    t8.setText(" ");

    t9.setText(" ");

    }

    if(ae.getActionCommand()=="EXIT")

    {

    setVisible(false);

    }

    if(ae.getActionCommand()=="BACK")

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    setVisible(false);

    }

    }

    catch(Exception e)

    {

    }

    }

    public static void main(String args[])

    {

    custview c1=new custview();

    c1.setSize(1375,950);

    37

  • 8/14/2019 Aminta Report

    38/97

  • 8/14/2019 Aminta Report

    39/97

    b5=new JButton("BACK");

    l1=new JLabel("CUSTOMER DETAILES");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,19));

    l1.setForeground(Color.blue);

    l2=new JLabel("Date");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Order No*");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Name");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l5=new JLabel("Sex");

    l5.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l6=new JLabel("Address");

    l6.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l7=new JLabel("Place");

    l7.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l8=new JLabel("Vehicle");

    l8.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l9=new JLabel("Number");

    l9.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l10=new JLabel("Net Amt");

    l10.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    t1=new JTextField();

    t2=new JTextField();

    t3=new JTextField();

    t4=new JTextField();

    t5=new JTextField();

    t6=new JTextField();

    t7=new JTextField();

    t8=new JTextField();

    t9=new JTextField();

    c.add(l1);c.add(l2);c.add(l3);c.add(l4);c.add(l5);

    c.add(l6);c.add(l7);c.add(l8);c.add(l9);

    c.add(t1);c.add(t2);c.add(t3);c.add(t4);c.add(t5);

    c.add(t6);c.add(t7);c.add(t8);c.add(t9);c.add(b5);

    c.add(b1);c.add(b2);c.add(b3);c.add(b4);c.add(l10);

    l1.setBounds(150,15,200,25);

    l2.setBounds(100,50,150,25);

    39

  • 8/14/2019 Aminta Report

    40/97

    l3.setBounds(100,100,150,25);

    l4.setBounds(100,150,150,25);

    l5.setBounds(100,200,150,25);

    l6.setBounds(100,250,150,25);

    l7.setBounds(100,300,150,25);

    l8.setBounds(100,350,150,25);

    l9.setBounds(100,400,150,25);

    l10.setBounds(100,450,150,25);

    t1.setBounds(250,50,150,25);

    t2.setBounds(250,100,150,25);

    t3.setBounds(250,150,150,25);

    t4.setBounds(250,200,150,25);

    t5.setBounds(250,250,150,25);

    t6.setBounds(250,300,150,25);

    t7.setBounds(250,350,150,25);

    t8.setBounds(250,400,150,25);

    t9.setBounds(250,450,150,25);

    b1.setBounds(100,500,100,45);

    b2.setBounds(225,500,100,45);

    b3.setBounds(350,500,100,45);

    b4.setBounds(150,580,100,45);

    b5.setBounds(275,580,100,45);

    b1.addActionListener(this);

    b2.addActionListener(this);

    b3.addActionListener(this);

    b4.addActionListener(this);

    b5.addActionListener(this);

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:sample");

    sta=con.createStatement();

    }

    catch(Exception e)

    {

    }

    }

    40

  • 8/14/2019 Aminta Report

    41/97

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="FIND")

    {

    int a=Integer.parseInt(t2.getText());

    rs=sta.executeQuery("select * from tbl_cust where Orderno="+a);

    if(rs.next())

    {

    t1.setText(rs.getString(1));

    t3.setText(rs.getString(3));

    t4.setText(rs.getString(4));

    t5.setText(rs.getString(5));

    t6.setText(rs.getString(6));

    t7.setText(rs.getString(7));

    t8.setText(rs.getString(8));

    t9.setText(rs.getString(9));

    }

    else

    {

    JOptionPane.showMessageDialog(this,"RECORD NOT

    FOUND","VIEW",JOptionPane.INFORMATION_MESSAGE);

    }

    }

    if(ae.getActionCommand()=="CLEAR")

    {

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    t6.setText(" ");

    t7.setText(" ");

    t8.setText(" ");

    t9.setText(" ");

    }

    if(ae.getActionCommand()=="EXIT")

    41

  • 8/14/2019 Aminta Report

    42/97

    {

    setVisible(false);

    }

    if(ae.getActionCommand()=="UPDATE")

    {

    s=t1.getText();

    s1=t2.getText();

    int b=Integer.parseInt(s1);

    s2=t3.getText();

    s3=t4.getText();

    s4=t5.getText();

    s5=t6.getText();

    s6=t7.getText();

    s7=t8.getText();

    int c=Integer.parseInt(s7);

    s8=t9.getText();

    int d=Integer.parseInt(s8);

    String k="UPDATE tbl_cust set

    Day='"+s+"',Name='"+s2+"',Sex='"+s3+"',Address='"+s4+"',Place='"+s5+"',Vehicle='"+s6+"',Num

    ="+c+",Netamt="+d+" where Orderno="+b;

    sta.executeUpdate (k);

    JOptionPane.showMessageDialog(this,"Update the

    Record","UPDATE",JOptionPane.INFORMATION_MESSAGE);

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    t6.setText(" ");

    t7.setText(" ");

    t8.setText(" ");

    t9.setText(" ");

    }

    if(ae.getActionCommand()=="BACK")

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    42

  • 8/14/2019 Aminta Report

    43/97

    m.setSize(1375,950);

    setVisible(false);

    }

    }

    catch(Exception e)

    {

    }

    }

    public static void main(String args[])

    {

    custupdate c2=new custupdate();

    c2.setSize(1375,950);

    c2.setVisible(true);

    }

    }

    //Add stock details

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class stkadd extends JFrame implements ActionListener

    {

    JButton b1,b2,b3,b4;

    JLabel l1,l2,l3,l4;

    JTextField t1,t2;

    JComboBox cb1;

    Connection con;

    Statement st;

    ResultSet rs;

    String s,s1,s2;

    Container c;

    stkadd()

    {

    addWindowListener(new WindowAdapter()

    {

    43

  • 8/14/2019 Aminta Report

    44/97

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    Color c1=new Color(0,128,255);

    c.setBackground(c1);

    setTitle("ADD STOCK DETAILS");

    l1=new JLabel(" STOCK DETAILS");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    l1.setForeground(Color.black);

    b1=new JButton("Back");

    b1.addActionListener(this);

    b2=new JButton("Add");

    b2.addActionListener(this);

    b3=new JButton("Exit");

    b3.addActionListener(this);

    b4=new JButton("Clear");

    b4.addActionListener(this);

    cb1=new JComboBox();

    cb1.addActionListener(this);

    cb1.addItem("Honda Shine");

    cb1.addItem("Honda Stunner");

    cb1.addItem("Honda Unicorn");

    cb1.addItem("Honda Activa");

    cb1.addItem("Honda Eterno");

    cb1.addItem("Honda Dio");

    t1=new JTextField();

    t2=new JTextField();

    l2=new JLabel("Vehicle");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Stock ");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Per Amount");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    c.add(l1);

    44

  • 8/14/2019 Aminta Report

    45/97

    c.add(l2);

    c.add(l3);

    c.add(l4);

    c.add(b1);

    c.add(b2);

    c.add(b3);

    c.add(b4);

    c.add(cb1);

    c.add(t1);

    c.add(t2);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    l4.setBounds(100,150,150,25);

    b1.setBounds(125,210,110,40);

    b2.setBounds(250,210,110,40);

    b3.setBounds(125,270,110,40);

    b4.setBounds(250,270,110,40);

    cb1.setBounds(250,55,150,25);

    t1.setBounds(250,100,150,25);

    t2.setBounds(250,150,150,25);

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:sample");

    st=con.createStatement();

    }

    catch(Exception e)

    {

    }

    }

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="Back")

    {

    45

  • 8/14/2019 Aminta Report

    46/97

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    setVisible(false);

    }

    if(ae.getActionCommand()=="Add")

    {

    s=(String)(cb1.getSelectedItem());

    s1=t1.getText();

    int b=Integer.parseInt(s1);

    s2=t2.getText();

    int c=Integer.parseInt(s2);

    String g="INSERT INTO tbl_Vehicle values('"+s+"',"+c+","+b+")";

    JOptionPane.showMessageDialog(this,"Add the

    Record","Add",JOptionPane.INFORMATION_MESSAGE);

    st.executeUpdate(g);

    t1.setText(" ");

    t2.setText(" ");

    }

    if(ae.getActionCommand()=="Clear")

    {

    t1.setText(" ");

    t2.setText(" ");

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    }

    catch(Exception z)

    {

    }

    }

    public static void main(String s[])

    {

    stkadd s3=new stkadd();

    46

  • 8/14/2019 Aminta Report

    47/97

    s3.setVisible(true);

    s3.setSize(1375,950);

    }

    }

    //update stock

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class stkupdate extends JFrame implements ActionListener

    {

    JButton b1,b2,b3,b4,b5;

    JLabel l1,l2,l3,l4;

    JTextField t1,t2;

    JComboBox cb1;

    Connection con;

    Statement st;

    ResultSet rs;

    String s,s1,s2;

    Container c;

    stkupdate()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    47

  • 8/14/2019 Aminta Report

    48/97

    Color c1=new Color(0,128,255);

    c.setBackground(c1);

    setTitle("UPDATE STOCK DETAILS");

    l1=new JLabel(" STOCK DETAILS");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    l1.setForeground(Color.black);

    b1=new JButton("Back");

    b1.addActionListener(this);

    b2=new JButton("Update");

    b2.addActionListener(this);

    b3=new JButton("Find");

    b3.addActionListener(this);

    b4=new JButton("Clear");

    b4.addActionListener(this);

    b5=new JButton("Exit");

    b5.addActionListener(this);

    cb1=new JComboBox();

    cb1.addActionListener(this);

    t1=new JTextField();

    t2=new JTextField();

    l2=new JLabel("Vehicle*");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Stock ");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Per Amount");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    c.add(l1);c.add(l2);c.add(l3);c.add(l4);c.add(b1);

    c.add(b2);c.add(b3);c.add(b4);c.add(b5);c.add(cb1);

    c.add(t1);c.add(t2);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    l4.setBounds(100,150,150,25);

    b1.setBounds(100,210,110,40);

    b2.setBounds(225,210,110,40);

    b3.setBounds(350,210,110,40);

    b4.setBounds(170,270,110,40);

    b5.setBounds(290,270,110,40);

    48

  • 8/14/2019 Aminta Report

    49/97

    cb1.setBounds(250,55,150,25);

    t1.setBounds(250,100,150,25);

    t2.setBounds(250,150,150,25);

    cb1.addItem("Honda Shine");

    cb1.addItem("Honda Stunner");

    cb1.addItem("Honda Unicorn");

    cb1.addItem("Honda Activa");

    cb1.addItem("Honda Eterno");

    cb1.addItem("Honda Dio");

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:sample");

    st=con.createStatement();

    }

    catch(Exception e)

    {

    }

    }

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="Back")

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    setVisible(false);

    }

    if(ae.getActionCommand()=="Update")

    {

    s=(String)(cb1.getSelectedItem());

    s1=t1.getText();

    int b=Integer.parseInt(s1);

    s2=t2.getText();

    49

  • 8/14/2019 Aminta Report

    50/97

    int c=Integer.parseInt(s2);

    String k="UPDATE tbl_Vehicle set Amount="+c+",stock="+b+" where

    Itemname='"+s+"'";

    JOptionPane.showMessageDialog(this,"Update the

    Record","update",JOptionPane.INFORMATION_MESSAGE);

    st.executeUpdate (k);

    t1.setText(" ");

    t2.setText(" ");

    }

    if(ae.getActionCommand()=="Find")

    {

    s=(String)(cb1.getSelectedItem());

    rs=st.executeQuery("select * from tbl_Vehicle where Itemname='"+s+"'");

    if(rs.next())

    {

    t2.setText(rs.getString(2));

    t1.setText(rs.getString(3));

    }

    else

    {

    JOptionPane.showMessageDialog(this,"RECORD NOT

    FOUND","Find",JOptionPane.INFORMATION_MESSAGE);

    }

    }

    if(ae.getActionCommand()=="Clear")

    {

    t1.setText(" ");

    t2.setText(" ");

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    }

    catch(Exception z)

    {

    }

    50

  • 8/14/2019 Aminta Report

    51/97

  • 8/14/2019 Aminta Report

    52/97

    Color c1=new Color(0,128,255);

    c.setBackground(c1);

    setTitle("FIND STOCK DETAILS");

    l1=new JLabel(" STOCK DETAILS");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    l1.setForeground(Color.black);

    b1=new JButton("Back");

    b1.addActionListener(this);

    b2=new JButton("Exit");

    b2.addActionListener(this);

    b3=new JButton("Find");

    b3.addActionListener(this);

    b4=new JButton("Clear");

    b4.addActionListener(this);

    cb1=new JComboBox();

    cb1.addActionListener(this);

    t1=new JTextField();

    t2=new JTextField();

    l2=new JLabel("Vehicle*");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Stock ");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Per Amount");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    c.add(l1);

    c.add(l2);

    c.add(l3);

    c.add(l4);

    c.add(b1);

    c.add(b2);

    c.add(b3);

    c.add(b4);

    c.add(cb1);

    c.add(t1);

    c.add(t2);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    52

  • 8/14/2019 Aminta Report

    53/97

  • 8/14/2019 Aminta Report

    54/97

    {

    s=(String)(cb1.getSelectedItem());

    rs=st.executeQuery("select * from tbl_Vehicle where Itemname='"+s+"'");

    if(rs.next())

    {

    t2.setText(rs.getString(2));

    t1.setText(rs.getString(3));

    }

    else

    {

    JOptionPane.showMessageDialog(this,"RECORD NOT

    FOUND","Find",JOptionPane.INFORMATION_MESSAGE);

    }

    }

    if(ae.getActionCommand()=="Clear")

    {

    t1.setText(" ");

    t2.setText(" ");

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    }

    catch(Exception z)

    {

    }

    }

    public static void main(String s[])

    {

    stkfind s3=new stkfind();

    s3.setVisible(true);

    s3.setSize(1375,950);

    }

    }

    //delete stock details

    54

  • 8/14/2019 Aminta Report

    55/97

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class stkdelete extends JFrame implements ActionListener

    {

    JButton b1,b2,b3,b4,b5;

    JLabel l1,l2,l3,l4;

    JTextField t1,t2,t3;

    JComboBox cb1;

    Connection con;

    Statement st;

    ResultSet rs;

    String s,s1,s2;

    Container c;

    stkdelete()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    Color c1=new Color(0,128,255);

    c.setBackground(c1);

    setTitle("DELETE STOCK DETAILS");

    l1=new JLabel(" STOCK DETAILS");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    l1.setBackground(Color.white);

    l1.setForeground(Color.black);

    b1=new JButton("Back");

    b1.addActionListener(this);

    55

  • 8/14/2019 Aminta Report

    56/97

    b2=new JButton("Delete");

    b2.addActionListener(this);

    b3=new JButton("Find");

    b3.addActionListener(this);

    b4=new JButton("Clear");

    b4.addActionListener(this);

    b5=new JButton("Exit");

    b5.addActionListener(this);

    cb1=new JComboBox();

    cb1.addActionListener(this);

    t1=new JTextField();

    t2=new JTextField();

    l2=new JLabel("Vehicle*");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Stock ");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Per Amount");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    c.add(l1);c.add(l2);c.add(l3);c.add(l4);c.add(b1);

    c.add(b2);c.add(b3);c.add(b4);c.add(b5);c.add(cb1);

    c.add(t1);c.add(t2);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    l4.setBounds(100,150,150,25);

    b1.setBounds(100,210,110,40);

    b2.setBounds(225,210,110,40);

    b3.setBounds(350,210,110,40);

    b4.setBounds(130,270,110,40);

    b5.setBounds(255,270,110,40);

    cb1.setBounds(250,55,150,25);

    t1.setBounds(250,100,150,25);

    t2.setBounds(250,150,150,25);

    cb1.addItem("Honda Shine");

    cb1.addItem("Honda Stunner");

    cb1.addItem("Honda Unicorn");

    cb1.addItem("Honda Activa");

    cb1.addItem("Honda Eterno");

    56

  • 8/14/2019 Aminta Report

    57/97

  • 8/14/2019 Aminta Report

    58/97

    if(rs.next())

    {

    t2.setText(rs.getString(2));

    t1.setText(rs.getString(3));

    }

    else

    {

    JOptionPane.showMessageDialog(this,"RECORD NOT

    FOUND","Find",JOptionPane.INFORMATION_MESSAGE);

    }

    }

    if(ae.getActionCommand()=="Clear")

    {

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    }

    catch(Exception z)

    {

    }

    }

    public static void main(String s[])

    {

    stkdelete s2=new stkdelete();

    s2.setVisible(true);

    s2.setSize(1375,950);

    }

    }//description of vehicles

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    58

  • 8/14/2019 Aminta Report

    59/97

    import java.io.*;

    import java.sql.*;

    public class des extends JFrame implements ActionListener

    {

    Container c;

    JMenuItem mi1,mi2,mi3,mi4,mi5,mi6,mj1,mj2;

    JLabel l1,l2;

    des()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    setTitle("DESCRIPTION");

    c=getContentPane();

    Color c1=new Color(176,176,255);

    c.setBackground(c1);

    JMenuBar mb=new JMenuBar();

    setJMenuBar(mb);

    JMenu m=new JMenu("Select vehicle");

    mi1=new JMenuItem("Honda Dio");

    mi2=new JMenuItem("Honda Activa");

    mi3=new JMenuItem("Honda Eterno");

    mi4=new JMenuItem("Honda Shine");

    mi5=new JMenuItem("Honda Stunner");

    mi6=new JMenuItem("Honda Unicorn");

    JMenu m1=new JMenu("Exit");

    mj1=new JMenuItem("Exit");

    mj2=new JMenuItem("Back");

    m.add(mi1);

    m.add(mi2);

    m.add(mi3);

    m.add(mi4);

    m.add(mi5);

    m.add(mi6);

    59

  • 8/14/2019 Aminta Report

    60/97

    m1.add(mj1);

    m1.add(mj2);

    mb.add(m);

    mb.add(m1);

    mi1.addActionListener(this);

    mi2.addActionListener(this);

    mi3.addActionListener(this);

    mi4.addActionListener(this);

    mi5.addActionListener(this);

    mi6.addActionListener(this);

    mj1.addActionListener(this);

    mj2.addActionListener(this);

    l1=new JLabel("",new ImageIcon("fourth.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent ae)

    {

    if(ae.getSource()==mi1)

    {

    dio d1=new dio();

    d1.setSize(1375,950);

    d1.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi2)

    {

    activa a=new activa();

    a.setSize(1375,950);

    a.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi3)

    {

    eterno e=new eterno();

    e.setSize(1375,950);

    e.setVisible(true);

    60

  • 8/14/2019 Aminta Report

    61/97

    setVisible(false);

    }

    if(ae.getSource()==mi4)

    {

    shine s2=new shine();

    s2.setSize(1375,950);

    s2.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi5)

    {

    stunner s3=new stunner();

    s3.setSize(1375,950);

    s3.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mi6)

    {

    unicorn u=new unicorn();

    u.setSize(1375,950);

    u.setVisible(true);

    setVisible(false);

    }

    if(ae.getSource()==mj1)

    {

    System.exit(0);

    }

    if(ae.getSource()==mj2)

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    61

  • 8/14/2019 Aminta Report

    62/97

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    }

    }

    //vehicle-Activa

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class activa extends JFrame implements ActionListener

    {

    JButton b1;

    JLabel l1;

    Container c;

    activa()

    {

    c=getContentPane();

    setTitle("HONDA ACTIVA");

    Color c2=new Color(171,123,223);

    c.setBackground(c2);

    b1=new JButton("BACK");

    b1.setForeground(Color.black);

    b1.setBounds(750,300,120,80);

    Color c1=new Color(255,185,255);

    b1.setBackground(c1);

    b1.addActionListener(this);

    c.add(b1);

    l1=new JLabel("",new ImageIcon("Activa.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent e)

    {

    if(e.getSource()==b1)

    62

  • 8/14/2019 Aminta Report

    63/97

    {

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    activa a=new activa();

    a.setSize(700,650);

    a.setVisible(true);

    a.setLocation(100,50);

    }

    }

    // vehicle-Dio

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class dio extends JFrame implements ActionListener

    {

    JButton b1;

    JLabel l1;

    Container c;

    dio()

    {

    c=getContentPane();

    setTitle("HONDA DIO");

    Color c2=new Color(171,123,223);

    c.setBackground(c2);

    b1=new JButton("BACK");

    b1.setForeground(Color.black);

    b1.setBounds(750,300,120,80);

    Color c1=new Color(255,185,255);

    b1.setBackground(c1);

    63

  • 8/14/2019 Aminta Report

    64/97

    b1.addActionListener(this);

    c.add(b1);

    l1=new JLabel("",new ImageIcon("Dio.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent e)

    {

    if(e.getSource()==b1)

    {

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    dio d1=new dio();

    d1.setSize(700,650);

    d1.setVisible(true);

    d1.setLocation(100,50);

    }

    }//vehicle-Eterno

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class eterno extends JFrame implements ActionListener

    {

    JButton b1;

    JLabel l1;

    Container c;

    eterno()

    {

    64

  • 8/14/2019 Aminta Report

    65/97

    c=getContentPane();

    setTitle("HONDA ETERNO");

    Color c2=new Color(171,123,223);

    c.setBackground(c2);

    b1=new JButton("BACK");

    b1.setForeground(Color.black);

    b1.setBounds(750,300,120,80);

    Color c1=new Color(255,185,255);

    b1.setBackground(c1);

    b1.addActionListener(this);

    c.add(b1);

    l1=new JLabel("",new ImageIcon("Eterno.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent e)

    {

    if(e.getSource()==b1)

    {

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    eterno e=new eterno();

    e.setSize(700,650);

    e.setVisible(true);

    e.setLocation(100,50);

    }

    }

    //vehicle Shine

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    65

  • 8/14/2019 Aminta Report

    66/97

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class shine extends JFrame implements ActionListener

    {

    JButton b1;

    JLabel l1;

    Container c;

    shine()

    {

    c=getContentPane();

    setTitle("HONDA SHINE");

    Color c2=new Color(171,123,223);

    c.setBackground(c2);

    b1=new JButton("BACK");

    b1.setForeground(Color.black);

    b1.setBounds(750,300,120,80);

    Color c1=new Color(255,185,255);

    b1.setBackground(c1);

    b1.addActionListener(this);

    c.add(b1);

    l1=new JLabel("",new ImageIcon("shine.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent e)

    {

    if(e.getSource()==b1)

    {

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    66

  • 8/14/2019 Aminta Report

    67/97

    shine s2=new shine();

    s2.setSize(700,650);

    s2.setVisible(true);

    s2.setLocation(100,50);

    }

    }

    //vehicle-Stunner

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class stunner extends JFrame implements ActionListener

    {

    JButton b1;

    JLabel l1;

    Container c;

    stunner()

    {

    c=getContentPane();

    setTitle("HONDA STUNNER");

    Color c2=new Color(171,123,223);

    c.setBackground(c2);

    b1=new JButton("BACK");

    b1.setForeground(Color.black);

    b1.setBounds(750,300,120,80);

    Color c1=new Color(255,185,255);

    b1.setBackground(c1);

    b1.addActionListener(this);

    c.add(b1);

    l1=new JLabel("",new ImageIcon("Stunner.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent e)

    {

    67

  • 8/14/2019 Aminta Report

    68/97

    if(e.getSource()==b1)

    {

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    stunner s3=new stunner();

    s3.setSize(700,650);

    s3.setVisible(true);

    s3.setLocation(100,50);

    }

    }//vehicle-Unicorn

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class unicorn extends JFrame implements ActionListener

    {

    JButton b1;

    JLabel l1;

    Container c;

    unicorn()

    {

    c=getContentPane();

    setTitle("HONDA UNICORN");

    Color c2=new Color(171,123,223);

    c.setBackground(c2);

    b1=new JButton("BACK");

    b1.setForeground(Color.black);

    b1.setBounds(750,300,120,80);

    Color c1=new Color(255,185,255);

    b1.setBackground(c1);

    68

  • 8/14/2019 Aminta Report

    69/97

    b1.addActionListener(this);

    c.add(b1);

    l1=new JLabel("",new ImageIcon("Unicorn.jpg"),JLabel.CENTER);

    l1.setVerticalTextPosition(JLabel.BOTTOM);

    l1.setHorizontalTextPosition(JLabel.CENTER);

    c.add(l1);

    }

    public void actionPerformed(ActionEvent e)

    {

    if(e.getSource()==b1)

    {

    des d=new des();

    d.setSize(1375,950);

    d.setVisible(true);

    setVisible(false);

    }

    }

    public static void main(String args[])

    {

    unicorn u=new unicorn();

    u.setSize(700,650);

    u.setVisible(true);

    u.setLocation(100,50);

    }

    }//purchase details

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class purchase extends JFrame implements ActionListener

    {

    JButton b1,b2,b3,b4,b5,b6;

    JLabel l1,l2,l3,l4,l5,l6,l7;

    JTextField t1,t2,t3,t4,t5;

    Connection con;

    JComboBox cb1;

    69

  • 8/14/2019 Aminta Report

    70/97

    Statement st;

    ResultSet rs;

    int x=0;

    String s,s1,s2,s3,s4,s5;

    Container c;

    purchase()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    setTitle("PURCHASED VEHICLES");

    Color c1=new Color(128,220,255);

    c.setBackground(c1);

    l1=new JLabel("PURCHASED VEHICLES");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    l1.setForeground(Color.blue);

    l2=new JLabel("Date");

    l3=new JLabel("Vehicle");

    l4=new JLabel("Price per");

    l5=new JLabel("Increment value");

    l7=new JLabel("Number");

    l6=new JLabel("Total Exp");

    t1=new JTextField();

    t2=new JTextField();

    t3=new JTextField();

    t4=new JTextField();

    t5=new JTextField();

    b1=new JButton("New");

    b2=new JButton("Save");

    b3=new JButton("Back");

    b4=new JButton("Exit");

    70

  • 8/14/2019 Aminta Report

    71/97

    cb1=new JComboBox();

    c.add(l1);c.add(l2);c.add(l3);c.add(l4);c.add(l5);

    c.add(l6);c.add(t1); c.add(t2);c.add(t3);

    c.add(b1);c.add(b2);c.add(b3);c.add(l7);c.add(t4);

    c.add(t5);c.add(cb1);c.add(b4);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    l7.setBounds(100,150,150,25);

    l4.setBounds(100,200,150,25);

    l5.setBounds(100,250,150,25);

    l6.setBounds(100,300,150,25);

    t1.setBounds(250,50,150,25);

    cb1.setBounds(250,100,150,25);

    t2.setBounds(250,150,150,25);

    t3.setBounds(250,200,150,25);

    t4.setBounds(250,250,150,25);

    t5.setBounds(250,300,150,25);

    b1.setBounds(125,350,100,45);

    b2.setBounds(255,350,100,45);

    b3.setBounds(125,415,100,45);

    b4.setBounds(255,415,100,45);

    b1.addActionListener(this);

    b2.addActionListener(this);

    b3.addActionListener(this);

    b4.addActionListener(this);

    cb1.addActionListener(this);

    cb1.addItem("Honda Shine");

    cb1.addItem("Honda Stunner");

    cb1.addItem("Honda Unicorn");

    cb1.addItem("Honda Activa");

    cb1.addItem("Honda Eterno");

    cb1.addItem("Honda Dio");

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:sample");

    st=con.createStatement();

    71

  • 8/14/2019 Aminta Report

    72/97

    }

    catch(Exception e)

    {

    }

    }

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="New")

    {

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    }

    if(ae.getActionCommand()=="Save")

    {

    s=t1.getText();

    s1=(String)(cb1.getSelectedItem());

    s2=t2.getText();

    int b=Integer.parseInt(s2);

    s3=t3.getText();

    int c=Integer.parseInt(s3);

    s4=t4.getText();

    int d=Integer.parseInt(s4);

    s5=t5.getText();

    int h=Integer.parseInt(s5);

    String g="INSERT INTO tbl_PVehicle values('"+s+"','"+s1+"',"+b+","+c+","+d+","+h+")";

    JOptionPane.showMessageDialog(this,"Add the

    Record","Add",JOptionPane.INFORMATION_MESSAGE);

    st.executeUpdate(g);

    rs=st.executeQuery("select Stock from tbl_Vehicle where Itemname='"+s1+"'");

    if(rs.next())

    {

    x=rs.getInt(1);

    72

  • 8/14/2019 Aminta Report

    73/97

    }

    int y=x+b;

    String k="UPDATE tbl_Vehicle set Amount="+c+",Stock="+y+" where

    Itemname='"+s1+"'";

    st.executeUpdate (k);

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    }

    if(ae.getActionCommand()=="Back")

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    }

    catch(Exception a)

    {

    }

    }

    public static void main(String args[])

    {

    purchase p=new purchase();

    p.setSize(1375,950);

    p.setVisible(true);

    }

    }

    //sales details

    import java.awt.*;

    import java.awt.event.*;

    73

  • 8/14/2019 Aminta Report

    74/97

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class sale extends JFrame implements ActionListener

    {

    JButton b1,b2,b3,b4;

    JLabel l1,l2,l3,l4,l5,l6;

    JTextField t1,t2,t3,t4;

    JComboBox cb1;

    String s1,s2,s,s3,s4,s5;

    Connection con;

    Statement st;

    ResultSet rs;

    Container c;

    int x=0;

    sale()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    setTitle("SALED VEHICLES");

    Color c1=new Color(100,100,255);

    c.setBackground(c1);

    l1=new JLabel("SALED VEHICLES");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    l1.setBackground(Color.white);

    l1.setForeground(Color.red);

    l2=new JLabel("Date");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Vehicle");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    74

  • 8/14/2019 Aminta Report

    75/97

    l4=new JLabel("Number");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l5=new JLabel("Price per");

    l5.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l6=new JLabel("Total Gain");

    l6.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    t1=new JTextField();

    t2=new JTextField();

    t3=new JTextField();

    t4=new JTextField();

    b1=new JButton("New");

    b2=new JButton("Save");

    b3=new JButton("Exit");

    b4=new JButton("Back");

    cb1=new JComboBox();

    c.add(l1);c.add(l2);c.add(l3);c.add(l4);c.add(l5);

    c.add(t1);c.add(t2);c.add(t3);c.add(t4);c.add(cb1);

    c.add(b1);c.add(b2);c.add(b3);c.add(b4);c.add(l6);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    l4.setBounds(100,150,150,25);

    l5.setBounds(100,200,150,25);

    l6.setBounds(100,250,150,25);

    t1.setBounds(250,50,150,25);

    cb1.setBounds(250,100,150,25);

    t2.setBounds(250,150,150,25);

    t3.setBounds(250,200,150,25);

    t4.setBounds(250,250,150,25);

    b1.setBounds(125,300,100,45);

    b2.setBounds(255,300,100,45);

    b3.setBounds(125,375,100,45);

    b4.setBounds(255,375,100,45);

    cb1.addActionListener(this);

    b1.addActionListener(this);

    b2.addActionListener(this);

    b3.addActionListener(this);

    b4.addActionListener(this);

    75

  • 8/14/2019 Aminta Report

    76/97

    cb1.addItem("Honda Shine");

    cb1.addItem("Honda Stunner");

    cb1.addItem("Honda Unicorn");

    cb1.addItem("Honda Activa");

    cb1.addItem("Honda Eterno");

    cb1.addItem("Honda Dio");

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:sample");

    st=con.createStatement();

    }

    catch(Exception e)

    {

    }

    }

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="New")

    {

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    }

    if(ae.getActionCommand()=="Save")

    {

    s=t1.getText();

    s1=(String)(cb1.getSelectedItem());

    s2=t2.getText();

    int b=Integer.parseInt(s2);

    s3=t3.getText();

    int c=Integer.parseInt(s3);

    s4=t4.getText();

    int d=Integer.parseInt(s4);

    76

  • 8/14/2019 Aminta Report

    77/97

    String g="INSERT INTO tbl_SVehicle values('"+s+"','"+s1+"',"+b+","+c+","+d+")";

    JOptionPane.showMessageDialog(this,"Add the

    Record","Add",JOptionPane.INFORMATION_MESSAGE);

    st.executeUpdate(g);

    rs=st.executeQuery("select Stock from tbl_Vehicle where Itemname='"+s1+"'");

    if(rs.next())

    {

    x=rs.getInt(1);

    }

    int y=x-b;

    String k="UPDATE tbl_Vehicle set Amount="+c+",Stock="+y+" where

    Itemname='"+s1+"'";

    st.executeUpdate (k);

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    }

    if(ae.getActionCommand()=="Back")

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    }

    catch(Exception a)

    {

    }

    }

    public static void main(String args[])

    {

    sale s=new sale();

    77

  • 8/14/2019 Aminta Report

    78/97

    s.setSize(1375,950);

    s.setVisible(true);

    }

    }//save bill details

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class billadd extends JFrame implements ActionListener

    {

    JButton b1,b2,b3,b4,b5;

    JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11;

    JTextField t1,t2,t3,t4,t5,t6,t7,t8;

    JComboBox cb1,cb2;

    Connection con;

    String s,s1,s2,s3,s4,s5,s6,s7,s8,s9;

    Statement st;

    ResultSet rs;

    Container c;

    billadd()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    setTitle(" ADD BILL");

    Color c1=new Color(100,100,255);

    c.setBackground(c1);

    l1=new JLabel("HONDA BILLING CHART");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    78

  • 8/14/2019 Aminta Report

    79/97

    l1.setForeground(Color.red);

    l2=new JLabel("Date");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Bill No");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Order No");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l5=new JLabel("Name");

    l5.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l6=new JLabel("Sex");

    l6.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l7=new JLabel("Address");

    l7.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l8=new JLabel("Place");

    l8.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l9=new JLabel("vehicle");

    l9.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l10=new JLabel("Number");

    l10.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l11=new JLabel("Net Amt");

    l11.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    t1=new JTextField();

    t2=new JTextField();

    t3=new JTextField();

    t4=new JTextField();

    t5=new JTextField();

    t6=new JTextField();

    t7=new JTextField();

    t8=new JTextField();

    b1=new JButton("Save");

    b2=new JButton("Clear");

    b3=new JButton("Exit");

    b4=new JButton("Back");

    cb1=new JComboBox();

    cb2=new JComboBox();

    cb1.addItem("M");

    cb1.addItem("F");

    cb2.addItem("Honda Shine");

    79

  • 8/14/2019 Aminta Report

    80/97

    cb2.addItem("Honda Stunner");

    cb2.addItem("Honda Unicorn");

    cb2.addItem("Honda Activa");

    cb2.addItem("Honda Eterno");

    cb2.addItem("Honda Dio");

    c.add(l1);c.add(l2);c.add(l3);c.add(l4);c.add(l5);c.add(l6);

    c.add(l7); c.add(l8); c.add(l9); c.add(l10); c.add(t1);c.add(t2);

    c.add(t3);c.add(t4);c.add(t5);c.add(t6);c.add(t7);

    c.add(b1);c.add(b2);c.add(b3);c.add(b4);c.add(t8);c.add(cb1);c.add(cb2);c.add(l11);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    l4.setBounds(100,150,150,25);

    l5.setBounds(100,200,150,25);

    l6.setBounds(100,250,250,25);

    l7.setBounds(100,300,300,25);

    l8.setBounds(100,350,350,25);

    l9.setBounds(100,400,400,25);

    l10.setBounds(100,450,450,25);

    l11.setBounds(100,500,450,25);

    t1.setBounds(250,50,150,25);

    t2.setBounds(250,100,150,25);

    t3.setBounds(250,150,150,25);

    t4.setBounds(250,200,150,25);

    cb1.setBounds(250,250,150,25);

    t5.setBounds(250,300,150,25);

    t6.setBounds(250,350,150,25);

    cb2.setBounds(250,400,150,25);

    t7.setBounds(250,450,150,25);

    t8.setBounds(250,500,150,25);

    b1.setBounds(125,550,100,45);

    b2.setBounds(250,550,100,45);

    b3.setBounds(125,630,100,45);

    b4.setBounds(250,630,100,45);

    cb1.addActionListener(this);

    cb2.addActionListener(this);

    b1.addActionListener(this);

    b2.addActionListener(this);

    80

  • 8/14/2019 Aminta Report

    81/97

    b3.addActionListener(this);

    b4.addActionListener(this);

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:sample");

    st=con.createStatement();

    }

    catch(Exception e)

    {

    }

    }

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="Save")

    {

    s=t1.getText();

    s1=t2.getText();

    int b=Integer.parseInt(s1);

    s2=t3.getText();

    int c=Integer.parseInt(s2);

    s3=t4.getText();

    s4=(String)(cb1.getSelectedItem());

    s5=t5.getText();

    s6=t6.getText();

    s7=(String)(cb2.getSelectedItem());

    s8=t7.getText();

    int d=Integer.parseInt(s8);

    s9=t8.getText();

    int h=Integer.parseInt(s9);

    String g="INSERT INTO tbl_Billing values('"+s+"',"+b+","+c+")";

    st.executeUpdate(g);

    String g1="INSERT INTO tbl_cust values('"+s+"',"+c+",'"+s3+"','"+

    s4+"','"+s5+"','"+s6+"','"+s7+"',"+d+","+h+")";

    st.executeUpdate(g1);

    81

  • 8/14/2019 Aminta Report

    82/97

    JOptionPane.showMessageDialog(this,"Add the

    Record","ADD",JOptionPane.INFORMATION_MESSAGE);

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    t6.setText(" ");

    t7.setText(" ");

    t8.setText(" ");

    }

    if(ae.getActionCommand()=="Clear")

    {

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    t6.setText(" ");

    t7.setText(" ");

    t8.setText(" ");

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    if(ae.getActionCommand()=="Back")

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    }

    }

    catch(Exception e)

    {

    }

    82

  • 8/14/2019 Aminta Report

    83/97

    }

    public static void main(String args[])

    {

    billadd b=new billadd();

    b.setSize(1375,950);

    b.setVisible(true);

    }

    }

    //display bill

    import java.awt.*;

    import java.awt.event.*;

    import javax.swing.*;

    import java.util.*;

    import java.io.*;

    import java.sql.*;

    public class viewbill extends JFrame implements ActionListener

    {

    JButton b1,b2,b3,b4,b5;

    JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11;

    JTextField t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;

    Connection con;

    String s,s1,s2,s3,s4,s5,s6,s7,s8,s9;

    Statement st;

    ResultSet rs;

    Container c;

    viewbill()

    {

    addWindowListener(new WindowAdapter()

    {

    public void WindowClosing(WindowEvent we)

    {

    System.exit(0);

    }

    });

    c=getContentPane();

    c.setLayout(null);

    setTitle("VIEW BILL");

    Color c1=new Color(100,100,255);

    83

  • 8/14/2019 Aminta Report

    84/97

    c.setBackground(c1);

    l1=new JLabel("HONDA BILLING CHART");

    l1.setFont(new Font ("Monotype Corsiva",Font.ITALIC,22));

    l1.setBackground(Color.white);

    l1.setForeground(Color.red);

    l2=new JLabel("Date");

    l2.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l3=new JLabel("Bill No");

    l3.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l4=new JLabel("Order No*");

    l4.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l5=new JLabel("Name");

    l5.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l6=new JLabel("Sex");

    l6.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l7=new JLabel("Address");

    l7.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l8=new JLabel("Place");

    l8.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l9=new JLabel("vehicle");

    l9.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l10=new JLabel("Number");

    l10.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    l11=new JLabel("Net Amt");

    l11.setFont(new Font ("Bodoni MT",Font.BOLD,18));

    t1=new JTextField();

    t2=new JTextField();

    t3=new JTextField();

    t4=new JTextField();

    t5=new JTextField();

    t6=new JTextField();

    t7=new JTextField();

    t8=new JTextField();

    t9=new JTextField();

    t10=new JTextField();

    b1=new JButton("Clear");

    b2=new JButton("View");

    b3=new JButton("Exit");

    84

  • 8/14/2019 Aminta Report

    85/97

    b4=new JButton("Back");

    c.add(l1);c.add(l2);c.add(l3);c.add(l4);c.add(l5);c.add(l6); c.add(l7);

    c.add(l8); c.add(l9); c.add(l10); c.add(t1);c.add(t2);c.add(t3);

    c.add(t4);c.add(t5);c.add(t6);c.add(t7);c.add(l11);

    c.add(b1);c.add(b2);c.add(b3);c.add(b4);c.add(t8);c.add(t9);c.add(t10);

    l1.setBounds(200,15,350,25);

    l2.setBounds(100,50,150,25);

    l3.setBounds(100,100,150,25);

    l4.setBounds(100,150,150,25);

    l5.setBounds(100,200,150,25);

    l6.setBounds(100,250,250,25);

    l7.setBounds(100,300,300,25);

    l8.setBounds(100,350,350,25);

    l9.setBounds(100,400,400,25);

    l10.setBounds(100,450,450,25);

    l11.setBounds(100,500,450,25);

    t1.setBounds(250,50,150,25);

    t2.setBounds(250,100,150,25);

    t3.setBounds(250,150,150,25);

    t4.setBounds(250,200,150,25);

    t5.setBounds(250,250,150,25);

    t6.setBounds(250,300,150,25);

    t7.setBounds(250,350,150,25);

    t8.setBounds(250,400,150,25);

    t9.setBounds(250,450,150,25);

    t10.setBounds(250,500,150,25);

    b1.setBounds(125,550,100,45);

    b2.setBounds(250,550,100,45);

    b3.setBounds(125,630,100,45);

    b4.setBounds(250,630,100,45);

    b1.addActionListener(this);

    b2.addActionListener(this);

    b3.addActionListener(this);

    b4.addActionListener(this);

    try

    {

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con=DriverManager.getConnection("jdbc:odbc:testdsn");

    85

  • 8/14/2019 Aminta Report

    86/97

    st=con.createStatement();

    }

    catch(Exception e)

    {

    }

    }

    public void actionPerformed(ActionEvent ae)

    {

    try

    {

    if(ae.getActionCommand()=="Clear")

    {

    t1.setText(" ");

    t2.setText(" ");

    t3.setText(" ");

    t4.setText(" ");

    t5.setText(" ");

    t6.setText(" ");

    t7.setText(" ");

    t8.setText(" ");

    t9.setText(" ");

    t10.setText(" ");

    }

    if(ae.getActionCommand()=="View")

    {

    int a=Integer.parseInt(t3.getText());

    rs=st.executeQuery("select * from tbl_Billing where Orderno="+a);

    if(rs.next())

    {

    t1.setText(rs.getString(1));

    t2.setText(rs.getString(2));

    }

    else

    {

    JOptionPane.showMessageDialog(this,"RECORD NOT

    FOUND","VIEW",JOptionPane.INFORMATION_MESSAGE);

    }

    86

  • 8/14/2019 Aminta Report

    87/97

    rs=st.executeQuery("select * from tbl_cust where Orderno="+a);

    if(rs.next())

    {

    t4.setText(rs.getString(3));

    t5.setText(rs.getString(4));

    t6.setText(rs.getString(5));

    t7.setText(rs.getString(6));

    t8.setText(rs.getString(7));

    t9.setText(rs.getString(8));

    t10.setText(rs.getString(9));

    }

    else

    {

    JOptionPane.showMessageDialog(this,"RECORD NOT

    FOUND","VIEW",JOptionPane.INFORMATION_MESSAGE);

    }

    }

    if(ae.getActionCommand()=="Exit")

    {

    System.exit(0);

    }

    if(ae.getActionCommand()=="Back")

    {

    setVisible(false);

    menu1 m=new menu1();

    m.setVisible(true);

    m.setSize(1375,950);

    }

    }

    catch(Exception e)

    {

    }

    }

    public static void main(String args[])

    {

    viewbill b1=new viewbill();

    b1.setSize(1375,950);

    87

  • 8/14/2019 Aminta Report

    88/97

    b1.setVisible(true);

    }

    }

    OUTPUT FORMS

    88

  • 8/14/2019 Aminta Report

    89/97

    89

  • 8/14/2019 Aminta Report

    90/97

    90

  • 8/14/2019 Aminta Report

    91/97

    91

  • 8/14/2019 Aminta Report

    92/97

    92

  • 8/14/2019 Aminta Report

    93/97

    93

  • 8/14/2019 Aminta Report

    94/97

    94

  • 8/14/2019 Aminta Report

    95/97

    95

  • 8/14/2019 Aminta Report

    96/97

    CONCLUSION

    Time is money;Lost time never comes back.These sayings has got a great significance in the

    current world of masssive competition,which tries to attain the lighting speed for its survival .W e

    belive ,through this earnest attempt in preparing the soft ware Bike showroom management

    systemwill make the hard herculian task of managing the showroom activities more effectively

    and efficiently.

    96

  • 8/14/2019 Aminta Report

    97/97

    BIBLIOGRAPHY

    1. Java: The Complete Reference - Herbert Schildt.

    2. System Analysis and Design - Elias M Award.

    3. Element Of System Analysis - Marvin Core & John

    4. An Introduction to Database

    Management System - C.JDat