P. 1
System Analysis & Design

System Analysis & Design

|Views: 144|Likes:
Published by Manish Srivastava

More info:

Published by: Manish Srivastava on May 23, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





System Analysis & Design

IDENTIFICATION OF NEED:INTODUCTION:- Defining a problem clearly is a step stone to its solution .In case of information system ,before designing ,it is necessary to understand the system clearly system. .

and concisely as regard to the working of the system and

loopholes of the existing system so as improve the overall efficiency of the








organizations kept its records in flats files and whole system was handled manually .Different files were used to keep track of the different kind of information like sale ,purchase & billing etc .All processes are handled manually.

LIMITATION AND DEMERITS OF EXISTING SYSTEM:- The existing system lived of its life .In this ever changing environment everybody or everything has to change according ,to time or else they would be thrown away from the system .when everything ,in this world is computerizing, to make it more effective and easy to handle then why not existing system. The existing system is running, on the flat file therefore records are huge and difficult to handle .An enquiry about any information is received late. All the concerned file have to be opened to give the required information. The main problem in existing manual system can be summarized as below:


System Analysis & Design MANUAL SYSTEM:- The manual system of data entry & report generation was very slow and susceptible to human errors leading ,to loss of valid time & memory. NO CHECK ON VALIDATION:- The validation check was almost absent and that led to the presence of wrong data and there by there was lots of errors in selection. PROPOSED SYSTEM:- A computer base management system for monitoring of different activity like Sales ,Purchase, Stock , Billing in view of user requirement .The existing system which was manual and keeping the records in flat files was to be computerized .The proposed system can be divided into following parts: AUTHORIZATION MODULE:- This will check for authentic users. SALES MODULE:- This module will handle all the activities of SALES process. PURCHASE MODULE :- This module will handle PURCHASE. STOCK MODULE:- This will keep record of STOCK.

REPORT MODULE:- This will generate reports by taking information from different modules.

ADVANTAGES OF THE PROPOSED SYSTEM :- The advantages of proposed system can be summarized as below: (1) The new system will developed in RDBMS concept making it compatible with the user requirement. As a result there will be minimum redundancy


System Analysis & Design of data and large amount of data can be stored in the database without any storage problem. (2) The response time information retrieval will reduced to negligible and the processing time require for retrieving, the desired information from different table is less. (3) Reports can be generated quickly for effective decision making and up-todate instantly. REQUIREMENT ANALYSIS:This activity is of heart of system analysis. Requirement analysis relies on the fact finding techniques such as interview Questionnaires, record inspection and onsite observation. Requirement definition involves study of current system to find out how it works and what the areas that need improvement requirement definition is features that must be included in a system study .it may include a way of capturing data, processing data, controlling a business activity or supporting managements. Requirement analysis forms the core of the system analysis process using a variety of tools and skills the system and documents its features for further analysis requirement investigation relies very heavily on fact finding techniques. In the proposed system the techniques used were interviews, record inspection and observation interviewing techniques can be used to collect the information from individuals or from groups. The presence of experienced analyst in fact finding groups are a boon experience from previous studied can help in investigation of area that would otherwise go unnoticed by an in experienced analyst. Having the expertise background to know what question to ask or which aspect of problem to investigation the process of requirement analysis become fruitful. information are available and answers to queries are also provided



System Analysis & Design The purpose of the preliminary investigation is to evaluate project requests. It is not a design study nor does it include the collection of details to describe the business system in all respect. Rather it is the collecting of information that helps committee members to evaluate the merits of the project request and make an informed judgment about the feasibility of the proposed project. Analysts working in the preliminary investigation should accomplish the following activities: • • • • • Clarify and understand the project request. Determine the size of the project. Assess the cost and benefits of alternative approaches. Determine the technical and operational feasibility of alternative approaches. Report the findings to management, with recommendations outlining the acceptance or rejection of the project. The data that the analysts collect during preliminary investigations are gathered through three primary methods: reviewing organization documents, on-site observations, conducting interviews.

A) CONDUCTING INTERVIEWS:- Interviews techniques can be used to collect the information from the individual or group to find out the problem of existing system or to extract new ideas thoughts regarding ,the purposed system .during development of this system a number interview were conducted know about the company policies. B) REVIEWING ORGANIZATION DOCUMENTS:- Existing system procedure manual illustrate the format and function of various aspects of existing system.


Legal Feasibility 7. The process followed in making this determination is called feasibility study.System Analysis & Design C) ON SITE OBSERVATION:. Types of feasibility 1. Technical Feasibility 2. Time Feasibility Here we describe only few of these in detail: - 1. Social Feasibility 5. Economic Feasibility 4. TECHNICAL FEASIBILITY This is concerned with specifying equipment and software that will successfully satisfy the user requirement. Operational Feasibility 3. Technical needs of the system include:  Facility to produce outputs in a given time  Response time under certain conditions 7 . FEASIBILITY STUDY The concept of feasibility is to determine whether or not a project is worth doing. the system analyst can go ahead and prepare the project specification which finalizes project requirements. Once it has been determined that a project is feasible. Management Feasibility 6.This information gathering approach gets as close as possible to real system under study in the natural work environments vital information regarding the existing was gathered through this approach.

can they be trained in due course of time. even in villages. hence this project is technically feasible. The computers are easily available in almost all the places. Therefore the chances of resistance from the centre staff is 8 . What speeds of input and output should be achieved at particular quality of printing. The software needed to carry out this project includes Java as front end and Access as backend. This project is not developed just for fun. So the technology required to carry out the project is easily available and affordable. who understand the parts of business that are relevant to the project and are skilled in system analysis and design process. They are developed on demand of the organization for which the system is being developed. The hardware needed to carry out this project includes workstations with 512 MB of RAM and 80 GB HDD. This feasibility study is carried out by a small group of people who are familiar with information system techniques. configuration of the system is given more importance than the actual make of hardware. 2. OPERATIONAL FEASIBILITY This is mainly related to human organization and political aspects. The points to be considered are:  What changes will be brought with the system?  What organizational structures are disturbed?  What new skills will be required? Do the existing staff members have these skills? If not. Configuration should give the complete picture about the system’s requirements: how many workstations are required. how these units are interconnected so that they could operate and communicate smoothly. Due to all these reasons implementation of such system becomes not only feasible but reputed to the organization.System Analysis & Design  Ability to process a certain volume of transaction at a particular period  Facility to communicate data to distant location In examining technical feasibility.

The existing staff of the company can be trained to interact with the system. Any disturbance to the organization if occurs will be advantageous to the organization. the procedure is to determine the benefits and savings that are expected from a proposed system and compare them with costs. Software & Hardware Interfaces…….Ms-Access Operating System-Windows 95/98/NT/2000 Hardware Interface Processor --Memory --Hard disk -P3 64 MB RAM 10GB 9 . a decision is taken to design and implement the system.Java Back End. There is no need to recruit new staff to operate the system. based software and is easy to use. Hence the project is operationally feasible. The operators now will be able to service more customers and Staff members than before in the same time period. If benefits outweigh costs. which is a GUI. 3. More commonly known as cost-benefit analysis. Also the time required carrying out a transaction will be reduced to a large extent. ECONOMIC FEASIBILITY Economic analysis is the most frequently used technique for evaluating the effectiveness of a proposed system. Software Interface Front End.System Analysis & Design almost nil. which will make the staff and others happy and cheerful.

The document covers the detailed description of the different process . SCOPE OF SRS:. serve as baseline for validation and verification . External Interface Requirements:Software Interface Front End. serve as a baseline document for development team. serve as a basis for future enhancements.Ms-Access Operating System-Windows 95/98/NT/2000 Hardware Interface Processor – Any Pentium Class PC Memory . • • Proposed process model.in detail. document the business requirement clearly in a concise and easily understood manner to business/end user.Java Back End. Assumptions dependencies and constraints.64 MB RAM 10 .System Analysis & Design SOFTWARE REQIUREMENT SPECIFICATION PURPOSE OF SRS:The purpose of this document is to: • • • • • document the different business process of department .The details include: • Description of process.

In manual system it is hard and tedious to maintain the huge 11 . In manual system all work are done manually on paper. RECOMMENDATION AND CONCLUSION: The existing system cannot meet the department requirements. as the changes are major. Afterwards it is only a process of manipulation and consolidation to convert it to any form desired by the users.System Analysis & Design DETAILED LIFE CYCLE OF THE PROJECT: REALIZATION OF PROBLEM: The present day organization work can be classified in two forms. Lots of paper work is been done in order to enter new item’s records. The data which manual system has in common has to be provided separately to different departments resulting in lots of inter-departmental paper work and also simultaneous updating of records is almost impossible. Integrated systems essentially product data. Their design and development takes much longer than the corresponding activities for the manual systems but their longterm benefits more than compensate for the additional overheads. each element of which is stored at the point of generation thereby minimizing inter-departmental paper work. one is the manual system and other one is the integrated computerized system.

etc. the time involved in generating reports should be cut down drastically by making various phases of process quicker and correct. Answers to various queries should be provided quickly. Hence it was decided that a new system.System Analysis & Design records. There should be provision of locking the records in multi-user environment to avoid confusion and simultaneous updating of the same record. The system has the facility of system-generated codes and has a lot of validation checks to ensure the accuracy of data. 12 . customized for sale and purchase of products. 35 OVERVIEW OF THE SYSTEM: The software maintains all the product detail of company There is data entry screens. Most important of all is. It is very important to ensure that the data entered is correct and hence validations are to be incorporated. which record relevant and upto-date information. and queries in this system. modify existing records. should be developed. Entries are made in the databases. The problem is to maintain various databases. Maintenance of database includes operations like addition of new record groups.

Permission of different operations would be given to different persons depending on their roles. DETAILED DESCRIPTION OF THE PROBLEM: Retail Management System is a package of keeping details of the products & inventory etc. 13 . Facility for the updating of information should be there. All data entry screens should have the same look. The queries would be answered promptly and correctly so satisfy information requirements. it greatly reduces the work of maintaining the records. The system would facilitate the Answering of various queries. The system would have security features.System Analysis & Design PROPOSED METHODS/ STEPS TO SOLVE THE PROBLEM: The following approach was followed in development of the system: Proper data entry modules are developed which make it easier for the user to enter data and ensure the validity of data. The information would be maintained in an unambiguous and uniform way. The system would provide for re-indexing of Databases.

14 .System Analysis & Design Data validations are at the time of data entry. which minimizes the errors. processed and made available in various report formats. This data is stored in the system. The data integrity is maintained even at the database level so it is almost impossible to input data. which doesn't follow integrity rules. Data is entered through various screens available to the user.

a “how to” approach compared to analysis. The design phase focuses on the detailed implementation of the system recommended in the feasibility study.  LOGICAL DESIGN:. Frequencies etc.System Analysis & Design SYSTEM DESIGN System design phase is a transition from user oriented document (system proposal) to a document oriented to programmers or database personnel. Emphasis is on translating performance specifications into design specification. 15 . The design covers the following:• REVIEWS THE CURRENT PHYSICAL SYSTEM:This consists of specifying data flows.For a candidate system DFD describes inputs(source). outputs(destination). Including terminal specifications and locations. a “what is” orientation. • PREPARE THE OUTPUT SPECIFICATIONS:This process determines the format. This is the pivot point in system development life cycle. content and frequency of reports. The Logical system design mainly concentrates on the user needs on various level of detail that determines the information flow and the required data resources. The design is a solution. file content volumes. System design is carried out mainly in two phases-Logical and Physical design. database(data stores) and procedures(data flows) all in a format which meets the user requirements.

• SPECIFIES THE IMPLEMENTATION PLAN AND BENEFITS:This includes cost evaluation process. corrections. Design physical information flow through the system. This includes determining the flow of the documents from the input data source to The actual location. backup Procedures and the controls that ensures processing and file integrity.  PHYSICAL DESIGN:. performs the necessary calculations through the existing file or database. Physical design consists of the following:- ∗ Design the physical system:• • • Specifying input output media. • PREPARE EDIT. produces the report on hard copy or displays it on a screen. benefits from the system and system constraints. 16 . target dates. Design the database and specify backup procedures.This phase produces the working system by defining the design specifications that tell programmers exactly what the system must do. SECURITY AND CONTROL SPECIFICATIONS:This includes specifying the rules for edit . content and most of the functions are specified.System Analysis & Design • PREPARE INPUT SPECIFICATIONS:By this process the input format.

Devise a test and implementation plan and specify any new hardware and software. Anything that is not inside the process identified in the context diagram will not be the part of the system study. a new set of objectives has to be achieved and new procedures have to be selected and implemented. financial. courses and timetable. but it plays a very important role in studying the current system.Whenever an old system fails or do not work up to it’s specifications. costs. Data validation whenever necessary to ensure correctness of input data.) CONTEXT DIAGRAM:The top level diagram is often called a context analysis diagram. Data entry and on-line data editing through well laid out screen format.System Analysis & Design ∗ Plan system implementation:• • ∗ ∗ ∗ ∗ Prepare a conversion schedule and a target date. Data security should be taken care of. Determine training procedures. hardware etc. The following points were kept in mind while designing the new system: ∗ ∗ ∗ ∗ The system should be user friendly. Update benefits. conversion date and system constraints (legal. This gives just an overview of the proposed system. The context analysis diagram defines the environment of the system that will be studied in the sense that it determines the boundaries between the different modules. GRAPHICAL TOOLS:1. 17 . It consists a single process.)  OBJECTIVES OF THE DESIGN:.

System Analysis & Design ER-Diagram of RMS itemname itemcode Master stockinhand M purchasedate price 1 RMS 1 1 itemcod e M Made Bill_no 1 Tot_price Date itemcode Unit_price M itemname Unit_pric e Item_des c N_O_I_S C_Name e ad M e H av Sale Purchase 18 .

This is the graphical tool in hands of system analyst being a pictorial representation of fact regarding the flow of information or transformation .The system may be organization a manual procedure. a software system a mechanical 19 . A data flow diagram (DFD) shows the flow of data through a system .System Analysis & Design Total_price source hiredate qty GENERAL ANALYSIS DIAGRAM FOR STORE MANAGEMENT SALE PURCHASE User Identity DIALY REPORT STORE MANAGE MENT SYSTEM STOCK STOCK IN HAND Searching BILLING DATA FLOW DIAGRAM (DFD):.

data flow diagram do not indicates decision logic or condition under which various processing nodes in the diagrams might be activated. hardware system .A data flow diagrams shows the movements of data through the different process in the system .The graphical representation called bubble chart can be expanded to a hierarchy of diagrams giving more and more detail.unlike flow charts . A data flow diagram might represent data flow between individual statement or blocks of statement in routine . It provides an overview of major decomposition of the system . DFD FOR SECURITY PROCESS Login Get user Name & password Check user Authentic user Invalid User or password Message For invalid user 20 .System Analysis & Design system.or any combination of these .


Field Name Type ----------------------------------------------------.-------.-----------------------------------itemcode itemname quantity hiredate unit_price total_price source Number Text Number Date/Time Number Number Text STRUCTURE OF MASTER TABLE: DESCRIPTION: This table keeps all the details.-----------------------------------itemcode itemname purchasedate stockinhand NUMBER TEXT Date/Time NUMBER 22 .System Analysis & Design STRUCTURE OF PURCHASE TABLE:DESCRIPTION: This table keeps all the general information of the PURCHASE Field Name Type ----------------------------------------------------.-------.

Field Name Type ----------------------------------------------------.System Analysis & Design price NUMBER STRUCTURE OF JOB_SALE TABLE:DESCRIPTION: This table keeps all the information regarding SALES.-------.-----------------------------------itemcode ITEM_DESC no_of_item_sold date cust_name bill_no unit_price tot_price NUMBER TEXT NUMBER DATE TEXT NUMBER NUMBER NUMBER 23 .

System Analysis & Design SCREEN LAYOUTS & DESIGN 24 .

System Analysis & Design if username & password valid 25 .

System Analysis & Design Product Info Form 26 .

System Analysis & Design Purchase Master Form 27 .

System Analysis & Design Sale Master Form 28 .

System Analysis & Design Purchase Report 29 .

System Analysis & Design

Sale Report


System Analysis & Design

Purchase Report Order by Product code


System Analysis & Design

Product Report Order by Product date


System Analysis & Design

Sale Report Order by Bill No


System Analysis & Design Sale Report Order by Date 34 .

System Analysis & Design Help 35 .

System Analysis & Design SYSTEM TESTING & IMPLEMENTATION INTRODUCTION: System testing is a very much essential before actual implementation of the system. VOLUME TESTING: In this test. Some of the tests. In the system. then only the system objective is successfully achieved. a huge number of records were being tested and the test output shows that the system can holds an amount of data required by the firm. STRESS TESTI NG: The stress testing is to provide that the system does not malfunction under peak loads. which have been performed. RECOVERY TESTING: 36 . The user is asked to provide test data for volume testing. are given below. First test of the system is to see whether it produce correct output or not. All kinds of error and incompatibility must be removed before it is ready for user acceptance testing. If all parts of the system are correct. we create as many records as would normally be required to verify the proper functioning of the hardware and the Software. No other test can be more crucial than this.

Using the detail design description as a guide.System Analysis & Design A forced system failure is induced to test back-up recovery procedure for the integrating files. Inaccurate data are entered to see how the system response in term of error deduction and production. It also tests whether an unknown user can handle the system failure or not. important control paths are tested to uncover the error within the scope of the modules. INTEGRATION TESTING: Integration testing is technique for constructing the program structure while at the same time conducting the test error associated with it. the modules. The objective is to take unit-tested module and build a program structure that has been dictated by design. USABILITY DOCUMENTATION AND PROCEDURE: The usability test verifies the friendly nature of the system. related to files integrity. The user tested each data entering test data. In this phase the user enters series of test data and tests the entire software module. The crucial phase of the 37 . As there is some relation between module the user tests the software to see whether all the relation was satisfied or not. Few error and faults that were found at the time of data entry were removed. The relative complexity of the test and uncovered error is limited by the constraint scope establish scope establish for unit testing.e. The relative complexity of the test and uncover the error within the scope of the modules. UNIT TESTING: Unit testing focuses on verification effort on the smallest unit of software designed i.

TESTING OF INDIVIDUAL PROGRAMS: Each program completed during the programming development stage was tested at the time of coding. This involve creating computer compatible flies . and necessary changes were made to make sure that the program is working properly. For example the procedure development in the authorization module for testing authentic user is as follows which is fired as soon as the user enters his password in the Operating Screen of The Expense Information System.System Analysis & Design system life cycle is the successful implementation of the new system design into operation. 38 . training of the staff who will operate the system and installing before the system is set up for running.

Currently two modules PURCHASE & SALES has been tested and implemented. appraisals. In future this software can be updated to make it a complete client-server application. 39 . This helps in improving the overall performance of the organization. provides timely reports to the management to take effective decisions. scanner. In this project work I have tried to develop a new system which monitors all the STORE activities. Through the system has been tested with taking dummy data and built according to proposed structure. etc with addition of forms and code to make it a full-fledged information system monitoring all the activities of a STORE. promotion. The database files and their format can be more generalized to include other activities like training. In future the inputs will be given to the system by using barcode reader. it can be used by any type of organization. transfer.System Analysis & Design CONCLUSION & FUTURE SCOPE The efficiency and performed of any organization can be improved by streamlining the information and by quick decision making at all levels. internet etc.

r1. r3.b.30).150. setBackground(new Color(142.120)). Button b1 = new Button("Ok").30).100.190.setBounds(20. r2.black).setBackground(new Color(245.*.setBounds(20.175.false).setBounds(120. r2.16)).120. Checkbox r3 = new Checkbox("Sort By Product Code". public static void main(String args[]) { dialog11 f = new dialog11().false).b.setBounds(20.setFont(new Font("Times new Roman".setBounds(20.b. Checkbox r1 = new Checkbox("Sort By Date".1.160. b1.30).event. b2.120)). setLayout(null).setBounds(20.System Analysis & Design CODING import java. r3.true).black).false).16)). 40 . Checkbox r2 = new Checkbox("Sort By Bill No".b. } public dialog11() { super("Status Sales Report"). r2.90. r1. Checkbox r4 = new Checkbox("Sort By Product Name".1. r4.200.setForeground(Color. Button b2 = new Button("Cancel").300).30). b1.awt.setFont(new Font("Times new Roman".1.16)). CheckboxGroup b = new CheckboxGroup(). import java.150. r1.190.awt. r4.black).1.setFont(new Font("Times new Roman".setBackground(new Color(245.100.setForeground(Color.setForeground(Color.200. //setSize(400.setForeground(Color.251)).setFont(new Font("Times new Roman". public class dialog11 extends Frame { Container f1. r3.black).*.30.160. b2. r4.30).60.16)).30).

getState()) { OrderDate1_1 o = new OrderDate1_1(). hide(). b2. } else if(s=="Ok" && r2.1. pack(). show(). add(r2). if(s=="Ok" && r1. } else hide(). } else if(s=="Ok" && r4. } } class WindowEventHandler extends WindowAdapter 41 .20)). hide().System Analysis & Design b1.getActionCommand(). addWindowListener(new WindowEventHandler()). add(r3). hide(). add(b2). add(r1).setFont(new Font("Times new Roman".getState()) { OrderDate1_3 m1 = new OrderDate1_3().setFont(new Font("Times new Roman".getState()) { OrderDate1_2 d = new OrderDate1_2().getState()) { OrderDate1 o = new OrderDate1(). add(r4).1. } else if(s=="Ok" && r3. b2.addActionListener(new ButtonHandler()). hide(). b1.20)). add(b1). } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent ev) { String s=ev.addActionListener(new ButtonHandler()).

*. JButton bb3 = new JButton("Prev.*. Mast2 mm.util. import java.").s1. JButton bb1 = new JButton("First"). public class Mast2 extends JFrame { Container f. JTextField t6 = new JTextField(12).sql.*. JButton b3 = new JButton("Exit").tt[].i. JTextField t5 = new JTextField(12). Font fo = new Font("Courier New". import javax.System Analysis & Design { public void windowClosing(WindowEvent e) { hide().in[]. JLabel l3 = new JLabel("Prod Date :").*. String driver. } } } import java.awt. import javax. JLabel l1 = new JLabel("Prod Code :"). import java. JTextField t1 = new JTextField(10).17). JLabel l5 = new JLabel("Prod Price :"). Statement s.pr[]. Connection c.pd[].1. Dialog d. JLabel l4 = new JLabel("Stock in Hand :"). JTextField t2 = new JTextField(25).event. String ic[]. int x. JLabel l6 = new JLabel("Sale Price :").sh[].url.*. JButton bb2 = new JButton("Last"). JTextField t4 = new JTextField(10).awt. import java.swing. JLabel l2 = new JLabel("Prod Name :"). public static void main(String args[]) { 42 . Label l= new Label("Product Already Exists "). JButton bb4 = new JButton("Next").swing.event.*. JTextField t3 = new JTextField(50).

t5.setBackground(Color. l6.black).0)).black).setBackground(new Color(200.setBackground(new Color(200. bb4.white). } public Mast2() { super("Master").200)). 43 .black).black).0)). bb3.black).200)). t5. t2. l.setFont(fo).setFont(fo).black).black).setForeground(new Color(0.setBackground(new Color(200.setForeground(Color.setBackground(new Color(200.setFont(fo).white).setBackground(Color. l5.setBackground(new Color(200.setForeground(Color.black).91. l4.setFont(new Font("Times New Roman".200)).91. l5. t3. bb1.white). bb3.black). bb4.setForeground(Color.setForeground(new Color(0. bb2. l3.255.200)).setForeground(Color.black).odbc.0)).255.setBackground(Color. b3.setForeground(Color. l2. b3.setForeground(new Color(0. t1. l1.91. url="jdbc:odbc:lib".setFont(fo).setForeground(Color.setForeground(new Color(0.setForeground(Color. bb1.1.white). l3.setBackground(Color.setBackground(Color.jdbc.setForeground(Color. bb2.0)).white).setFont(fo). t2.26)).91.255.setForeground(new Color(0.setFont(fo).255.91. i=0. driver="sun. bb3. bb1. bb2.setFont(fo). t4. t1.0)).setBackground(Color. t6.System Analysis & Design Mast2 app = new Mast2().white). t4. l1. l2.setForeground(new Color(0.200)).setForeground(Color.black).setForeground(Color.setFont(fo).91.setFont(fo). l4. t3.setForeground(Color.0)).255. l6. t6.JdbcOdbcDriver".

setBounds(220.150. t3.setFont(fo).180.setBackground(new Color(255. l5.250.addActionListener(new ButtonHandler()).100. b3. l6. f=getContentPane(). t4.setBounds(60.setBounds(220.setFont(fo). bb2. t5.setBounds(60.50. l2. t3. bb3.setFont(fo).30). t6.30).170.80.200.setText("").170.30).170.150. f.setFont(fo).addActionListener(new ButtonHandler()). t6.setLayout(null).100. t2.setFont(fo).setBounds(220.300.setBounds(220. t4.setFont(fo).addActionListener(new ButtonHandler()). t1.setBounds(60.setBounds(60. bb4.setText("").50. l4.30). bb1.200.100. b3.setBounds(60.30).addActionListener(new ButtonHandler()).200.250. t4. t5. t1. f.170.setText("").setBounds(60.setText(""). t5.30).30).202)).setBounds(220. t1.setText(""). 44 . t3. }/*to validate that item code should be numeric*/ public void focusLost(FocusEvent e1) { } }).170.100.170.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent e) { setTitle("Master"). l1.setFont(fo).System Analysis & Design bb4.30). l3.setFont(fo). t1. t2.setText("").30).30).30).255.addActionListener(new ButtonHandler()). t2.

add(t3). f. f.setToolTipText("Click here ot view the Next Record"). f.30).30).add(bb1). f.30).forName(driver).290.setBounds(470.115.add(l4).add(b3).getConnection(url).add(bb4). f.380. f. f.add(l3). } /*checks whether item code already exists*/ boolean checkRec(String xx) { int x1=0. c=DriverManager. b3.add(t4).setToolTipText("Enter Price ").add(l1). t4. try { Class.add(t2). f.100.30).50. pack().300.setToolTipText("Click here to view the First Record").setToolTipText("Click here to cancel data"). t1.add(l6).setBounds(150.setBounds(470.115. bb2. f. bb1.setToolTipText("Click here to view the Prev Record").setToolTipText("Click here to view the Last Record"). bb3.setToolTipText("Enter Procurement Date(dd/mm/yyyy)").add(bb2).30).setBounds(470. bb4. f.setToolTipText("Enter Stock in Hand ").30). f.130. f. t5.add(l2).System Analysis & Design t6. b3.setToolTipText("Enter Product Code").add(t1). addWindowListener(new WindowEventHandler()).setBounds(470. f.120. rec().115. bb3.add(bb3).115. f. t3. f.210. t2.add(t5). bb2.setBounds(220. 45 . bb4. f.setToolTipText("Enter Product Name ").add(t6).add(l5).setToolTipText("Click here to the unload current form"). f. bb1. b3.

getString(3).equals(rs1.charAt(5).getString(1). in = new String[300].charAt(8). in[i]=rs. sh = new String[300].next()) { if(xx. arr[1]=ss. ic = new String[300].} if(x1==1) return(true).getString(2). while(rs.getResultSet().charAt(7). String ss = rs. s = c. 46 .getConnection(url).getResultSet(). c=DriverManager.println("--> "+e). tt = new String[300]. ResultSet rs1 = s1. s.out.execute("select * from master ORDER BY itemcode").executeQuery("select * from master where itemcode="+xx). ResultSet rs = s. arr[3]=ss.System Analysis & Design s1 = c. pr = new String[300]. if(rs1!=null) { while(rs1.createStatement(). s1.createStatement().forName(driver). arr[0]=ss. else return(false).next()) { ic[i]=rs. } } } catch(Exception e){System.getString(1))) x1=1.charAt(9). arr[2]=ss. pd = new String[300]. }/*stores the records in array*/ boolean rec() { try { Class. // for Date Column char arr[]=new char[10].

10). } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent ev) { String s=ev. } } catch(Exception e){} return(true).doubleValue().setText(""+f). sh[i]=rs.getString(5).valueOf(pr[a]).JOptionPane. t2. pd[i]=ss. t4.charAt(0). arr[6]=ss.YES_NO_OPTION). arr[7]=ss.equals("Next")) { x++. t3.charAt(2). x=i. arr[5]=ss. } if(s. pr[i]=rs.showConfirmDialog(Mast2.System Analysis & Design arr[4]=ss.setText(sh[a]). if(s=="Exit") { int x = JOptionPane.setText(in[a]).charAt(4). if(x>=i) 47 . }/*shows records in textfield & calculates the sale price*/ void showRec(int a) { t1. f=f+(f*." C o n f i r m a t i o n". arr[8]=ss.charAt(3).getActionCommand().getString(4).charAt(1). t6.setText(pr[a]). if(x==0) hide() ."A r e y o u s u r e y o u w a n t t o E x i t ! ". arr[9]=ss.charAt(6). double f = Double.WARNING_MESSAGE.setText(ic[a]).setText(pd[a]).this. i++. t5.JOptionPane. ss = new String(arr).

showMessageDialog(Mast2. .equals("First")) { x=0.showMessageDialog(Mast2.")) { x--. } } } class WindowEventHandler extends WindowAdapter { public void windowClosing(WindowEvent e) { hide(). } showRec(x).JOptionPane. showRec(x).equals("Last")) { x=i-1. showRec(x)."I t i s t h e F i r s t R e c o r d . ". JOptionPane."Data Validation".System Analysis & Design { x=i-1. . JOptionPane. ". } if(s."I t i s t h e L a s t R e c o r d .equals("Prev.this. if(x<=0) { x=0. .this. } if(s.WARNING_MESSAGE). } showRec(x). } if(s.JOptionPane."Data Validation". .WARNING_MESSAGE). } } } 48 .

awt.175.setFont(fo). Button b2 = new Button("P u r c h a s e F o r m").awt. Button b4 = new Button("P u r c h a s e R e p o r t "). b3.1.setForeground(Color.120)).360.setForeground(Color.blue).setBounds(200.setFont(fo).setForeground(Color.*. b3.i7. b4.*.setForeground(Color. Button b1 = new Button("M a s t e r F o r m").360.120)).50).251)).30). setBackground(new Color(142.160. b1. Menu m1. b3.120)).50). import java.setFont(fo). b2.setBounds(200. b5. setup(). b4.360.i6. b2. import java.290.i8.setBounds(200.i9.360.setBackground(new Color(245.setBackground(new Color(245.blue).160.setForeground(Color. b5.50). public class MenuApp extends Frame implements ActionListener { MenuBar mb.120)).160. Button b3 = new Button("S a l e F o r m").160.120)).430. setLayout(null). b2. b5.*.m2. b4. b2.setBackground(new Color(245.System Analysis & Design import java.i3.applet.50). public MenuApp() { super("Retail Management System").i5. add(b1).i10.setFont(fo). Toolkit toolkit.setBackground(new Color(245.blue). b1. Font fo = new Font("Courier New". MenuItem i1.blue).50). 49 . b5.220.setBounds(200.360.360. Button b5 = new Button("S a l e R e p o r t "). Image im. b1. b3.setFont(fo). b1.150.setBounds(200.i4.m3.i2.event. b4.setBackground(new Color(245.blue).160.

50 .add(i4). i3 = new MenuItem("Sale").addActionListener(this).add(i1).addActionListener(this). i8. m1.addActionListener(this). m3. i4 = new MenuItem("Exit"). i3.add(i7).addActionListener(this). i2 = new MenuItem("Procurement").addActionListener(this). m2.addActionListener(this).addActionListener(this).add(i2). } void setup() { mb = new MenuBar(). b2.addActionListener(this).System Analysis & Design add(b2). i4. m2. b1.addActionListener(this).addActionListener(this). } }). m3 = new Menu("Help"). b5. m1. b4. add(b5).addActionListener(this).addActionListener(this). add(b3). i10 = new MenuItem("Purchase Report"). m1 = new Menu("File"). i2.add(i3). m1. i7 = new MenuItem("Sales Report"). m1. addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { setVisible(false). i1. add(b4). m2 = new Menu("Reports"). i1 = new MenuItem("Master"). b3. i7. i10.add(i8).add(i10). i8 = new MenuItem("About").

200).580). } if(o==i7 || o==b5) { dialog11 mm= new dialog11().add(m1). } public void actionPerformed(ActionEvent e) { Object o = e.150. } if(o==i4) { setVisible(false). 51 . m. } if(o==i3 || o==b3) { Sale s= new Sale().setSize(780. p.300.580). s. } if(o==i10 || o==b4) { dialog12 mm1= new dialog12().getImage("disney2.add(m2). mm1.show(). mb. mm.show(). s.300.200). if(o==i1 || o==b1 ) { Mast2 m= new Mast2().150.show().setSize(780. p. } if(o==i2 || o==b2) { Purc p= new Purc().setSize(780. im = toolkit.jpg"). m.getSource(). mb.setBounds(200. setMenuBar(mb).add(m3).580).System Analysis & Design mb. } if(o==i8) { Help m4= new Help().setBounds(200. toolkit = getToolkit().

System Analysis & Design } } public static void main(String aa[]) { MenuApp a = new MenuApp(). } } 52 .

b1 = new Button("No").setBackground(new Color(0.setBounds(5.true). x=1. setResizable(false).120. b1.85.setBounds(260. } public void actionPerformed(ActionEvent e) { Object o = e.180. setBackground(Color.*. b.black).40). int x. l= new Label(" X !.String str. b1.23)). b = new Button("Yes").setBounds(105.event.0.85. b.setFont(f). add(b).108)).String label) { super(ff.30.200).455.awt.b1.20).setFont(f). l.1. import java. 53 .str.54.setForeground(Color. setVisible(true). add(l). setLayout(null).System Analysis & Design import java.addActionListener(this).64)). b1. add(b1). if(o==b) { setVisible(false).54. Label l. b. Font f.getSource().1.black).465. l.70).40).setBackground(Color. b.setForeground(Color.108)). f = new Font("Times new Roman". public MyDialog1(Frame ff.*. b1.addActionListener(this). l.gray). b1.awt. setBounds(150. "+label). l.setFont(new Font("Times New Roman".120.setForeground(new Color(0. class MyDialog1 extends Dialog implements ActionListener { Button b.setBackground(new Color(0.gray). b.

m1.*. add(s). Toolkit tool. import java. ScrollPane s. public class OdName extends Frame implements ActionListener { MenuBar mb. import java. s = new ScrollPane(ScrollPane. i2 = new MenuItem("Print"). setSize(640. } } public int retu() { return(x). Menu m1.sql.awt.450).add(t1).util. mb.add(m1). public OdName() { super("Report Order by Item Name").awt.event.*. MenuItem i1. s.System Analysis & Design } if(o==b1) { setVisible(false). PrintJob pj. TextPanel t1. i2. addWindowListener(new WindowAdapter() { 54 .add(i2). import java. i1 = new MenuItem("Exit"). tool=getToolkit().addActionListener(this). setVisible(true). x=0.i2.*. setMenuBar(mb).*.SCROLLBARS_ALWAYS). mb = new MenuBar(). m1.addActionListener(this). m1 = new Menu("File"). i1.add(i1). }import java. t1 = new TextPanel().

Class. ResultSet r=s. if(o==i2) { Properties prop = new Properties(). Connection c=DriverManager.url.getResultSet(). driver="sun.jdbc. } public void actionPerformed(ActionEvent e) { Object o = e.getSource().forName(driver).prop). } }). 800).printAll(pj. } public void paint (Graphics g) { int x=100.getConnection(url).odbc. url="jdbc:odbc:lib".System Analysis & Design public void windowClosing(WindowEvent e) { setVisible(false).getPrintJob(OdName. if(o==i1) setVisible(false).this. Statement s = c. } } class TextPanel extends Canvas { public Dimension getPreferredSize() { return new Dimension(800. pj = tool.executeQuery("select * from master order by itemname"). try { String driver.JdbcOdbcDriver".getGraphics()). 55 .end(). pj. s. } } } public static void main(String aa[]) { OdName p = new OdName().createStatement(). if(pj!=null) { t1."Hello".y=80.

getColumnName(i). g.25.setFont(new Font("Times new Roman".x.drawString("S.drawString("Retail Management System Report". g.30.x. a[0]=ss.getColumnCount(). x+=100.pink). } g.green).charAt(8).setColor(Color.blue). for(int i=1. xx++.1.40). ". y+=20.80).". g. setBackground(Color. g.y). g.20. a[6]=ss.charAt(4).red).No. g.charAt(1).charAt(3).34)). g.charAt(7).charAt(5).drawString(xx+" . while(r. ss = new String(a). g. int numColumns=rmeta.14)). a[3]=ss.setFont(new Font("Times new Roman".y).charAt(9).++i) { g. a[2]=ss. a[1]=ss.++i) { String ss=r.setColor(Color.i<=numColumns. if(i==3) { char a[]=new char[10].charAt(6).3. } } } 56 .y).getString(i).510. a[4]=ss.40.drawString(rmeta.System Analysis & Design ResultSetMetaData rmeta = r. a[8]=ss.next()) { x=100.drawString(ss. for(int i=1.charAt(0).getMetaData(). x+=100. a[5]=ss.30). a[9]=ss.i<=numColumns. } int xx=1.charAt(2). a[7]=ss.setColor(Color.drawLine(30. g.

TextPanel t1.addActionListener(this). s = new ScrollPane(ScrollPane. mb = new MenuBar(). Menu m1. MenuItem i1. s. } }). import java.i2.450).SCROLLBARS_ALWAYS).add(i1).} } } import java.println("--> "+e). setVisible(true). tool=getToolkit().sql.*. m1. } 57 .out. Toolkit tool.add(t1). public OdQuan() { super("Report Order by Quantity").*. addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { setVisible(false). public class OdQuan extends Frame implements ActionListener { MenuBar mb. setMenuBar(mb). m1 = new Menu("File"). i2. i2 = new MenuItem("Print"). ScrollPane s.util.awt. import java. i1. mb.awt.*.System Analysis & Design catch(Exception e){System. import java. m1. add(s).addActionListener(this). PrintJob pj. i1 = new MenuItem("Exit"). t1 = new TextPanel().add(m1). setSize(640.event.*.add(i2).

try { String driver.getConnection(url).green).y=80.getResultSet().drawString("Retail Management System Report". Statement s = c.3.getColumnCount().getGraphics()).40. ResultSetMetaData rmeta = r.drawLine(30. 800). g. url="jdbc:odbc:lib". if(o==i1) setVisible(false). g."Hello". g.end(). 58 . Connection c=DriverManager.getMetaData().createStatement(). if(pj!=null) { t1. pj = tool.setColor(Color.JdbcOdbcDriver".getSource(). int numColumns=rmeta.printAll(pj. ResultSet r=s.getPrintJob(OdQuan.this. if(o==i2) { Properties prop = new Properties(). } } } public static void main(String aa[]) { OdQuan p = new OdQuan().30.setFont(new Font("Times new Roman".510. driver="sun. s.34)). g.30).System Analysis & Design public void actionPerformed(ActionEvent e) { Object o = e.url. pj. } public void paint (Graphics g) { int x=100.prop).40).jdbc. } } class TextPanel extends Canvas { public Dimension getPreferredSize() { return new Dimension(800.forName(driver).execute("select * from master order by stockinhand"). Class.odbc.

drawString(ss.charAt(1).charAt(4).event.red).setColor(Color. } } } catch(Exception e){System.y). g.} } } import java. 59 .++i) { String ss=r.println("--> "+e).setFont(new Font("Times new Roman". setBackground(Color.No.i<=numColumns.*. ".i<=numColumns. a[2]=ss.++i) { g. a[1]=ss.awt. g.y).1.drawString(xx+" .charAt(3). ss = new String(a).charAt(7).x.charAt(8).out. x+=100. a[0]=ss. a[8]=ss. a[7]=ss. } int xx=1. y+=20.". g.System Analysis & Design g.getColumnName(i). x+=100.*.getString(i).25.charAt(2). a[5]=ss.x. a[3]=ss.next()) { x=100.14)).drawString(rmeta. a[9]=ss.sql.charAt(6).*. import java.pink). if(i==3) { char a[]=new char[10]. a[6]=ss. xx++.blue).awt.charAt(0).charAt(9). } g. import java.drawString("S. g.80). for(int i=1.20.y).charAt(5). for(int i=1. while(r. a[4]=ss.setColor(Color.

addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { setVisible(false). PrintJob pj. setMenuBar(mb). mb. } public void actionPerformed(ActionEvent e) { Object o = e.*. i2. m1.").getSource(). t1 = new TextPanel9(). public class PRepo4 extends Frame implements ActionListener { MenuBar mb.add(m1). m1 = new Menu("File").580). mb = new MenuBar().System Analysis & Design import java.SCROLLBARS_ALWAYS). s = new ScrollPane(ScrollPane. tool=getToolkit(). if(o==i2) { 60 .addActionListener(this). } }). m1. MenuItem i1. Menu m1. Toolkit tool. setSize(780.addActionListener(this). TextPanel9 t1. s. setVisible(true).add(t1). i1. i1 = new MenuItem("Exit").util.i2. ScrollPane s. i2 = new MenuItem("Print"). add(s). if(o==i1) setVisible(false).add(i2). public PRepo4() { super("Report Sorted by Item Desc.add(i1).

this. } } class TextPanel9 extends Canvas { public Dimension getPreferredSize() { return new Dimension(1000.pink). 61 . Connection c=DriverManager.itemcode. url="jdbc:odbc:lib".setColor(Color.30). int numColumns=rmeta. driver="sun.red).getGraphics()). g. pj.drawString("Procurement Status Report by Product Desc .drawLine(30. ResultSet r=s. g.setFont(new Font("Times new Roman". } public void paint(Graphics g) { int x=80.createStatement().red).execute("select itemname.".printAll(pj. g.40.getPrintJob(PRepo4. // setBackground(Color.System Analysis & Design Properties prop = new Properties(). Class. s.jdbc.1.30. 1000).getMetaData(). g.730.getColumnCount().getResultSet().setFont(new Font("Times new Roman". Statement s = c.1.total_price.hiredate from purchase order by itemname").14)). } } repaint().y=80.JdbcOdbcDriver". } public static void main(String aa[]) { PRepo4 p = new PRepo4(). g.forName(driver)."Hello".unit_price.odbc. pj = tool. g.34)).getConnection(url).end(). ResultSetMetaData rmeta = r.40).url. try { String driver.quantity.source.prop). if(pj!=null) { t1.setColor(Color.

else if(i==5)x+=85.black).charAt(2).charAt(4).y). g.next()) { x=90. a[1]=ss.y).i<=numColumns. g. y+=22.x.i<=numColumns.drawString(cap. a[2]=ss. if(i==1)x+=150. if(i==1) x=65. } int xx=1. ".print(ss).++i) { String cap=rmeta. else if(i==4)x+=105.charAt(3).80). a[0]=ss.getString(i).charAt(1).charAt(5). 62 . a[5]=ss. else if(i==3)x+=140.charAt(6).charAt(8). for(int i=1.drawString(ss.y).++i) { String ss=r. g.setColor(Color. ss = new String(a). a[3]=ss.25. else if(i==2)x+=70. xx++.charAt(9).charAt(0). while(r. a[8]=ss.". if(i==7) { char a[]=new char[10].System Analysis & Design g. else x+=100.drawString("S. a[9]=ss.getColumnName(i). a[6]=ss.drawString(xx+" .out. for(int i=1. a[7]=ss. if(i==1) x+=120.No.20. } // System.x.charAt(7). g. a[4]=ss.

} } catch(Exception e){System.println(). } //System.out.out.System Analysis & Design else if(i==6)x+=90.} } } 63 .println("--> "+e). else if(i==7)x+=70. else x+=110.

*.10).swing.setFont(fo). Date:"). l2.*. JLabel l1 = new JLabel("Prod Code :").sql. JButton b1 = new JButton("Submit").setBackground(new Color(208. b2. b3.swing.setFont(fo). JButton b2 = new JButton("Cancel").event. public static void main(String args[]) { Purc app = new Purc().*.event. l7.255)).*. Font fo = new Font("Courier New".setBackground (new Color(208.*. } public Purc() { super("Procurement").setBackground(new Color(208. l1.255)). JTextField t1 = new JTextField("0". JLabel l7 = new JLabel("Source :"). JLabel l4 = new JLabel("Proc. JTextField t5 = new JTextField(20). l3. import java. JLabel l2 = new JLabel("Prod Name :"). b2.255)).awt. b1.208. JTextField t2 = new JTextField(20). l5.208. public class Purc extends JFrame { Container f.setFont(fo).1. import javax. import java. l4. JTextField t4 = new JTextField(20). JLabel l5 = new JLabel("Unit Price:"). import java. JLabel l6 = new JLabel("Tot Price :").awt.System Analysis & Design import java.setFont(fo).208.*. b1. JLabel l3 = new JLabel("Quantity :"). l6. import javax.setFont(fo). JTextField t7 = new JTextField(20). 64 .util.setFont(fo). JTextField t3 = new JTextField(20).setFont(fo). JTextField t6 = new JTextField(20).17). JButton b3 = new JButton("Exit").setFont(fo).setFont(fo).

magenta).215.150. t5.setBounds(60.setForeground(Color. t4.getText()).setForeground(Color. t3.160. t3.setForeground(Color. l3.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent e) { String ss = t1.magenta).magenta). t4.setFont(fo).setForeground(Color.setForeground(Color. f. t2.setLayout(null). t1.250.System Analysis & Design b3. } }).30).setFont(fo).30).doubleValue().160. b2. l4.setBounds(60.getText()).doubleValue(). f. t6.30).setBounds(60.magenta). b3. 65 .setFont(fo).30).setText(""+(x*y)).200. t6.setBackground(new Color(255. b1.50. t7. checkRec(ss).setBounds(60. t5.magenta).addActionListener(new ButtonHandler()).30).valueOf(t5.setFont(fo).magenta).addActionListener(new ButtonHandler()). t1. t1.valueOf(t3.160. f=getContentPane().300. l6.setFont(fo).setFont(fo).100. t2. double y = Double.magenta).addActionListener(new ButtonHandler()). t6. l5.160.setBounds(60.setFont(fo).160.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent e) { double x = Double.255)).160.getText(). l1. t5.30). } }).setForeground(Color.setBounds(60. l2.setFont(fo). t7.setForeground(Color.

add(l3).30).300.setBounds(50. f. f.30). t5.setBounds(190.30). f. f.105. f.160.setToolTipText("Enter Quantity ").add(l7). f. f. t6.420.100. b1. t2.setBounds(210. t5. t7.30).add(l1). b3.add(t4).30). t3.120. t3. t1.add(l2).200. } void accessDB() { try { 66 .add(l6).add(l5).add(t2).add(t7). b2.200. t2.setToolTipText("Click here to cancel data"). b3.add(t1).add(t3).30).setToolTipText("Click here to unload the current form").add(t6).30). pack().System Analysis & Design l7.140. f.180.100.setBounds(60. t4.add(b2).setToolTipText("Click here to submit data").setBounds(210.30).add(b1). f. b1. f. t1.add(l4).70.50. f.100. f.setBounds(210.90. t6.setToolTipText("Enter Unit Price ").setEditable(false).setToolTipText("Enter Proc Date(dd/mm/yyyy)"). t4. f.add(b3).350.setToolTipText("Enter Product Name").420.setBounds(210.100. f.setBounds(210. f.30).420.150.add(t5). b3.350. f.setToolTipText("Enter source ").30).setEditable(true).setToolTipText("Enter Product Code").250.setBounds(210.setBounds(310. t7.setBounds(210. addWindowListener(new WindowEventHandler()). f. t7.30).

s1. Class. } catch(Exception ex) { System. boolean ss = s1. String sql. url="jdbc:odbc:lib".System Analysis & Design String driver. boolean hasResults = s.println("sanaman"+ex).'"+t7. Statement s.getText()+"')".'"+t3.createStatement().createStatement().'"+t2.url.getConnection(url).execute("select * from master where itemcode = "+t1.url.execute("INSERT INTO master VALUES("+t1.getText().'"+t2.close().execute(sql).getText()). url="jdbc:odbc:lib".createStatement(). sql+=".getText()+"'.executeUpdate("update master set stockinhand=stockinhand+"+t3."+t3."+t5.forName(driver).purchasedate='"+t4.jdbc.JdbcOdbcDriver".out.'"+t4. } } connection.getText()+".createStatement(). sql+="'.getText()+" where itemcode = "+t1."+t6. driver="sun. if(ss==true) { int i= s2. sql+=".JdbcOdbcDriver".getText()+".price="+t5.getText()+"'.odbc. s1= connection.odbc.getText()).'"+t4. driver="sun. } } boolean checkRec(String xx) { int x1=0."+t5.getText() +".s2. sql = "INSERT INTO purchase VALUES ("+t1. s2= connection.getText() +"'".getText()+"'. if(i==0) { s3. s3= connection.getText()+")"). try { String driver. s= connection. 67 .s3. Connection connection=DriverManager.getText()+".getText() +"'.getText().getText()+".jdbc.

68 . t1. if(s=="Submit") { String ss = t1. t2. boolean flag = checkRec(ss). Statement s3. } } } } catch(Exception e){System.getConnection(url).getString(2)).next()) { if(xx. if(rs1!=null) { while(rs1.println("--> "+e).YES_NO_OPTION).System Analysis & Design Class.JOptionPane. } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent ev) { String s=ev. if(x==0) { accessDB().WARNING_MESSAGE.JOptionPane.getResultSet().} if(x1==1) return(true).setText(""). s3 = c1. else return(false). t4. ResultSet rs1 = s3." C o n f i r m a t i o n".getString(1))) { x1=1. Already Exists.forName(driver)."Prod.createStatement(). t3. s3.execute("select * from master where itemcode="+xx).setText(rs1.getText().this.setText("").out.".setText("")..setText("").Want to Cont.getActionCommand(). Connection c1=DriverManager. t2.equals(rs1.. if(flag) { int x = JOptionPane.showConfirmDialog(Purc.

t2. } } if(s=="Exit") { int x = JOptionPane.setText(" ").setText(""). t6. t5.setText(""). t2. t4.setText("").setText("").setText(" ").setText("").setText("").setText("").this."A r e y o u s u r e y o u w a n t t o E x i t ! ". t7.setText("").setText(""). t4.setText(""). t7.setText(" "). t3. t6.setText(" ").setText(" "). t3. t4. t1.setText("").setText(""). t3.JOptionPane." C o n f i r m a t i o n".setText("").setText(" ").JOptionPane. if(x==0) hide() .setText(" ").setText(""). t5.YES_NO_OPTION). 69 . t6. } } else { accessDB(). } else if(x==1) { t1. t5.showConfirmDialog(Purc. t7.setText(""). t6.setText("").WARNING_MESSAGE. t2. t7.System Analysis & Design t5. } if(s=="Cancel") { t1.setText("").

import javax. import java.rr8[].17). JLabel l4 = new JLabel("Date :").swing.sql.rr6[]. import javax.event.*.System Analysis & Design } } } class WindowEventHandler extends WindowAdapter { public void windowClosing(WindowEvent e) { hide().rr2[]. JLabel l2 = new JLabel("Prod Name :"). JLabel l1 = new JLabel("Prod Code :"). boolean flag1 = false. JTextField t2 = new JTextField(20). Container f.1.awt. import java. JTextField t3 = new JTextField(20). String rr1[]. public class Sale extends JFrame { int index. Font fo = new Font("Courier New". JTextField t7 = new JTextField(20).url.awt.*. Statement s. boolean flag = false.s1.*.util. JLabel l3 = new JLabel("No of item:").rr4[]. String driver.*. JTextField t5 = new JTextField(20).*.rr5[]. JTextField t8 = new JTextField(20). String data[].*.event.rr7[]. Connection c. JTextField t4 = new JTextField(20).x.swing. } } } import java. 70 . JTextField t6 = new JTextField(20). int i.rr3[]. JList t1. import java.

t8. JLabel l8 = new JLabel("Tot Price :"). JButton bb4 = new JButton("Next"). bb4.setFont(fo). 71 . t2. l5.setFont(fo). l2.setFont(fo).setFont(fo). t4. l3.setFont(fo).setFont(fo). JButton bb2 = new JButton("Last"). l8.setFont(fo). l6. x=0.setFont(fo).setFont(fo).").setFont(fo).setFont(fo). JButton b1 = new JButton("Submit"). t6.setFont(fo). JLabel l6 = new JLabel("Bill no :"). b1.System Analysis & Design JLabel l5 = new JLabel("Cust name :"). t3.setFont(fo).setFont(fo).setFont(fo). t5. bb1. bb3. l7. b3.setFont(fo). l4.setFont(fo). JLabel l7 = new JLabel("Unit Price:"). bb2.setFont(fo). b2. JButton bb3 = new JButton("Prev. JButton bb1 = new JButton("First"). public static void main(String args[]) { Sale app = new Sale().setFont(fo). l1. JButton b2 = new JButton("Cancel"). } public Sale() { super("Sale"). JButton b3 = new JButton("Exit").setFont(fo).setFont(fo).setFont(fo). i=0. t7.

171)).setForeground(new Color(0. checkRec4(ss).48.setForeground(new Color(0. bb3. t5.setForeground(new Color(0.setForeground(new Color(0.171)). t1=new JList(data).96)).48.setBackground(new Color(215.addActionListener(new ButtonHandler()).setForeground(new Color(0.setBackground(new Color(215.setBackground(new Color(215. b3.171)). bb2. t8. rec().black). t1. t1. t4. b3.setForeground(Color.48.171)). b1. bb1.setBackground(new Color(215.171)).254. b1.addActionListener(new ButtonHandler()).addActionListener(new ButtonHandler()).setBackground(new Color(215.setForeground(new Color(0. t3.addFocusListener(new FocusAdapter() {/*for quantity sold*/ public void focusLost(FocusEvent e1) { 72 . t7. t1 = new JList(data). t2.setForeground(new Color(0.System Analysis & Design b1. } }).96)).48. bb3.96)).black).254. t6.setFont(fo).setForeground(Color.addActionListener(new ButtonHandler()). bb2.254.254. t1.setBackground(new Color(215.96)).254.addActionListener(new ButtonHandler()).addActionListener(new ButtonHandler()). b2.48. bb4. bb1. b3.96)).96)). bb4.171)).254. b2.setForeground(new Color(0.black).96)). checkRec3().getSelectedValue().48.addActionListener(new ButtonHandler()). b2. t2.254.48.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent e) { String ss=(String)t1.48.setBackground(new Color(215.setForeground(Color.96)).171)).

setBounds(100.30).160.30). f.setBounds(235.. String y1 = t2. sc.300.300.30).setBounds(235.setBounds(100.200. l6.showMessageDialog(Sale.setBounds(235.255)).30).setBounds(100.100.setBounds(100.50. checkRec2(ss).200. l1. b1.. t3. } } }).200.80.30).println(ss).30).350. // System. 73 .150.setBounds(50. l7. t4.out.setBounds(100.."Data Validation".setBounds(235.30).460.this.350.setBounds(235.".25).WARNING_MESSAGE).setBackground(new Color(217. t5.30).400.460.120.30). t2.getSelectedValue().setBounds(100.30).i<y1.140. t8.100.200.236."Please Enter Only 0 to 9 Number .setBounds(235. JScrollPane sc=new JScrollPane(t1).250. } if(cc==1) { JOptionPane.160. for(int i=0.30).100. t7.30).setLayout(null). b2.30).160.400. f. l8.setBounds(170. f=getContentPane().160.System Analysis & Design int cc=0.150.160.setBounds(235. l5.setBounds(235.charAt(i).160.30).setBounds( l3.i++) { int c = (int)y1.250. l4.100.JOptionPane. l2.160.length().100.30). } else { String ss=(String)t1. if(c<48 || c>=57) cc=1. t6.

bb3. f. f.460.setBounds(530.add(l8).add(b1).35). f.setToolTipText("Product Name"). t5.120. b3. f.add(l2).setToolTipText("Enter Product sold"). 74 .setToolTipText("Product Code").add(t6).setToolTipText("Enter Date").30).setToolTipText("Bill no"). f. bb3. t6. bb1.add(t3). f. bb2.260.add(l5). f.add(l4). f.setEditable(false).add(l1).add(bb4).120.add(bb3).add(t4).setEditable(false). bb1.setToolTipText("Click here to unload the current form").330. t2. f. t8.setToolTipText("Click here to submit data").100. f. bb4.setBounds(530.setBounds(530.setToolTipText("Total price"). t1. f. f. b1. f.add(t2).add(bb2).120.setToolTipText("Unit price").setToolTipText("Enter Customer name").setToolTipText("Click here to cancel data").add(b2). f. f.add(l3). f.35).add(l6).120. t3. f. bb2.add(bb1). f.add(t8).190.35).add(b3). f.add(t7). f.setToolTipText("Click here to view the First Record").setToolTipText("Click here to view the Prev Record").add(sc).add(t5).setToolTipText("Click here to view the Last Record").35).120. f. f.System Analysis & Design b3.add(l7). t5.setBounds(290. t4. b3. t7.setBounds(530. t8. f.

int i= s.execute(sql). rec().odbc. url="jdbc:odbc:lib". c.getText()+" where itemcode = "+ (String)t1."+t5.executeUpdate("update master set stockinhand=stockinhand-"+t2.getSelectedValue() +".'"+t8. setSize(800.jdbc. driver="sun.url. } catch(Exception ex) { } } //to put itemcode in the listbox void checkRec3() { try { String driver.createStatement().600).jdbc.forName(driver). addWindowListener(new WindowEventHandler()).JdbcOdbcDriver".forName(driver). s=c.JdbcOdbcDriver".execute("select itemcode from master"). t5.createStatement(). pack(). String sql.setText(""+index). 75 .getText()+")"."+t7.getConnection(url). ResultSet r = s1.url. s1.odbc.System Analysis & Design bb4.getText() +"'.getSelectedValue()). show().getResultSet(). s1 = c. c=DriverManager."+"'"+t3."+t2. } void accessDB()/*to insert data into DB*/ { try { String driver.getText()+". sql = "INSERT INTO sale VALUES ("+(String)t1.'"+t4.getText()+"'."+t6. driver="sun. url="jdbc:odbc:lib". Class.close().getText()+". Class. boolean hasResults = s.setToolTipText("Click here to view the Next Record").getText()+".getText()+"'.getConnection(url). c=DriverManager.

10+ff. t3.getString(5)). data = new String[200].out. if(rs!=null) { while(rs. t6.next()) { if(rs.} java.out.equals(xx)) { double ff = Double.floatValue().Date date = new java.out. } } catch(Exception e){System.getText()). oo++.forName(driver). s1 = c.getString(1).valueOf(rs.getMetaData().getMonth()+1)+"/2008").setText(""+ff). while(r.} }/*for getting tot price & sale price*/ void checkRec2(String xx) { try { Class. } } } } catch(Exception e){System. t7.next()) { data[oo]=r.getDate()+"/"+(date.println("--> "+e). ff=ff*.setText(""+tot*ff).doubleValue(). ResultSet rs = s1.getConnection(url).getResultSet().util. s1.println("--> "+e).Date().getString(1). } t1=new JList(data). // System.println(data[oo]). t1. float tot = Float.System Analysis & Design if(r!=null) { ResultSetMetaData rmeta = r.setText(date. c=DriverManager.createStatement().valueOf(t2.setVisibleRowCount(2). int oo=0.util.getColumnCount(). 76 . int counts=rmeta.execute("select * from master").

Class. c=DriverManager.util.next()) { int sc=Integer. driver="sun. s1 = c. if(sc<=10) { x=1. t3.url. ResultSet rs = s1. try { Class.getText())) 77 .setText(rs. if(rs!=null) { while(rs. s1.getString(1)).jdbc.createStatement(). } if(sc<=Integer. } } } catch(Exception e){System. s1 = c.odbc.createStatement().getResultSet().getConnection(url). s1.getString(1)).getMonth()+1)+"/2008").out.parseInt(t2.next()) { t8. String driver.util.} }/*for putting limitations on sold quantity*/ boolean checkRec1(String xx) { int x=0.JdbcOdbcDriver". if(rs!=null) { while(rs.setText(date. url="jdbc:odbc:lib".execute("select stockinhand from master where itemcode="+xx).System Analysis & Design }/*for getting item namr*/ void checkRec4(String xx) { try { java.forName(driver).parseInt(rs. ResultSet rs = s1.getDate()+"/"+(date.println("--> "+e).forName(driver).Date date = new java.Date(). c=DriverManager.getConnection(url).getResultSet().execute("select Itemname from master where itemcode="+xx).

else return(false). rr2[i]=rs. char arr[]=new char[10]. s = c. rr4 = new String[300].getString(3).jdbc. rr3 = new String[300]. url="jdbc:odbc:lib".getString(2). try { driver="sun. Class.next()) { index++.forName(driver).getConnection(url). 78 . c=DriverManager. rr1[i]=rs.println("--> "+e). index=1. x=0. rr6 = new String[300]. rr7 = new String[300]. rr3[i]=rs. arr[0]=ss.getString(1).JdbcOdbcDriver". rr8 = new String[300]. rr2 = new String[300].getResultSet().charAt(8). while(rs. s. rr5 = new String[300]. } } } catch(Exception e){System. // for Date Column String ss = rs.*/ boolean rec() { i=0. }/*to put records in array & getting the bill no. rr1 = new String[300].} if(x==1) return(true). ResultSet rs = s. arr[1]=ss.System Analysis & Design flag1=true.odbc.charAt(9).createStatement(). else flag1=false.out.getString(4).execute("select * from sale ORDER BY bill_No").

ss = new String(arr). t8.charAt(0). rr7[i]=rs.getString(6). } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent ev) { String s=ev. rr6[i]=rs.charAt(6).out.setText(rr4[a]).charAt(5). arr[5]='/'. } } catch(Exception e){System.setText(rr3[a]).getString(8).charAt(1). t6. arr[4]=ss.setText(rr5[a]).setText(rr8[a]). if(fla1) { 79 .getString(5).getSelectedValue(). boolean fla1 = checkRec1(ss). if(s=="Submit") { String ss = (String)t1. i++. t5. arr[7]=ss.setText(rr6[a]).charAt(2). t3. rr5[i]=rs.setText(""+index). x=i.println(" --> "+e). arr[9]=ss.charAt(3).getActionCommand(). return(true). }/*to show records in the textfields*/ void showRec(int a) { t1.setText(rr7[a]). arr[8]=ss. rr4[i]=ss.getString(7). t2.System Analysis & Design arr[2]='/'.setSelectedValue(rr1[a]. rr8[i]=rs. arr[6]=ss.true). t4. t7. arr[3]=ss.} t5.setText(rr2[a]).

equals("Next")) { x++.setText(""). t7.showConfirmDialog(Sale.setText(""). } if(flag1) { MyDialog d = new MyDialog(Sale."Data Validation".setText("").WARNING_MESSAGE. t5.setVisible(false). rec().setVisible(false). if(x==0) hide() .JOptionPane.this. 80 . } if(s.setText("")."A r e y o u s u r e y o u w a n t t o E x i t ! ". t3."). t7. t2. t5.setText(""). t6.this.setText(""). t6.JOptionPane. } else { accessDB().setText(""+index).this.."Cannot Sell as Instock<Items to be Sold." C o n f i r m a t i o n". t4.YES_NO_OPTION). } } if(s=="Exit") { int x = JOptionPane..setText(""). d.setText(""). } if(s=="Cancel") { t2."Data Validation".setText(""). t3.. t4. t8.System Analysis & Design MyDialog d = new MyDialog(Sale.setText("").setText(""). t8.setText("").setText(""). d."Cannot Sell as Instock<10 units").

.equals("Prev. import java. } if(s."Data Validation".showMessageDialog(Sale.awt. JOptionPane. ."Data Validation".")) { x--. } } } import java. . showRec(x).System Analysis & Design if(x>=i) { x=i-1. } if(s.swing.JOptionPane.*.equals("Last")) { x=i-1.*.event.*.showMessageDialog(Sale.WARNING_MESSAGE). if(x<=0) { x=0. } showRec(x). ".equals("First")) { x=0."I t i s t h e L a s t R e c o r d .awt.this."I t i s t h e F i r s t R e c o r d .WARNING_MESSAGE). public class Welc extends Frame implements ActionListener { 81 . showRec(x).this. ". import javax. . } } } class WindowEventHandler extends WindowAdapter { public void windowClosing(WindowEvent e) { setVisible(true). } if(s.JOptionPane. } showRec(x). JOptionPane.

192)). b2. t2. Label l1.l3. Prachi Saraswat and Abhishek Jagga").white). l2.setForeground(Color.setBackground(new Color(192. t2 = new TextField(20).setFont(f).").pink). l5.addActionListener(this).black).setForeground(Color. b1 = new Button("Enter").setFont(f). Font f.setBackground(new Color(192.setFont(f). //setBackground(Color.setForeground(Color.setFont(f). t1. b2.red).setForeground(Color.red). b1.setFont(f). l5.setForeground(Color.l4. Image im.setFont(f). t2. t1. 82 .l5.18).192)).setForeground(Color. t2.t2.setFont(f).black). t2. Welc() { super("WELCOME TO RETAIL MANAGEMENT SYSTEM"). l4=new Label("MCA IV Semester"). b1. l5=new Label("IMs.setForeground(Color.setForeground(Color. l1=new Label("Login ID "). l4. b1.black).black).setBackground(Color. l3. t1 = new TextField(20).black). setBackground(new Color(255. t1. b2.red). l1. f = new Font("Courier New". l1.l2.white).setFont(f).setFont(f). Ghaziabad").setEchoChar('*'). l2=new Label("Password. l3=new Label("Developed by : Juhi Parmar.192. l2.190. Button b1.System Analysis & Design Toolkit t.b2.setBackground(Color. TextField t1. b2 = new Button("Cancel").192.red).setForeground(Color. b1.1.125)). l3. l4.

l5. } }).30).getSource(). } else if(!ss. l2.330.30).800.setBounds(310.getText().100. .30).600).setBounds(270. add(t1).100.setBounds(350.330.30).270. if(o==b1) { String ss=t2.this.390." A c c e s s D e n i e d ".700. setSize(800.showMessageDialog(Welc.390.150. b1.450. add(l2). l4. .setBounds(390.exit(0). add(l3).System Analysis & Design b2. add(b2). add(l5). t = getToolkit(). addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.setBounds(220. l3. add(l1). } public void actionPerformed(ActionEvent e) { Object o = e. add(t2).getText(). im = t. if(!login.setBounds(50.jpg"). t2. C l i c k O K ".JOptionPane.80.addActionListener(this). setVisible(true). b2."I n v a l i d L o g i n .30).setBounds(220.30).30).400.getImage("visacard.equalsIgnoreCase("babu")) { 83 .270.100. add(l4).520.200.490.30).30). l1.setBounds(160. add(b1).equalsIgnoreCase("amit")) { JOptionPane. setLayout(null).setBounds(350. String login=t1.WARNING_MESSAGE). t1.

equalsIgnoreCase("babu"))&&(login." C o n f i r m a t i o n"."A r e y o u s u r e y o u w a n t t o E x i t ! ".570). System. } } else if(o==b2) { int x = JOptionPane.setSize(780.drawImage(im.this. { g. aa.WARNING_MESSAGE. } } } public void paint(Graphics g)// = getGraphics().180.100.showMessageDialog(Welc. . } 84 .this. .this). } if((ss.JOptionPane. hide(). if(x==0) { hide() .110."I n v a l i d P a s s w o r d .showConfirmDialog(Welc.WARNING_MESSAGE). C l i c k O K ".exit(0).setVisible(true).JOptionPane.System Analysis & Design JOptionPane.YES_NO_OPTION).JOptionPane.500." A c c e s s D e n i e d ". aa.equalsIgnoreCase("amit"))) { MenuApp aa = new MenuApp(). } public static void main(String aa[]) { Welc w = new Welc().

A Practitioner’s Approach Roger S. Software Engineering . System Analysis and Design Elias M. COMPLETE REFERENCE OF JAVA 9. 7. 8. 2. 3. Awad Galgotia Publications(p) Ltd.System Analysis & Design REFERENCES 1. Graw Hill Publications. 6. Orreilley Book of java 85 . 4. Introduction to Sql and pl-sql Ivan Bayross 5. Java BalaGru Swamy BPB Publications. DataBase System Concept Henry F. Korth Mc. An Integrated Approach to Software Engineering Pankaj Jalote (2nd edition) Narosa Publications. Pressman (fifth edition) McGraw-Hill International Editions. Fundamentals of Database System Elmasri / Navate Addison Wesley Publications.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->