Top Banner
Textiles Management System ACKNOWLEDGEMENT By the blessings and permission of almighty god, we were able to complete this work as a grant success. And we with extreme polite and sincere thanks to all respected persons co-operated with us especially, our sincere thanks to our respected directress Mrs. Kamakshi Balakrishna, for all the facilities extended to us during our project and fostering an academic climate. We profoundly pay our tributes and thanks to our principal Mrs. Joicy for her overwhelming and moral support extended towards us. We express our grateful thanks to Mrs. Manjusha (our respected guide) and Mrs. Nisha Sanjay, for providing a healthy environment within lab throughout this venture and for all other timely assistance, advice and constant encouragements and invaluable guidance, offered to us to make this project as a success. Finally, we thank to our parents for their boundless support and for making our lives so easy and for helping us to tackle all those difficulties in our life. Dept. of B.C.A. Chinmaya Vidyapeet
180
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: new

Textiles Management System

ACKNOWLEDGEMENT

By the blessings and permission of almighty god, we were able to complete this work as a grant success. And we with extreme polite and sincere thanks to all respected persons co-operated with us especially, our sincere thanks to our respected directress Mrs. Kamakshi Balakrishna, for all the facilities extended to us during our project and fostering an academic climate.

We profoundly pay our tributes and thanks to our principal Mrs. Joicy for her overwhelming and moral support extended towards us.

We express our grateful thanks to Mrs. Manjusha (our respected guide) and Mrs. Nisha Sanjay, for providing a healthy environment within lab throughout this venture and for all other timely assistance, advice and constant encouragements and invaluable guidance, offered to us to make this project as a success.

Finally, we thank to our parents for their boundless support and for making our lives so easy and for helping us to tackle all those difficulties in our life.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 2: new

Textiles Management System

TABLE OF CONTENTS

1. INTRODUCTION

2. PROJECT OVERVIEW

3. SYSTEM ANALYSIS

3.1 Existing System

3.2 Proposed System

3.3 Feasibility Study

3.3.1 Economical Feasibility

3.3.2 Technical Feasibility

3.3.3 Behavioral Feasibility

3.4 Tools and Platform

4. SYSTEM DESIGN

4.1Input Design

4.2Output Design

4.3Data Base Design

4.4Data Flow Diagram

5. CODING

6. SYSTEM TESTING

Dept. of B.C.A. Chinmaya Vidyapeet

Page 3: new

Textiles Management System

6.1 Unit Testing

6.2 Integration Testing

6.3 Validation Testing

6.4 Output Testing

6.5 User Acceptance Testing

6.6 Test Cases

7. IMPLEMENTATION

8. SCOPE OF THE PROJECT

9. FUTURE ENHANCEMENT

10. CONCLUSION

11. BIBLIOGRAPHY

Dept. of B.C.A. Chinmaya Vidyapeet

Page 4: new

Textiles Management System

INTRODUCTION

SYNOPSIS‘ Dew Drops’ is one of the major textile shops in India. TheyProvide

resources to all groups of people. Their main aim is customer satisfaction. All the operations in the company are computerized.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 5: new

Textiles Management System

‘Textiles management system’ is a client server architecture kind of application. It is pure, simple and small software made for users who can operate with slight knowledge of computer. The main objective is to handle daily activities such as selling goods if available, purchasing goods from manufactures, placing purchase order to various dealers, returning goods to vendors if any dissatisfaction with products purchased occurred and getting back products from customers if they are not satisfied with it etc..It is easy to handle the requirements by its user friendly interfaces and functionalities. The application uses Microsoft visual basic 6.0 as front end and Microsoft SQL server as back end.

The main advantages of new system are:

Calculation can be accurate & time needed for computation is less

We could find any record easily and quickly

We can avoid redundancy

Time delay for billing are reduced to a good extend

PROJECT OVERVIEW

The Textiles Management system is a database system that enables the processing of Dew Drop textiles in a user-friendly format that is easy to use and understand. The highlight of the project is that user can get in the information like

Dept. of B.C.A. Chinmaya Vidyapeet

Page 6: new

Textiles Management System

the availability of the materials, brand and category details of stocks, cost of various products etc…. All the operations and the activities related to the Textiles Management can be carried out efficiently.

The system shall maintain record of stocks. All transactions are managed from the system. This system provides only authorized users to access the data. The authorized user enters in the requirements of the customer with the help of the available information.

Modules used are:-

Purchase Module: This module allows the managing people to order purchase required items from specific vendors from specific vendors by entering the product details such as brand, category, quantity etc…It also allows them to record these details accordingly.

Sales Module: This module allows the customer to purchase the products according to their requirements and specification. It also contains an efficient billing system for the customer.

Purchase Return Module: This allows the managing people to return the purchased item to the vendor from whom the product was purchased due to dissatisfaction occurred.

Sales Return Module: This allows the customers to return the sold item due to dissatisfaction.

SYSTEM ANALYSIS

A system analysis is an orderly grouping of interactive, interdependent components linked according to a plan to achieve a specific objective. Each

Dept. of B.C.A. Chinmaya Vidyapeet

Page 7: new

Textiles Management System

component is a part of the system and has to do its share of work for the system to achieve its intended goal.

Analysis implies the process of breaking something down to its parts so that title whole may be understood. System analysis refers to an orderly structured process for identifying and solving problems. System analysis contrast on analyzing the present system and includes some investigation and concluding investigation. These steps constitute a logical framework for the system analysis phase and feasibility study and serve as basis for preparing an exploratory survey report to the top management.

The system analysis includes not only the process of analysis but also that of synthesis, which is the process of putting the parts together to form a new whole.

System analysis is the process of gathering and interpreting data and fact diagnosing problems to the system. In the development of software, structural analysis is required. During this analysis, information is collected in the form of answers to the question for collecting information from existing documents.

SYSTEM STUDY

The Fact finding and Information gathering for the proposed system is the key part of the system study is:-

Dept. of B.C.A. Chinmaya Vidyapeet

Page 8: new

Textiles Management System

Visiting the organization which is under the proposed computerization, various documents which helped a lot to get interacted with the Existing scenario, partially.

The system applying the tool helped a lot in getting acquainted what sort of Flexibility the end user is looking for, what are their expectations with an automated system.

The report of the existing system indicated the output needed by the user.

This was also used as the basis for user interviews to determine any new or modified requirements.

System study and analysis deals with the study of current system. This is the most critical process of information development. It can be defined as problem solving which consists of four phases that can be successfully completed by applying appropriate skill and carefully addressing each dimension of the information system.

The purpose of the preliminary study phase is to determine the initial feasibility of the project work. The product of this phase is a feasibility survey that is presented to a steering committee for a decision on whether the project should be developed.

After the feasibility analysis, the next phase is the study of the current system. The purposes of this phase are to learn how the current system operates. The analyst identifies the problems, limitations and the constraints and forms preliminary solutions finally. The analyst updates the feasibility estimates and presents the findings as a problem statement for formal study of phase reports.

The third phase of the system analysis is to define end- User requirements for a new system. The purpose of this phase is to identify what the new and improved information system must be able to do the product of this phase is the requirement statement.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 9: new

Textiles Management System

The fourth phase is to select a feasible solution from alternatives that are evaluated in terms of operational, technical and economic feasibility. The analyst will recommend the best solution to the Management for approval .A cost benefit analysis determines, the expected system development lifetime, costs for a new system and the benefits of the new system.

REQUIREMENT ANALYSIS

Our Textile management software deals with the issues like providing security to the data of the customer, being accurate in its operations by computerizing the textile management section. This also minimizes the duplication of the entries made by the administrator. It also reduces the

Dept. of B.C.A. Chinmaya Vidyapeet

Page 10: new

Textiles Management System

search time .This helps in relaxing the load to the employees. The software provides a user friendly interface which can be operated by anyone with a minimum knowledge of a computer system. It stores the information needed by the textile in a database which can be accessed by any employee within the organization.

The process of establishing the services the system should provide and the constraints under which it must operate is called requirements engineering. System requirements should set out what the system should do rather than how it is done. A requirements definition is a statement, in a natural language plus diagrams, of what services the system is expected to provide and the constraints under which it must operate. It is generated using customer-supplied information. A requirements specification is a structured document, which sets out the system services in detail. This document, also called a functional specification, should be precise. It may serve as a contract between the system buyer and the software developer.

The requirements engineering process should normally involve writing a requirements definition and then expanding this into a requirements specification. The requirements definition is targeted at a managerial level

REQUIREMENT SPECIFICATION

The requirements definition is developed into the requirements Specifications as detailed below:

Facility for the administrator control. Each user has unique identification. User name and password are given by the administrator.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 11: new

Textiles Management System

A separate page will be held for each item. Different facility for different users.

EXISTING SCENARIO

In any organization like Dew Drop it is essential to keep interests of all the customers entrusting them. It has to ensure the sufficient stock of the essential commodities the common men always require. It has to check the balancing of prices of commodities in the open market with that of their own so as to ensure the public get commodities at a justified price with a moderate profit for the organization.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 12: new

Textiles Management System

For the efficient functioning of the Dew Drop have been ensure an effective management system. Secondly the organization has to identify locations where the outlet of Dew Drop is essential. Finally the commodities demanded by the public at large should be identified and the sufficient stock of these items should be ensured without fail. The commodities demanded less should shift to other units. For this purpose an effective stock managing system is necessary. Up keeping of the stock register in a properly manner will serve this purpose.

As such the existing scenario creates a lot of problems as larger calculations come up and also in time response is also very low.

LIMITATIONS OF EXISTING SCENARIO

Human labour and time requirements are high – The organization has to

maintain large number of item records. This makes the record keeping system much complex and expensive and therefore processes take a lot of time.

Tedious paper file maintenances – The information are at presently

recorded in papers and stored likewise. So it takes a lot of space to store

Dept. of B.C.A. Chinmaya Vidyapeet

Page 13: new

Textiles Management System

small information when a particular document is searched for or when some updating is required the whole affair become cumbersome and tedious. Also files of paper document leads to dusty file cabinets.

Inaccuracy and Inefficiency – All the manipulations are done manually and

hence the probability of making mistakes is high. Searching manually for a particular record requires that the files to be arranged in a proper way. But this happens seldom in existing system.

Online search not possible – When a customer details. their requirement

details, price details etc are required, it is not that easy to search it out.

INITIAL INVESTIGATION

The Initial Investigation is carried out to determine whether the user’s request is valid and feasible .It is conducted to identify the real problems occurring in the Existing system. During this stage, the real problems if any are extracted by pieces and then make together the information gathered various methods.

Data collection. Correspondence and Questionnaires. Personal Interviews.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 14: new

Textiles Management System

Observations. Research.

Each process of data carries was thoroughly explained and information’s were made clear by personal interviews. The keen observations of the working Environments also help to identify the various activities taking place in the organization.

SALIENT FEATURES OF PROPOSED SYSTEM

Owing to the number of drawbacks evident in the existing system An Automated system is proposed. The proposed system facilitates very simple and comfortable data manipulation and data access to the user. It aims to remove most of the drawbacks found in the existing system. It can be thought of as maintenance, friendly, faster development, annually maintenance cost and cost of upgrading and absorption of the new technologies. This software can be easily installed.

This project deals with Dew Drop mainly focusing on the stock of essential commodities and their storing processes. Therefore this project has been designed to emphasis the details including updating, deleting, adding of

Dept. of B.C.A. Chinmaya Vidyapeet

Page 15: new

Textiles Management System

new information about the stock items and customer requirements. The project generates various reports like stock details in consumarate with public demand, customer details etc which contain the information focusing on the mostly required commodities. This forms the most important and direct source of information to the management. The main objective of the project is to overcome the existing scenario and thereby able to control the activities related to the control of the prices supply of the essential commodities to the public in a well –organized manner.

This applications software uses VISUAL BASIC 6.0 as the front-end and Microsoft SQL Server 2005 as the back-end.

Faster compared to the existing system. Automated Activity. Time saving Timely and accurate information can be obtained. Various reports. Whole information can be backed up easily. Comparatively less error. Reduce operation cost and Human Labor. Ease of Installation. Security User Friendly.

FEASIBILITY STUDY

Feasibility of designing the system is determined by evaluating alternative methods of converting available input data into required outputs to fulfill the system objectives. The most essential task performed by a feasibility analysis is:

The identification & description of delivery system. Evaluation of the delivery system. Selection of best candidate system.

FEASIBILITY CONSIDERATIONS:-

Dept. of B.C.A. Chinmaya Vidyapeet

Page 16: new

Textiles Management System

Economical Feasibility:

This is the most frequently used method for evaluating the effectiveness of the management system, more commonly known as cost or benefits analysis. The procedure is to determine the benefits and savings that are expected from the system and compare them with cost. It benefits outweigh cost, and then the decision is made to design and implement the system. To implement the system the only requirement was an SQL Server to support the database. In our project we are using VB as the front end which is compatible with other Microsoft based products like word, excel, power point etc…and so is easy to understand and work on .Being a old software it’s available with all the organizations and most of the users are comfortable with it.

Technical Feasibility:

Technical feasibility refers about the quality of the system and how much the system can be extended. The proposed system consumes less disk space. Has data security, and is very fast, accurate and Flexible.

The proposed system must also support the existing system. These features make this management system technical feasible.The new system was technically feasible as anyone who knows the basics of system operations could handle it. The user needs a basic knowledge of database management and visual basic if in case of any manipulation. While considering the technical factors of the organization that it presently haves, it is sufficient to implement the system.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 17: new

Textiles Management System

Behavioral Feasibility:

People in general are resistant to change and computers have been known to facilitate change. So a general study should care out to know the reactions of the user staff towards the development of a new system. The hierarchy of new system is very easier than existing system. It is easy to train users and very much user friendly. Operational cost is bearable. The maintenance and modification of new system need less human effort.

There is no resistance from the users to the proposed system. The proposed system provides better service to users as well as

management. The proposed system reduces the workload.

The new system is user friendly and is designed to adapt any new changes made related to it. A Person who has a basic knowledge of system designing can upgrade the system. The system is highly reliable and even if any modification or additions of some other features are required in future it can be met with minimal effort.

ABOUT SOFTWARE

Visual Basic is the software for developing the project. Visual Basic is the most popular programming language for the world’s most popular operating system, i.e. MS Windows, by encapsulating the complexities of the windows application interface into easily manipulated objects. VB is the first language that people consider when they want rapid application development for Window environment.

The ability of custom controls to easily extend the language has made VB a popular choice in an amazingly wide variety of programming tasks. However the easy accessibility of the language and the enormous breadth pose challenges to the VB instructor.

VISUAL BASIC 6.0

Dept. of B.C.A. Chinmaya Vidyapeet

Page 18: new

Textiles Management System

Microsoft in 1991, before introducing VB designing the way introduced VB &Look of the application was a battle. VB makes the party easy, so you can focus your program do something useful with a good look and feel. By using VB not only the user can write programs faster, but it also takes less effort to create them.

VB is used for creating application that works in Windows and Windows 2000 operating system with a Microsoft look and feel. VB provides common products that are found in other windows programs. If you are using VB, the first step is design the user interface looks, the final step involves writing basic program Commands. In VB, the programs are written using the same syntax of basic languages based on user actions include clicking on controls, moving mouse on controls, drag drop etc.

Every VB application has 3 distinct stages. Design stage, Break stage and Run stage. In design stage, the user can edit the design window and the program that works based on user actions. In break stage, the application execution terminates temporarily because of any errors in the program. In this stage the user can edit the program but user interface cannot be edited. In run stage, the application is running so neither the user can edit the user interface or program.

VB is primarily a visual design environment. We are creating a VB application by designing the forms that make up the user their interface, adding codes to the forms and the object such as buttons and textboxes on them and adding any required support code in additional modules. creating the form, adding controls to the forms and writing code being the form are all managed within friendly environment.

Graphic User Interface (GUI).VB provides graphic environment which we can usually provides VB 6.0 is a nearest addition of family of VB products. It is quickest and easiest way to create powerful applications for MS windows operating system. Design the forms and controls become the building blocks of applications, VB supports useful tools that will help us to more productive. Version 6.0 of VB specially designed to utilize the internet. There are many

Dept. of B.C.A. Chinmaya Vidyapeet

Page 19: new

Textiles Management System

features that make VB a robust and existing development platform. The following key points make VB as an excellent development.

1) VB application is event driven.2) Event driven means that the user is in control of the application.3) The user generates a steam of events each time he or she clicks with the

mouse or presses a key on the keyboard.4) VB application responds to those events through the code you have

written and attached to events.5) VB supports the principle of object oriented design. This means that we

can compartmentalize different aspects of our application as object and develop the test those objects independently of the application.

USER INTERFACE OBJECTS

Controls: Frame provides visual and function containers for controls. The basic component of user interface of VB applications is the forms. A form is a window that contains several different objects. All the objects in the form are controls. Command button is explicit simple response from the user or invoke special function on forms. Text boxes are usually used for accepting user inputs. A label box is similar to text in that box display text. Picture box displays bitmaps. Option button are used to display multiple choices of which the user can select only one. Checks are placed on form, they can be turned on and off in which a user can choose from. Combo box contains a text box with list box. Allows the user to type in selection or selection in valid disk drives. Directory list box display and allow the user to select from a list of files. Timer control is used when we want something to happen periodically. MS Flex grid

Dept. of B.C.A. Chinmaya Vidyapeet

Page 20: new

Textiles Management System

control in VB is used to create application that present information in rows and columns information is displayed in cells.

Data report: Data report utility introduced for the first time in VB 6.0 is used to design reports. The file can be dragged from data environment designer to the data report designer. The data report utility includes 6 controls via label, object lines, image, shape and functions. Data report can be bound to any data source but it works more naturally in the data environment.

Program entities and Projects: A Project is a collection of files used to build an application. It can hold various forms and controls attached to it; a project file has an extension .Vbp .

Event Procedures: A coding in VB written in procedures and subroutines. The procedure attaches to a form or controls are event oriented that is a control can have different code connected to different events of the control or the form.

Functions: Functions are codes that are independent and they will return a value to the calling procedure. Arguments can be passed to functions.

Modules: Modulus has BAS file name extension. Each form and control has code attached to its specified events. This has only local code. We can create data type variables one code that is available to the program in module.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 21: new

Textiles Management System

TOOLS AND ENVIRONMENT USED

1) Front -end tools used:

The Microsoft Visual Studio development system

The Visual Basic development system 6.0

ActiveX Data Objects (ADO) 2.1

2) Back -ends used:

Microsoft SQL Server 2005

ABOUT VISUAL BASIC:

Visual Basic is very popular friend tool to many Client/Server database system like SQL/Server, Oracle etc. Visual Basic is very powerful language to

Dept. of B.C.A. Chinmaya Vidyapeet

Page 22: new

Textiles Management System

develop Windows programs quickly. It is one of the reasons why it is popular. Using Visual Basic, applications can be created within minimum possible time.

ABOUT MICROSCOFT SQL SERVER:

SQL is a database manipulation language, pure and simple. It is a rich language-it has a number of commands for managing the database structure itself, powerful function for many data types, and other useful features.....but as it is the most basic level, SQL is widely used non procedural language and is simply about 3 things:-

Adding Data. Finding Data. Changing Data.

Operating System:

Microsoft Windows is the most popular operating system marketed by Microsoft Corporation, USA. It is very user friendly. Windows has graphics based multi tasking windowing environment that allows programs based multi tasking windowing environment that allows programs written specially for Windows to have consistence appearance and command structure. This capability makes even new programs easier to master.

Windows provide several built-in routines that allow easy implementation of pull-down menus, scrollbars, and dialog box icons and many other features of a user friendly graphical interface.

FEATURES OF SQL

Microsoft SQL Server 2005 is comprehensive, integrated data management and analysis software that enables organizations to reliability manage mission-critical information and confidently run today’s increasibility complex business applications.SQL Server 2005 allows companies to gain greater insight from their business information and achieve faster result for a competitive advantage:-

Dept. of B.C.A. Chinmaya Vidyapeet

Page 23: new

Textiles Management System

SQL Server is the fastest growing database and business intelligence vendor.

SQL Server ships more units than oracle and IBM combined. SQL Server is the #10LAP Server on the market. SQL Server is more secure than oracle. SQL Server is a benchmark leader, with the best price/performance for

TPC-H1TB&3TB (non-clustered) as well as best performance for TPC-H1TB.

Microsoft SQL Server and Unisys are the first to publish TPC-E benchmark results.

Gartner 2006 World Wide RDBMS market share reports highest growth rate in market share for Microsoft SQL Server. With 28%growth in market share, growth is almost twice the nearest competitor at 14.8% growth.

SQL Server still number one in database.74.7% of enterprises are using SQL Server, while 54.5% are using oracle database.

SQL Server manages the world’s largest databases.

INTRODUCTION TO DBMS

Database is a collection of related information about a certain topic. Database helps to action in logical manner for any access and retrievals. Computer databases can store data in different format, for simple lines to complete data structures that include pictures, sounds etc.

Data Management involves creating, modifying, deleting and adding data in files and using this data to generate reports and the software that allow performing these functions are known as Database Management system. Thus DBMS is a collection of data and programs that help to retrieve data and perform operation on it. The information stored in a database is contained in form of one or more tables. A table stores in a row and column format. These rows of information are called records.

The main characteristics of DBMS are:-

It represents a complex relationship between data.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 24: new

Textiles Management System

Keeps a tight control of data redundancy. Ensures sharing of data across application. Centralized data dictionary for storage of information.

INTRODUCTION TO RDBMS

One of the drawbacks of DBMS is that it is not flexible with multiple users.

The main characteristics of RDBMS are:-

RDBMS uses simple row/column tables for data values. Parent-child relationship gets eliminated.

Rows of tables are referred to as tuples and columns referred to an attributes. Several tuples of equal length placed one below the other create a table.

Relational model of data management is based on set theory.

SOFTWARE & HARDWARE REQUIREMENTS

HARDWARE SPECIFICATION

Processor Pentium

Clock length 333MHz

CPU Pentium 200MHz onwardsRam

32MB RAM

Floppy 3 ¼”FDD

Monitor 14”SVGA COLOUR

Base memory 640K

Dept. of B.C.A. Chinmaya Vidyapeet

Page 25: new

Textiles Management System

Extended 153060K

Cache memory 256K

Hard-Disk space disk Hard Disk with 100MB min

Video display Adapter with VGA resolution

Operating environment Windows98/NT/2000/XP

32-Bit

SOFTWARE SPECIFICATION

Operating system Windows XP

Front End Microsoft Visual Basic 6.0

Back End Microsoft SQL server

Dept. of B.C.A. Chinmaya Vidyapeet

Page 26: new

Textiles Management System

DATA FLOW DIAGRAM

In the late 1970’s data flow diagram (DFD’s) were introduced and popularized for structured analysis and design.DFD show the flow of data from external entities into the system, should how the data moved from one process to another as well as its logical storage. It is a graphical representation of the flow of data through an information system. DFD’s can also be used for the visualization of data processing (structured design).A DFD provides no information about the timing or ordering of processes or about whether processes will operate in sequence or in parallel. It is therefore quite different from a flowchart. DFD’s were first used in the software engineering as a notation for studying systems design issues.DFD is a structured analysis tool for showing the movement of data through the different transformation or processor in the system.

The DFD may be used to represent a system or software at any level of abstraction. DFD’s are central to most structured system design. All DFD’s are graphical. It can be used to show the current physical activities and for the logical model of the system

DFD is the most commonly way of documenting the processing of the current and required system. It is pictorials way of showing the flow of data into around and out of the system.DFD is easily understandable by the users and are less prone to misinterpretations than the textual description. A

Dept. of B.C.A. Chinmaya Vidyapeet

Page 27: new

Textiles Management System

complete set of dataflow diagram provides a compact top down representation of a system.

DFD makes use of 4 symbols:-

A circle represents transformation where incoming data flows are changed into outgoing data flows.

A data flow is a route, which enables packets of data to travel from one point to another. Data may from a source to a processor and from data store or process. An arrow line depicts the flow, with arrowhead pointing in the direction of flow.

A data store is a repository of data that is to be stored for use

By a one or more process may be simple as buffer or queue or sophisticated as relational database. They should have clear names. If a process merely uses the content of store and does not alter it, the arrow head goes only from the store to the process. If a process alters the details in the store then a double headed arrow is used.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 28: new

Textiles Management System

A source or sink is a person or part of an organization that enters or receives information from the system. But is considered to be

outside the context of data flow model

Dept. of B.C.A. Chinmaya Vidyapeet

Page 29: new

Details

Customer

Bill

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 30: new

Administrator

Purchase order

P return

Bill

sales return

Change password

Add newuser

Supplier

Staff

Customer

1.1

1.2

1.3

1.4

1.5

1.6

purchase

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 31: new

Administrator

Add user

Change password

Check user

Login db

Login db

Change old password and confirm new passwordLogin db

False

User passswordcheck

Select username and pasword1.2

1.1

Not exist

exist

Username and password

True

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 32: new

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 33: new

Administrator

Select suppliersupplier db

Select item Item db

Check item if cur< minStock db

Purchase order

Order id

select

Supplier name

Item name

Curr_min

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 34: new

Textiles Management System

DESIGN PHASE

System design is a solution , “a how to” approach to the creation of a new system. It provides the understanding and procedural details necessary for implementing the system recommended in the analysis phase. Emphasis is on translating the performance requirements, into design specifications; design goes through logical and physical stages of development. Logical design reviews the present physical system, perhaps input and output specification, and makes edit security and logical design work through. The physical design maps out the details of the physical system implementation, devices a test and implementation plan, and specifies any new hardware and software.

The first step is to determine how the output is to be produced and in what format. Samples of the output and input are also presented. Secondly, input data and master files (database) have to be designed to meet the requirements of the proposed outputs. The operational (processing) phases are handled through program construction and testing, including a list of programs needed to meet the system’s objectives and complete documentation. Finally, details related to justification of the system and an estimate of the impact of the candidate system on the user and the organization are documented and evaluated by management as a step toward implementation.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 35: new

Textiles Management System

THE PROCESS OF DESIGN

The design phase focuses on the detailed implementation of the system recommended in the feasibility study. Emphasis is on translating performance specifications into design specifications. The design phase is a translation from a user – oriented document to a document oriented to the programmers or data base personnel.

After the user requirements are identified, related information is gathered to verify the problem and after evaluating the existing system, a new system is proposed. The proposed system consists of various tables, maintenance and report generation.

For the Design of textile management system care has been taken for developing an efficient system, which is user friendly as well as high in performance. It is been assured that the system will have the functions and promises of the proposed system. In the design, the various techniques are used to present a simple efficient system. Design phase acts as a bridge between the software requirement specification and the implementation phase. This satisfies the requirements.

The major step in design is the preparation of input forms and the design of all the major output forms in a manner acceptable to the user in all aspects. The base lies in the complete understanding of the system. The data flow diagrams explicitly specify the process flow. Table design or database design in the next major step .Extreme care has to be given here and several concepts of normalization have to be applied at many levels. The system is divided into different modules to increase the reliability and further increase in the debugging process. Due to different modules any change required in future can be done easily.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 36: new

Textiles Management System

TOP LEVEL ABSTRACTION

USERACCOUNTS To store the login details of each user

CATEGORY To store the category details

ITEM_MASTER To store the details of items

CUSTOMER To store the details of customers

ORDER_ITEM To store the details of purchase order

STOCK To store the details of purchased items

SUPPLIER To store the details of vendors

BILL To store the bill information

BILLAMOUNT To store the amount of each bill

EMPLOYEEDETAILS To store the details of employees

Dept. of B.C.A. Chinmaya Vidyapeet

Page 37: new

Textiles Management System

DATABASE DESIGN

This activity deals with the design of physical database. A key is to determine how the access paths are to be implemented. A physical path is derived from a logical path which may be implemented through use pointers, chains etc. A database is a collection of interrelated data stored with minimum redundancy to serve many users with information quickly and effectively. The general objective is to make information access easy, quick and inexpensive. In a database environment common data are available and used by several users. A database management can provide centralized access to data from program; it is possible to treat data as separate resource.

A database ensures controlled redundancy, data independence, more information at low cost, accuracy, integrity, privacy, security and recovery from failure etc.

To group the given data and to give them a logical structure, a database design is necessary. The overall objective in the development of a database is to treat data as an organized resource and is an integrated whole.

A database is a repository of information. It is a collection of interrelated data stored with minimum redundancy to serve many users quick and efficiently. The general objective is to make information access easy, quick, inexpensive and flexible for the users. In this project, we are mainly concentrated into relational databases. Relational database stores data in tables, which is turn, are composed of rows also known as records, columns also known as fields. The fields in the relational model are:

Primary key

The key which uniquely identify records .They also notify the not null constraint.

Foreign key

Dept. of B.C.A. Chinmaya Vidyapeet

Page 38: new

Textiles Management System

The key which reference the primary key, is the data inserted in the primary key column of the table.

Normalization

After the conceptual level, the next level of process of database design to organize the database structure into a good shape called Normalization. The Normalization simplifies the entries, removing redundancies from the system data and finally builds a data structure, which is both flexible and adaptable to the system. The different normal forms obtained during the database design are given below:

First Normal Form (1NF)

Second Normal Form (2NF)

Third Normal Form (3NF)

First Normal Form

A relation is said to be in first normal form only if it satisfies the constraints that contain the primary key only.

Second Normal Form

A relation is said to be in second normal form if and only if it satisfies all the first normal form conditions for the primary key and every non-primary key attributes of the relation is fully dependent on its primary key alone.

Third Normal Form

A relation is said to be in third normal form if and only if it is in second normal form and more over the non key attributes of the relation should not be depend on other non key attribute

Dept. of B.C.A. Chinmaya Vidyapeet

Page 39: new

Textiles Management System

INPUT DESIGN

Input design is the process of converting the user-originated input to a computer input to a computer based format. The design decision for handling input specify how data are accepted for computer processing. Input design is a part of overall system design that needs careful attention.

Users can interact with the software only through inputs. It is the conversion of user originated input to computer oriented format. It also determines the input media selected for processing. This phase of the design deals with the design of input screen, the validation of input data etc. This validation ensures that only the right kind of data is stored, thus maintaining the integrity of the data.

The forms are the physical carries of data. They are used to read from, write data on etc. In designing a form, attention is given to proper identification, wording, composition and layout, order items and clarity of instructions. In textiles we have several forms to accept application form information, addition and modification of different items, adding weight age details for each items etc. There are also others forms related to user preferences.

The collection of input data is considered to be the most expensive part of the system design. Since the inputs have to be planned in such a way so as to get the relevant information, extreme care is taken to obtain the pertinent information. If the data going into the system in incorrect then the processing and outputs will magnify these errors the goal of designing input data is to make data entry as easy, logical, and free from errors as possible.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 40: new

Textiles Management System

The options for input data entry are as follows:-

1) Add : - The adding option in each of the forms helps in keying in data to the system. For commercial and security reasons. Some of the adding options are restricted to the administrators of the system.

2) Edit : - The editing option helps in updating the user data. For commercial and security reasons. Some of the editing options are restricted to the administrators of the system.

3) Deletion : - The deletion option helps in removal of data from the system. For commercial and security reasons, some of the deletion options are restricted to the administrators of the system.

4) Search : - This option helps in searching for the data available in the database.

INPUT SCREENS

The input screen is designed in such a way that it is easier for the user to enter data in a logical order. The output screen should use the same format, not be overcrowded and use consistent terminology.

INPUT VALIDATIONS

The correctness of entered details must be checked by various methods to identify whether the data is acceptable. The entry of duplicate data should be prevented. Validation procedures are also present to detect errors in data input, which is beyond control procedures. Validations procedures are designed to check each record, data item or field against certain criteria.

The following are the objective of the input design: -

To procedure a cost effective method of input. To make the input forms understandable to the users. To ensure the validation of data inputs.

TABLE DESIGN

Dept. of B.C.A. Chinmaya Vidyapeet

Page 41: new

Textiles Management System

Table 1- Bill

Field name Data Type Size Key Attribute DescriptionBillno Varchar 15 BILLNUMBER

Itemid Varchar 15 ITEMID

Qty Number 5 QUANTITY

discount float 10 DISCOUNT

Table 2- Brand

Field name Data Type Size Key Attribute DescriptionId Varchar 15 Primary key BRANDIDcategory Varchar 15 CATEGORYbname Varchar 15 BRANDNAMEmaterial Varchar 10 MATERIAL

Table 3- Category

Field name Data Type Size Key Attribute DescriptionCatid Varchar 15 Primary key CATEGORYIDcatname Varchar 15 CATEGORYNAME

Subcat Varchar 15 SUBCATEGORY

Table 4- Damage

Field name Data Type Size Key Attribute DescriptionDamid Number 15 Primary key DAMAGEIDId Varchar 15 ID

Qty Int QUANTITY

Dept. of B.C.A. Chinmaya Vidyapeet

Page 42: new

Textiles Management System

Table 5- Supplier

Field name Data Type Size Key Attribute

Description

Supid varchar 15 Primary key SUPPLIERIDName varchar 15 NAME

address varchar 15 ADDRESS

Phno numeric 15,0 PHONENO

Fax varchar 15 FAX

Email Date time EMAIL

Web Varchar 15

Tin varchar 15

Cst Date time

Table 5- Depart

Field name Data Type Size Key Attribute DescriptionDid Varchar 15 Primary key DEPARTMENTIDDepart Varchar 15 DEPARTMENT

Design Varchar 15 DESIGNATION

Da float DA

Dept. of B.C.A. Chinmaya Vidyapeet

Page 43: new

Textiles Management System

Ta float TA

Hra float HRA

Pf float PF

Table 6- Employee

Field name

Data Type

Size

Key Attribute

Description

Id varchar 15 Primary key

ID

Name varchar 15 NAME

Address varchar 15 ADDRESS

Phno numeric 15,0 PHONENO

Sex varchar 15 SEX

Dob Date time

DATE OF BIRTH

Email Varchar 15 EMAIL

Qual varchar 15 QUALIFICATION

Doj Date time

DATE OF JOINING

Did varchar 15 DEPARTMENTID

Salary float BASIC SALARY

Table 7- Item

Field name Data Type Size Key Attribute DescriptionCatid varchar 15 Primary key CATEGORYIDBrandid varchar 15 BRANDID

Size int SIZE

Dept. of B.C.A. Chinmaya Vidyapeet

Page 44: new

Textiles Management System

Tax float TAX

Table 8- Login

Field name Data Type Size Key Attribute DescriptionUsername varchar 15 Primary key USERNAMEPassword varchar 15 PASSWORD

Table 9-Purchase Item

Field name Data Type Size Key Attribute DescriptionSupid varchar 15 SUPPLIER ID

Itemid varchar 15 ITEM ID

Uprice float UNITPRICE

Table 11-Purchase Order

Field name Data Type Size Key Attribute DescriptionOrdered varchar 15 ITEMID

Itemid varchar 15 CATEGORYID

Rate float RATE

Qty Int QUANTITY

Dept. of B.C.A. Chinmaya Vidyapeet

Page 45: new

Textiles Management System

Table 12-Purchase Return

Field name Data Type Size Key Attribute

Description

Dnoteno Varchar 15

Pbillno Varchar 15 PURCHASEBILLNO

Itemid Varchar 15 ITEMID

Qty Int QUANTITY

pretdate Datetime PURCHASERETURNDATE

Table 13- Purchase Supplier

Field name Data Type Size Key Attribute DescriptionOrdered Varchar 15 Primary key ORDERIDSupid Varchar 15 SUPPLIERID

Ordate Date time ORDERDATE

Table 14- Purchase

Field name Data Type Size Key Attribute

Description

Pbillno Varchar 15 PURCHASEBILLNUMBER

Dept. of B.C.A. Chinmaya Vidyapeet

Page 46: new

Textiles Management System

Ordered Varchar 15 ORDERID

Itemid Varchar 15 ITEMID

Rate Int INT

Qty Int QUANTITY

Deldate Datetime DELIVERYDATE

Table 10-Rate

Field name Data Type Size Key Attribute

Description

Id Varchar 15 Primary key IDRate Int RATE

Table 16- Sales

Field name Data Type Size Key Attribute

Description

Billno Varchar 15 Primary key BILLNUMBERDate Datetime DATE

Total float TOTAL

del_status Varchar 15 DELIVERY_STATUS

Table 17-Sales Return

Field name Data Type Size Key Attribute

Description

Cnoteno Varchar 15

Sbillno Varchar 15 SUPPLIERBILLNO

Itemid Varchar 15 ITEMID

Dept. of B.C.A. Chinmaya Vidyapeet

Page 47: new

Textiles Management System

Qty Int QUANTITY

Sretdate Date time SALESRETURN DATE

Table 18- Stock

Field name Data Type Size Key Attribute

Description

Id Varchar 15 Primary key STOCKIDCur Varchar 15 CURRENTSTOCK

Min Int MINIMUMSTOCK

OUTPUT DESIGN

Computer output is the most important and direct source of information to the user efficient, intelligible output design should improve the system’s relationships with the user and help in decision making. The emphasis is on producing hard copy or output on CRT screen in preferred manner. Even graphical displays are possible but, in this software we make use of the

Dept. of B.C.A. Chinmaya Vidyapeet

Page 48: new

Textiles Management System

reports for displaying various sorts of outputs. In this system reports are make use of the reports for displaying various sorts of outputs.

The output design phase of the system design is concerned with the conveyance of information to the end users in a user friendly manner. It is an ongoing activity almost from the beginning of the project, and follows the principles of form design. Efficient and well-defined output design improves the relation of the system and the user, thus facilitating decision making. The primary considerations in the design of the output are the requirement of the information and the objectives and the objectives of the end users.

Output design generally refers to the result and information that is generated by the system for many end-users. Output is the main reason for developing the system and the basics for evaluating the usefulness of the application. Efficient, intelligent output should improve system’s relationships with the user and help in decision making. The design should be readable and ordered

Reports are divided into three types: -

1) Internal Reports

2) End user Reports and

3) System Reports.

1) Internal Reports These types of reports are used by the management and staff of the organization. They help the management and staff in planning, organizing, coordinating and controlling the activities of the organization.

2) End User Reports

These are reports of ordinary nature, which are generated by the user. It includes transactions reports etc.

3) System Reports

Dept. of B.C.A. Chinmaya Vidyapeet

Page 49: new

Textiles Management System

They are reports generated by the system for the administrators and managers. These include user registration reports. Performance analysis reports, database status report etc.

Extra care has been taken in design and creation of the reports. Reports are created category using Data report, as well as ordinary flex grid formats also. This helps in creating category wise grouping and summarizing of data in the reports. The reports generated by the system include all the above reports and will have option for generation of reports based on time periods specified by the user.

BillDim cmd As ADODB.CommandDim r As New ADODB.Recordset, rsd As ADODB.Recordset, rs As ADODB.Recordset, rsb As RecordsetDim flag As IntegerDim str As StringDim cnt As Integer, n As Integer, m As Integer

Dept. of B.C.A. Chinmaya Vidyapeet

Page 50: new

Textiles Management System

Dim c As Single

Private Sub Form_Load()Frame1.Enabled = FalseFrame2.Enabled = FalseMSFG1.Enabled = FalseCall conestablishtxtgross.Locked = TrueFor i = 0 To 50 cmbdis.AddItem i i = i + 4Next iCall sss(True)Call titleimage(bill)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled22.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd SubPublic Sub sss(a As Boolean)cmdcomplete.Enabled = Not acmdadditem.Enabled = Not acmdremove.Enabled = Not acmdnew.Enabled = aEnd Sub

Private Sub cmdnew_Click()cnt = 0r.Open "select billno from sales", con, adOpenDynamic, adLockOptimisticIf r.EOF = True And r.BOF = True Then s = "B001"Else r.MoveLast s = r!billno a = Mid(s, 2, 3) m = CInt(a) + 1 If m > 99 Then s = "B" & CStr(m) ElseIf m > 9 Then s = "B0" & CStr(m) Else s = "B00" & CStr(m) End IfEnd If

Dept. of B.C.A. Chinmaya Vidyapeet

Page 51: new

Textiles Management System

txtinvoice.Text = sr.CloseMSFG1.Rows = 2txtdate.Text = Date & vbNewLine & TimeFrame1.Enabled = TrueFrame2.Enabled = TrueCall setgridCall sss(False)End SubPrivate Sub cmbdis_Click()c = Val(txtgross.Text) * Val(cmbdis.Text) / 100t = Val(txtgross.Text) - ctxtnet.Text = Round(t * 100 / 104.04, 2)txttamt.Text = Round(Val(txtnet.Text) * 4.04 / 100, 2)txttot.Text = Val(txttamt.Text) + Val(txtnet.Text)End Sub

Private Sub cmbid_GotFocus()cmbid.clearSet rsd = New ADODB.Recordsetrsd.Open "select id from stock where id in(select id from rate);", con, adOpenDynamic, adLockOptimisticWhile Not rsd.EOF cmbid.AddItem rsd!id rsd.MoveNextWendrsd.CloseEnd Sub

Private Sub cmdadditem_Click()MSFG1.Rows = Int(MSFG1.Rows) + 1cnt = cnt + 1MSFG1.TextMatrix(cnt, 0) = cntMSFG1.TextMatrix(cnt, 1) = cmbid.TextMSFG1.TextMatrix(cnt, 2) = txtname.TextMSFG1.TextMatrix(cnt, 3) = txttax.TextMSFG1.TextMatrix(cnt, 4) = txtuprice.TextMSFG1.TextMatrix(cnt, 5) = txtqty.TextMSFG1.TextMatrix(cnt, 6) = txtgross.TextMSFG1.TextMatrix(cnt, 7) = CStr(c)MSFG1.TextMatrix(cnt, 8) = txtnet.TextMSFG1.TextMatrix(cnt, 9) = txttamt.TextMSFG1.TextMatrix(cnt, 10) = txttot.Texttxtgrand.Text = Val(txtgrand.Text) + MSFG1.TextMatrix(cnt, 10)

Dept. of B.C.A. Chinmaya Vidyapeet

Page 52: new

Textiles Management System

End Sub

Private Sub cmdadditem_GotFocus()If cmbdis.Text = "" Thencmbdis.Text = 0c = Val(txtgross.Text) * Val(cmbdis.Text) / 100t = Val(txtgross.Text) - ctxtnet.Text = Round(t * 100 / 104.04, 2)txttamt.Text = Round(Val(txtnet.Text) * 4.04 / 100, 2)txttot.Text = Val(txttamt.Text) + Val(txtnet.Text)End IfEnd Sub

Private Sub cmdcomplete_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = conFor i = 1 To cnt str = "insert into bill values('" & txtinvoice.Text & "','" & MSFG1.TextMatrix(i, 1) & "'," & MSFG1.TextMatrix(i, 5) & "," & MSFG1.TextMatrix(i, 7) & ");" cmd.CommandText = str cmd.Execute str = "update stock set cur=cur - " & MSFG1.TextMatrix(i, 5) & " where id='" & MSFG1.TextMatrix(i, 1) & "';" cmd.CommandText = str cmd.ExecuteNext istr = "insert into sales values('" & txtinvoice.Text & "','" & txtdate.Text & "'," & txtgrand.Text & ",'not delivered');"cmd.CommandText = strcmd.ExecuteMsgBox "bill created successfully"MSFG1.clearDim ctrl As ControlFor Each ctrl In Me.Controls If TypeOf ctrl Is Label Or TypeOf ctrl Is CommandButton Or TypeOf ctrl Is MSFlexGrid Or TypeOf ctrl Is Frame Then Else ctrl.Text = "" End IfNext ctrlCall sss(True)End Sub

Private Sub cmdremove_Click()

Dept. of B.C.A. Chinmaya Vidyapeet

Page 53: new

Textiles Management System

If n = Empty Then MsgBox "item to be removed is not selected" MSFG1.SetFocusElse For i = n To cnt - 1 MSFG1.TextMatrix(i, 1) = i For j = 1 To 10 MSFG1.TextMatrix(i, j) = MSFG1.TextMatrix(i + 1, j) Next j Next i For i = 0 To 10 MSFG1.TextMatrix(cnt, i) = "" Next i cnt = cnt - 1 MSFG1.Rows = Int(MSFG1.Rows) - 1 txtgrand.Text = Val(txtgrand.Text) - mEnd IfEnd Sub

Private Sub Command1_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = concmd.CommandText = "delete from supplier"cmd.ExecuteEnd Sub

Private Sub Cmbid_Click()rsd.Open "select * from item where id in(select id from rate where id='" & cmbid.Text & "');", con, adOpenDynamic, adLockOptimisticIf Not rsd.EOF Then Call idetail(cmbid.Text) txtname.Text = detailsitem txttax.Text = rsd!taxEnd Iftxtqty.Text = ""txtgross.Text = ""txtnet.Text = ""txttamt.Text = ""txttot.Text = ""cmbdis.Text = ""rsd.CloseEnd Sub

Private Sub Cmbid_Change()

Dept. of B.C.A. Chinmaya Vidyapeet

Page 54: new

Textiles Management System

Set cmd = New ADODB.CommandSet cmd.ActiveConnection = constr = "select * from item where id='" & cmbid.Text & "';"cmd.CommandText = strcmd.Executersd.Closersd.Open "select * from item where id='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimisticIf Not rsd.EOF Then txtname.Text = rsd!Name txttax.Text = rsd!tax txtuprice.Text = rsd!unitpriceEnd IfEnd Sub

Private Sub MSFG1_Click()n = MSFG1.Rowm = MSFG1.TextMatrix(n, 10)End Sub

Private Sub txtqty_KeyPress(keyascii As Integer)Call valnum(txtqty, keyascii)End Sub

Private Sub txtqty_LostFocus()txtgross.Text = Val(txtuprice.Text) * Val(txtqty)End Sub

Public Sub setgrid()MSFG1.Enabled = TrueMSFG1.TextMatrix(0, 0) = "sl no"MSFG1.TextMatrix(0, 1) = "item code"MSFG1.TextMatrix(0, 2) = "item name"MSFG1.TextMatrix(0, 3) = "rate of tax"MSFG1.TextMatrix(0, 4) = "unit price"MSFG1.TextMatrix(0, 5) = "quantity"MSFG1.TextMatrix(0, 6) = "gross value"MSFG1.TextMatrix(0, 7) = "discount"MSFG1.TextMatrix(0, 8) = "net value"MSFG1.TextMatrix(0, 9) = "tax amount"MSFG1.TextMatrix(0, 10) = "total"End Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 55: new

Textiles Management System

Brand

Dim r As New ADODB.Recordset, rs As New ADODB.RecordsetDim cmd As New ADODB.Command

Private Sub cmdback_Click()Unload branditem.Show'item.cmbbrand.SetFocusEnd Sub

Private Sub Form_Load()Call conestablishCall cancelsave(True)Call fillcomboIf pqr = 1 Then Call cmdadd_Click c = 0 For c = 0 To cmbcat.ListCount If cmbcat.List(c) = item.cmbsub.Text Then cmbcat.ListIndex = c End If Next c cmbcat.Enabled = False End IfCall titleimage(brand)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled66.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Public Sub cancelsave(a As Boolean)cmdadd.Enabled = acmdcancel.Enabled = Not acmdsave.Enabled = Not acmdview.Enabled = abrand.Width = 6700Frame1.Enabled = Not aEnd Sub

Public Sub fillcombo()cmbcat.clearrs.Open "select distinct subcat from category", con, adOpenDynamic, adLockOptimistic

Dept. of B.C.A. Chinmaya Vidyapeet

Page 56: new

Textiles Management System

While Not rs.EOF cmbcat.AddItem rs!subcat rs.MoveNextWendrs.Closecmbcat.ListIndex = 0End Sub

Private Sub cmdadd_Click()Dim n As Integer, s As StringCall clearCall cancelsave(False)r.Open "select id from brand", con, adOpenDynamic, adLockOptimisticIf r.EOF And r.BOF Then s = "BND0001"Else r.MoveLast s = r!id n = Mid(s, 4, 4) n = Int(n) n = n + 1 If n > 999 Then s = "BND" & n ElseIf n > 99 Then s = "BND0" & n ElseIf n > 9 Then s = "BND00" & n Else s = "BND000" & n End IfEnd Iftxtid.Text = sr.CloseEnd Sub

Public Sub treeview()r.Open "select distinct category from brand", con, adOpenDynamic, adLockOptimistictvw.Nodes.cleartvw.Nodes.Add , , "ROOT", "categories"While Not r.EOF tvw.Nodes.Add "ROOT", tvwChild, r!category, r!category Set rs = New ADODB.Recordset rs.Open "select bname from brand where category='" & r!category & "';", con, adOpenDynamic, adLockOptimistic

Dept. of B.C.A. Chinmaya Vidyapeet

Page 57: new

Textiles Management System

While Not rs.EOF s = r!category ss = rs!bname tvw.Nodes.Add s, tvwChild, ss, rs!bname rs.MoveNext Wend rs.Close r.MoveNextWendr.CloseIf tvw.Nodes.count > 1 Then tvw.Nodes("ROOT").Expanded = True tvw.Nodes("ROOT").Selected = TrueEnd IfEnd Sub

Private Sub tvw_Click()If Not tvw.SelectedItem.Key = "ROOT" Then Dim str As String Dim trs As New ADODB.Recordset str = tvw.SelectedItem.Text trs.Open "select * from category where catname='" & str & "';", con, adOpenDynamic, adLockOptimistic For i = 0 To Combo1.ListCount - 1 Step 1 If Combo1.List(i) = trs!did Then Combo1.ListIndex = i Exit For End If Next iEnd IfEnd Sub

Private Sub cmdcancel_Click()Call cancelsave(True)Call clearEnd Sub

Public Sub clear()Call fillcombotxtid.Text = ""txtbrand.Text = ""txtmat.Text = ""End Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 58: new

Textiles Management System

Private Sub cmdsave_Click()cmd.ActiveConnection = concmd.CommandText = "insert into brand values('" & txtid.Text & "','" & cmbcat.Text & "','" & txtbrand.Text & "','" & txtmat.Text & "');"cmd.ExecuteMsgBox "record added successfully"h = txtbrand.Texth1 = txtmat.TextCall cancelsave(True)Call clearIf pqr = 1 Then Unload brand item.Show item.cmbbrand.Text = h item.txtmat.Text = h1 pqr = 0End IfEnd Sub

Private Sub cmdsave_GotFocus()Dim ctrl As ControlFor Each ctrl In Me.Controls If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ComboBox Then If ctrl.Text = "" Or ctrl.Text = "------------select------------" Then MsgBox "plz fill details" ctrl.SetFocus Exit For End If End IfNext ctrlEnd Sub

Private Sub cmdview_Click()Call cancelsave(False)brand.Width = 8820Call treeviewcmdsave.Enabled = False'Frame1.Enabled = Falsecmdback.SetFocusEnd Sub

Category

Dept. of B.C.A. Chinmaya Vidyapeet

Page 59: new

Textiles Management System

Dim r As New ADODB.Recordset, rs As New ADODB.RecordsetDim cmd As New ADODB.CommandDim s As String

Private Sub cmdadd_Click()Dim n As Integer, s As StringCall clearCall cancelsave(False)r.Open "select catid from category", con, adOpenDynamic, adLockOptimisticIf r.EOF And r.BOF Then s = "CAT0001"Else r.MoveLast s = r!catid n = Mid(s, 4, 4) n = Int(n) n = n + 1 If n > 999 Then s = "CAT" & n ElseIf n > 99 Then s = "CAT0" & n ElseIf n > 9 Then s = "CAT00" & n Else s = "CAT000" & n End IfEnd Iftxtid.Text = sr.CloseEnd Sub

Private Sub cmdback_Click()Unload categoryitem.Show'item.cmdsub.SetFocusEnd Sub

Private Sub cmdcancel_Click()Call cancelsave(True)Call clearEnd Sub

Private Sub cmdsave_Click()cmd.ActiveConnection = con

Dept. of B.C.A. Chinmaya Vidyapeet

Page 60: new

Textiles Management System

cmd.CommandText = "insert into category values('" & txtid.Text & "','" & cmbcat.Text & "','" & txtsub.Text & "');"cmd.ExecuteMsgBox "record added successfully"h = txtsub.TextCall cancelsave(True)Call clearIf pqr = 1 Then Unload category item.Show item.cmbsub.Text = h pqr = 0End IfEnd Sub

Private Sub cmdsave_GotFocus()Dim ctrl As ControlFor Each ctrl In Me.Controls If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ComboBox Then If ctrl.Text = "" Or ctrl.Text = "------------select------------" Then MsgBox "plz fill details" ctrl.SetFocus Exit For End If End IfNext ctrlEnd Sub

Private Sub cmdview_Click()Call cancelsave(False)category.Width = 8820Call treeviewcmdsave.Enabled = FalseEnd Sub

Private Sub Form_Load()Call conestablishCall cancelsave(True)Call fillcomboIf pqr = 1 Then Call cmdadd_Click cmbcat.ListIndex = item.cmbcat.ListIndex + 1 cmbcat.Enabled = FalseEnd If

Dept. of B.C.A. Chinmaya Vidyapeet

Page 61: new

Textiles Management System

Call titleimage(category)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled8.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Public Sub cancelsave(a As Boolean)cmdadd.Enabled = acmdcancel.Enabled = Not acmdsave.Enabled = Not acmdview.Enabled = acategory.Width = 6000Frame1.Enabled = Not aEnd Sub

Public Sub fillcombo()cmbcat.clearcmbcat.AddItem "------------select------------"cmbcat.AddItem "mens"cmbcat.AddItem "ladies"cmbcat.AddItem "kids"cmbcat.AddItem "others"cmbcat.ListIndex = 0End Sub

Public Sub treeview()r.Open "select distinct catname from category", con, adOpenDynamic, adLockOptimistictvw.Nodes.cleartvw.Nodes.Add , , "ROOT", "categories"While Not r.EOF tvw.Nodes.Add "ROOT", tvwChild, r!catname, r!catname Set rs = New ADODB.Recordset rs.Open "select subcat from category where catname='" & r!catname & "';", con, adOpenDynamic, adLockOptimistic While Not rs.EOF s = r!catname ss = rs!subcat tvw.Nodes.Add s, tvwChild, ss, rs!subcat rs.MoveNext Wend rs.Close r.MoveNextWendr.Close

Dept. of B.C.A. Chinmaya Vidyapeet

Page 62: new

Textiles Management System

If tvw.Nodes.count > 1 Then tvw.Nodes("ROOT").Expanded = True tvw.Nodes("ROOT").Selected = TrueEnd IfEnd Sub

Private Sub tvw_Click()If Not tvw.SelectedItem.Key = "ROOT" Then Dim str As String Dim trs As New ADODB.Recordset str = tvw.SelectedItem.Text trs.Open "select * from category where catname='" & str & "';", con, adOpenDynamic, adLockOptimistic For i = 0 To Combo1.ListCount - 1 Step 1 If Combo1.List(i) = trs!did Then Combo1.ListIndex = i Exit For End If Next iEnd IfEnd Sub

Public Sub clear()Call fillcombotxtid.Text = ""txtsub.Text = ""End Sub

Damage

Dim r As New ADODB.Recordset, rs As New ADODB.RecordsetDim cmd As New ADODB.Command

Private Sub Form_Load()Call conestablishCall titleimage(DAMAGE)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled22.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub cmbid_GotFocus()

Dept. of B.C.A. Chinmaya Vidyapeet

Page 63: new

Textiles Management System

rs.Open "select id from item", con, adOpenDynamic, adLockOptimisticcmbid.clearWhile Not rs.EOF cmbid.AddItem rs!id rs.MoveNextWendrs.CloseEnd Sub

Private Sub Cmbid_Click()rs.Open "select cur from stock where id='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimistictxtcur.Text = rs!currs.CloseEnd Sub

Private Sub cmdsave_Click()cmd.ActiveConnection = conDim str As Stringr.Open "select * from damage where id='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimisticIf r.EOF = True Then r.Close r.Open "select damid from damage", con, adOpenDynamic, adLockOptimistic If r.BOF = True And r.EOF = True Then n = "DM001" Else r.MoveLast n = r!damid a = Mid(n, 3, 3) m = CInt(a) + 1 If m > 99 Then n = "DM" & CStr(m) ElseIf m > 9 Then n = "DM0" & CStr(m) Else n = "DM00" & CStr(m) End If End If txtid.Text = n str = "insert into damage values('" & txtid.Text & "','" & cmbid.Text & "'," & txtqty.Text & ");"Else str = "update damage set qty=" & txtqty.Text + r!qty & " where id='" & cmbid.Text & "';"End If

Dept. of B.C.A. Chinmaya Vidyapeet

Page 64: new

Textiles Management System

cmd.CommandText = strcmd.Executestr = "update stock set cur=" & rs!cur - txtqty.Text & " where id='" & cmbid.Text & "';"cmd.CommandText = strcmd.ExecuteMsgBox "SAVED!!!!"txtcur.Text = ""txtid.Text = ""txtqty.Text = ""cmbid.Text = ""End Sub

Delivery

Dim cnt As IntegerPrivate Sub ImageCombo1_Change()End Sub

Private Sub Command1_Click()cnt = cnt + 1MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1End Sub

Private Sub Command4_Click()MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1End Sub

Private Sub Form_Load()cnt = 0Call titleimage(delevery)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled11.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Department

Dim con As ADODB.ConnectionDim rs As ADODB.Recordset, r As ADODB.RecordsetDim flag As IntegerDim cmd As ADODB.CommandDim str As String, o As String, s As String

Dept. of B.C.A. Chinmaya Vidyapeet

Page 65: new

Textiles Management System

Dim cnt As Integer, coun As Integer

Private Sub cmbdepart_Click()o = cmbdepart.TextEnd Sub

Private Sub cmbdepart_GotFocus()cmbdepart.clearrs.Closers.Open "select distinct depart from depart", con, adOpenDynamic, adLockOptimisticWhile Not rs.EOF cmbdepart.AddItem rs!depart rs.MoveNextWendEnd Sub

Private Sub cmbdesig_Click()s = cmbdesig.TextEnd Sub

Private Sub cmbdesig_GotFocus()rs.Closecmbdesig.clearIf cmbdepart.Text = "" Then MsgBox "u hv'nt entered department. plz enter" cmbdepart.SetFocusElse rs.Open "select desig from depart where depart='" & cmbdepart.Text & "';", con, adOpenDynamic, adLockOptimistic While Not rs.EOF cmbdesig.AddItem rs!desig rs.MoveNext WendEnd IfEnd Sub

Private Sub cmdedit_Click()cmdsave.Enabled = Truetxtdepart.Visible = Falsecmbdepart.Visible = Truecmbdesig.Visible = Truetxtdesig.Visible = Falseflag = 2'cmdclear.Visible = False

Dept. of B.C.A. Chinmaya Vidyapeet

Page 66: new

Textiles Management System

'cmdinsert.Visible = FalseEnd Sub

Private Sub cmdinsert_Click()flag = 1cmdsave.Enabled = Truetxtdepart.Visible = Truecmbdepart.Visible = Falsecmbdesig.Visible = Falsetxtdesig.Visible = True'cmdclear.Visible = Falsetxtdepart.Text = ""txtdesig.Text = ""txtsal.Text = ""End Sub

Private Sub cmdsave_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = conIf flag = 1 Then rs.Close rs.Open "select * from depart ", con, adOpenDynamic, adLockOptimistic While Not rs.EOF If rs!depart = txtdepart.Text And rs!desig = txtdesig.Text Then MsgBox "record already present" GoTo aa: End If rs.MoveNext Wend If rs.EOF = True And rs.BOF = True Then d = 1 Else rs.MoveLast d = rs!did + 1 End If str = "insert into depart values(" & d & ",'" & txtdepart.Text & "','" & txtdesig.Text & "'," & txtsal.Text & ");" cmd.CommandText = str cmd.Execute MsgBox "record entered successfully" rs.Close rs.Open "select * from depart ", con, adOpenDynamic, adLockOptimistic rs.MoveLast Call fill

Dept. of B.C.A. Chinmaya Vidyapeet

Page 67: new

Textiles Management System

ElseIf flag = 2 Then str = "update depart set depart='" & cmbdepart.Text & "', desig ='" & cmbdesig.Text & "',salary=" & txtsal.Text & " where depart='" & o & "'and desig ='" & s & "';" cmd.CommandText = str cmd.Execute MsgBox "record updated" rs.Close rs.Open "select * from employee ", con, adOpenDynamic, adLockOptimisticEnd Ifaa:End Sub

Private Sub Command1_Click()Dim trs As New ADODB.Recordsettrs.Open "select * from depart", con, adOpenDynamic, adLockOptimisticWhile Not trs.EOF Combo1.AddItem trs!did trs.MoveNextWendCombo1.ListIndex = 0End Sub

Private Sub Form_Initialize()coun = 1End Sub

Private Sub Form_Load()'cmdclear.Visible = Falsecmdsave.Enabled = Falsecmbdepart.Visible = Falsecmbdesig.Visible = FalseSet con = New ADODB.Connectioncon.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=textiless;Data Source=USER-8E49972B7B\SQLEXPRESS"con.Opencmdsave.Enabled = FalseSet rs = New ADODB.Recordsetrs.Open "select distinct depart from depart", con, adOpenDynamic, adLockOptimistic'rs.MoveFirst'Call filltvgsubs.Nodes.cleartvgsubs.Nodes.Add , , "ROOT", "departments in the organisation"While Not rs.EOF tvgsubs.Nodes.Add "ROOT", tvwChild, rs!depart, rs!depart

Dept. of B.C.A. Chinmaya Vidyapeet

Page 68: new

Textiles Management System

Set r = New ADODB.Recordset r.Open "select desig from depart where depart='" & rs!depart & "';", con, adOpenDynamic, adLockOptimistic While Not r.EOF s = rs!depart ss = r!desig tvgsubs.Nodes.Add s, tvwChild, ss, r!desig r.MoveNext Wend r.Close rs.MoveNextWendrs.CloseIf tvgsubs.Nodes.count > 1 Then tvgsubs.Nodes("ROOT").Expanded = True tvgsubs.Nodes("ROOT").Selected = TrueEnd IfCall titleimage(depart)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled33.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Public Sub fill()txtdepart.Text = rs!departtxtdesig.Text = rs!desigtxtsal.Text = rs!salaryEnd Sub

Private Sub tvgsubs_Click()If Not tvgsubs.SelectedItem.Key = "ROOT" Then Dim str As String Dim trs As New ADODB.Recordset str = tvgsubs.SelectedItem.Text trs.Open "select * from depart where desig='" & str & "';", con, adOpenDynamic, adLockOptimistic For i = 0 To Combo1.ListCount - 1 Step 1 If Combo1.List(i) = trs!did Then Combo1.ListIndex = i Exit For End If Next iEnd If

Dept. of B.C.A. Chinmaya Vidyapeet

Page 69: new

Textiles Management System

End Sub

Employee

Dim rsd As ADODB.Recordset, r As New ADODB.Recordset, rsdf As New ADODB.RecordsetDim flag As IntegerDim cmd As ADODB.CommandDim str As String, s1 As StringDim p As Integer, q As Integer, del As Integer

Private Sub cmdphoto_Click()Picture1.Visible = TrueComdphoto.ShowOpenPicture1.Picture = LoadPicture(Comdphoto.FileName)Picture1.PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeightPicture1.Picture = Picture1.ImageEnd Sub

Public Sub savephoto()Dim str1 As StringDim appid As StringIf flag = 1 Then appid = txtid.TextElse appid = cmbid.TextEnd Ifstr1 = App.Path & "\resources\appphoto\" & appid & ".bmp"SavePicture Picture1.Picture, str1End Sub

Public Sub addedit(a As Boolean)txtid.Visible = acmbid.Visible = Not aEnd Sub

Public Sub cancelsave(a As Boolean)cmdadd.Enabled = acmddele.Enabled = acmdedit.Enabled = acmdcancel.Enabled = Not acmdsave.Enabled = Not aFrame1.Enabled = Not acmdphoto.Visible = Not aPicture1.Visible = Not a

Dept. of B.C.A. Chinmaya Vidyapeet

Page 70: new

Textiles Management System

del = 0End Sub

Public Sub clear()txtid.Text = ""txtname.Text = ""txtaddr.Text = ""txtphno.Text = ""txtdob.Text = ""txtemail.Text = ""txtdoj.Text = ""txtsal.Text = ""cmbdepart.clearcmbdesig.clearcmbid.clearoptm.Value = Falseoptf.Value = FalseEnd Sub

Private Sub cmbdepart_GotFocus()cmbdepart.clearr.Open "select distinct depart from depart", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbdepart.AddItem r!depart r.MoveNextWendr.CloseEnd Sub

Private Sub cmbdesig_GotFocus()cmbdesig.clearIf cmbdepart.Text = "" Then MsgBox "u hv'nt entered department. plz enter" cmbdepart.SetFocusElse r.Open "select desig from depart where depart='" & cmbdepart.Text & "';", con, adOpenDynamic, adLockOptimistic While Not r.EOF cmbdesig.AddItem r!desig r.MoveNext Wend r.CloseEnd IfEnd Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 71: new

Textiles Management System

Private Sub cmbid_GotFocus()r.Open "select id from employee ", con, adOpenDynamic, adLockOptimisticcmbid.clearWhile Not r.EOF cmbid.AddItem r!id r.MoveNextWendr.CloseEnd Sub

Private Sub cmdcancel_Click()Call clearCall cancelsave(True)End Sub

Private Sub Command1_Click()Set cmd = New ADODB.Command cmd.CommandText = "delete from psupp" cmd.ActiveConnection = con cmd.Execute cmd.CommandText = "delete from item" cmd.ActiveConnection = con cmd.Execute cmd.CommandText = "delete from porder" cmd.ActiveConnection = con cmd.Execute MsgBox "data deleted succesfully", vbInformation, "delete successfull"End Sub

Private Sub txtdob_GotFocus()p = 1Calendar1.Visible = TrueEnd Sub

Private Sub txtdob_KeyPress(keyascii As Integer)MsgBox ("use calendar to insert date of birth")keyascii = 0End Sub

Private Sub txtdoj_GotFocus()p = 2Calendar1.Visible = TrueEnd Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 72: new

Textiles Management System

Private Sub Calendar1_Click()If p = 1 Then txtdob.Text = Calendar1.Value txtdob.SetFocusElseIf p = 2 Then txtdoj.Text = Calendar1.Value txtdoj.SetFocusEnd IfEnd Sub

Private Sub txtdob_LostFocus()Calendar1.Visible = FalseEnd Sub

Private Sub txtdoj_KeyPress(keyascii As Integer)MsgBox ("use calendar to insert date of join")keyascii = 0End Sub

Private Sub txtdoj_LostFocus()Calendar1.Visible = FalseEnd Sub

Private Sub Cmbid_Change()Call fill(cmbid.Text)End Sub

Public Sub fill(id As String)r.Open "select * from employee where id='" & id & "';", con, adOpenDynamic, adLockOptimisticIf Not r.EOF Then txtid.Text = r!id txtname.Text = r!Name If r!sex = "male" Then optm.Value = True Else optf.Value = True End If txtaddr.Text = r!address txtphno.Text = r!phno txtdob.Text = r!dob txtemail.Text = r!email cmbqual.Text = r!qual txtdoj.Text = r!doj

Dept. of B.C.A. Chinmaya Vidyapeet

Page 73: new

Textiles Management System

txtsal.Text = r!salary rsdf.Open "select * from depart where did=" & r!did, con, adOpenDynamic, adLockOptimistic cmbdesig.Text = rsdf!desig cmbdepart.Text = rsdf!depart rsdf.Close Picture1.Visible = True Picture1.Picture = LoadPicture("D:\PGMS\MINI PROJECT\resources\appphoto\" & txtid.Text & ".bmp") Picture1.PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeightEnd Ifr.CloseEnd Sub

Private Sub cmddele_Click()Call cancelsave(False)cmdsave.Enabled = FalseMsgBox "select employee name to be deleted from combo box"Call addedit(False)cmdcancel.SetFocusdel = 1End Sub

Private Sub Cmbid_Click()Call fill(cmbid.Text)If del = 1 Then cmdphoto.Visible = False Dim i As Integer i = MsgBox("are u sure u want to delete this record?", vbCritical + vbYesNo, "confirm delete") If i = vbYes Then Call cancelsave(True) Set cmd = New ADODB.Command cmd.CommandText = "delete from employee where id='" & cmbid.Text & "';" cmd.ActiveConnection = con cmd.Execute MsgBox "data deleted succesfully", vbInformation, "delete successfull" Call clear End If del = 0Else txtname.SetFocus cmdphoto.Visible = TrueEnd IfEnd Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 74: new

Textiles Management System

Private Sub Form_Load()Call conestablishCall clearCall cancelsave(True)Call addedit(True)Call titleimage(employee)Picture3.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled11.bmp")Picture3.PaintPicture Picture3.Picture, 0, 0, Picture3.ScaleWidth, Picture3.ScaleHeightPicture3.Picture = Picture3.ImageEnd Sub

Private Sub cmdadd_Click()Dim n As String, a As String, m As Integerflag = 1Call clearCall cancelsave(False)Call addedit(True)r.Open "select id from employee", con, adOpenDynamic, adLockOptimisticIf r.BOF = True And r.EOF = True Then n = "e001"Else r.MoveLast n = r!id a = Mid(n, 2, 3) m = CInt(a) + 1 If m > 99 Then n = "e" & CStr(m) ElseIf m > 9 Then n = "e0" & CStr(m) Else n = "e00" & CStr(m) End IfEnd Ifr.Closetxtid.Text = ncmdphoto.Visible = TrueEnd Sub

Private Sub cmdedit_Click()Call cancelsave(False)Call addedit(False)Call clearflag = 2

Dept. of B.C.A. Chinmaya Vidyapeet

Page 75: new

Textiles Management System

End Sub

Private Sub cmdsave_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = conCall savephotoIf optf.Value = True Then sex = "female"ElseIf optm.Value = True Then sex = "male"End IfIf flag = 1 Then r.Open "select did from depart where depart='" & cmbdepart.Text & "' and desig='" & cmbdesig.Text & "';", con, adOpenDynamic, adLockOptimistic d = r!did str = "insert into employee values('" & txtid.Text & "','" & txtname.Text & "','" & txtaddr.Text & "'," & txtphno.Text & ",'" & sex & "','" & txtdob.Text & "','" & txtemail.Text & "','" & cmbqual.Text & "','" & txtdoj.Text & "'," & d & "," & txtsal.Text & ");" cmd.CommandText = str cmd.Execute MsgBox "record entered successfully" r.CloseElseIf flag = 2 Then str = "update employee set name='" & txtname.Text & "',address='" & txtaddr.Text & "',phno=" & txtphno.Text & ",sex='" & sex & "',dob='" & txtdob.Text & "',email='" & txtemail.Text & "',salary=" & txtsal.Text & "where id='" & cmbid.Text & "';" cmd.CommandText = str cmd.Execute MsgBox "record updated"End IfCall cancelsave(True)Call clearEnd Sub

Item

Dim cmd As ADODB.Command, cm As ADODB.CommandDim r As New ADODB.RecordsetDim rs As New ADODB.RecordsetDim flag As Integer, del As IntegerDim str As StringPublic f As Integer

Public Sub fill(s As String)

Dept. of B.C.A. Chinmaya Vidyapeet

Page 76: new

Textiles Management System

r.Open "select * from item where id='" & s & "';", con, adOpenDynamic, adLockOptimisticIf Not r.EOF Thenrs.Open "select * from category where catid='" & r!catid & "';", con, adOpenDynamic, adLockOptimistic cmbcat.Text = rs!catname cmbsub.Text = rs!subcatrs.Closers.Open "select * from brand where id='" & r!brandid & "';", con, adOpenDynamic, adLockOptimistic cmbbrand.Text = rs!bname txtmat.Text = rs!materialrs.Closetxtsize.Text = r!Sizecmbtax.Text = r!taxrs.Open "select * from stock where id='" & r!id & "';", con, adOpenDynamic, adLockOptimistic txtmin.Text = rs!Minrs.CloseEnd Ifr.Closecmdcancel.SetFocusEnd Sub

Public Sub cancelsave(a As Boolean)Frame2.Enabled = Not acmdadd.Enabled = acmddele.Enabled = acmdedit.Enabled = acmdsave.Enabled = Not acmdcancel.Enabled = Not aCall cleardel = 0End Sub

Public Sub addedit(a As Boolean)txtid.Visible = acmbid.Visible = Not aEnd Sub

Public Sub clear()Dim ctrl As ControlFor Each ctrl In item If TypeOf ctrl Is TextBox Then ctrl.Text = "" ElseIf TypeOf ctrl Is ComboBox Then

Dept. of B.C.A. Chinmaya Vidyapeet

Page 77: new

Textiles Management System

ctrl.clear End IfNext ctrlEnd Sub

Private Sub cmbbrand_Click()r.Open "select material from brand where bname='" & cmbbrand.Text & "';", con, adOpenDynamic, adLockOptimistictxtmat.Text = r!materialr.CloseEnd Sub

Private Sub cmbbrand_DropDown()Call clean(cmbbrand.TabIndex)End Sub

Private Sub cmbcat_DropDown()Call clean(cmbcat.TabIndex)End Sub

Private Sub cmbid_DropDown()Call clean(cmbid.TabIndex)End Sub

Private Sub cmbid_GotFocus()r.Open "select id from item ", con, adOpenDynamic, adLockOptimisticIf r.EOF = True And r.BOF = True Then MsgBox "no record for editing"ElseWhile Not r.EOF cmbid.AddItem r!id r.MoveNextWendEnd Ifr.CloseEnd Sub

Private Sub cmbsub_DropDown()Call clean(cmbsub.TabIndex)End Sub

Private Sub cmbtax_DropDown()Call clean(cmbtax.TabIndex)End Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 78: new

Textiles Management System

Private Sub cmbtax_GotFocus()cmbtax.clearcmbtax.AddItem "0"cmbtax.AddItem "4"cmbtax.AddItem "12.5"End Sub

Private Sub cmdback_Click()

End Sub

Private Sub cmdbnd_Click()pqr = 1Load brandbrand.ShowEnd Sub

Private Sub cmdcancel_Click()Call cancelsave(True)End Sub

Private Sub cmdmat_Click()pqr = 2Load brandbrand.ShowEnd Sub

Private Sub cmdsub_Click()pqr = 1Load categorycategory.ShowEnd Sub

Private Sub cmdsup_Click()pqr = 1Load supplierssuppliers.ShowEnd Sub

Private Sub Form_Load()Call conestablishIf pqr = 1 Then' addedit (False)

Dept. of B.C.A. Chinmaya Vidyapeet

Page 79: new

Textiles Management System

Else Call cancelsave(True) Call addedit(True)End IfCall titleimage(item)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled33.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub cmbbrand_GotFocus()Call comshow(0, 1, 0)cmbbrand.clearr.Open "select distinct bname from brand where category ='" & cmbsub.Text & "';", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbbrand.AddItem r!bname r.MoveNextWendr.CloseEnd Sub

Private Sub cmbcat_GotFocus()cmbcat.clearcmbcat.AddItem "mens"cmbcat.AddItem "ladies"cmbcat.AddItem "kids"cmbcat.AddItem "others"End Sub

Private Sub cmbsub_GotFocus()Call comshow(1, 0, 0)cmbsub.clearr.Open "select subcat from category where catname='" & cmbcat.Text & "';", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbsub.AddItem r!subcat r.MoveNextWendr.CloseEnd Sub

Private Sub cmbsup_GotFocus()

Dept. of B.C.A. Chinmaya Vidyapeet

Page 80: new

Textiles Management System

Call comshow(0, 0, 1)cmbsup.clearr.Open "select name from supplier", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbsup.AddItem r!Name r.MoveNextWendr.CloseEnd Sub

Private Sub cmbsup_LostFocus()cmdsup.Visible = FalseEnd Sub

Private Sub cmdadd_Click()Dim n As String, m As Integerflag = 1Call addedit(True)Call cancelsave(False)r.Open "select id from item", con, adOpenDynamic, adLockOptimisticIf r.EOF = True And r.BOF = True Then n = "I001"Else r.MoveLast n = r!id n = Mid(n, 2, 3) m = CInt(n) + 1 If m > 99 Then n = "I" & CStr(m) ElseIf m > 9 Then n = "I0" & CStr(m) Else n = "I00" & CStr(m) End IfEnd Iftxtid.Text = nr.CloseEnd Sub

Private Sub cmdedit_Click()Call addedit(False)flag = 2Call cancelsave(False)MsgBox "select id of item tobe edited"

Dept. of B.C.A. Chinmaya Vidyapeet

Page 81: new

Textiles Management System

cmdcancel.SetFocusEnd Sub

Private Sub Cmbid_Change()Call fill(cmbid.Text)End Sub

Private Sub cmddele_Click()Call cancelsave(False)cmdsave.Enabled = FalseMsgBox "select id of item to be deleted from combo"Call addedit(False)del = 1cmdcancel.SetFocusEnd Sub

Private Sub Cmbid_Click()Call fill(cmbid.Text)If del = 1 Then Dim i As Integer i = MsgBox("are u sure u want to delete this record?", vbCritical + vbYesNo, "confirm delete") If i = vbYes Then Call cancelsave(True) Set cmd = New ADODB.Command cmd.ActiveConnection = con str = "delete from item where id='" & cmbid.Text & "';" cmd.CommandText = str cmd.Execute MsgBox "record deleted" Call clear End If del = 0 End IfEnd Sub

Private Sub cmdsave_Click()Dim p As String, q As String, s As StringSet cmd = New ADODB.Commandcmd.ActiveConnection = conr.Open "select catid from category where catname='" & cmbcat.Text & "' and subcat='" & cmbsub.Text & "';" p = r!catid r.Close

Dept. of B.C.A. Chinmaya Vidyapeet

Page 82: new

Textiles Management System

r.Open "select id from brand where bname='" & cmbbrand.Text & "' and material='" & txtmat.Text & "';" q = r!id r.CloseIf flag = 1 Then str = "insert into item values('" & txtid.Text & "','" & p & "','" & q & "'," & txtsize.Text & "," & cmbtax.Text & ");" '& "," & txtuprice.Text & ",'" & s & "' cmd.CommandText = str cmd.Execute str = "insert into stock values('" & txtid.Text & "'," & 0 & "," & txtmin.Text & ");" cmd.CommandText = str cmd.Execute MsgBox "record entered successfully" Call cancelsave(True) If pqr = 1 Then pqr = 0 Unload Me Load items items.Show End IfElseIf flag = 2 Then str = "update item set id='" & cmbid.Text & "',catid='" & p & "',brandid='" & q & "',size=" & Val(txtsize.Text) & ",tax=" & 12 & " where id='" & cmbid.Text & "';" '",unitprice=" & txtuprice.Text & ",supplierid='" & s & cmd.CommandText = str cmd.Execute str = "update stock set min=" & txtmin.Text & "where id='" & cmbid.Text & "';" cmd.CommandText = str cmd.Execute MsgBox "record updated"End IfEnd Sub

Public Sub comshow(a As Integer, b As Integer, d As Integer)cmdsub.Visible = acmdbnd.Visible = bcmdsup.Visible = dEnd Sub

Public Sub clean(t As Integer)Dim ctrl As Control For Each ctrl In Me.Controls

Dept. of B.C.A. Chinmaya Vidyapeet

Page 83: new

Textiles Management System

If ctrl.TabIndex > t Then If TypeOf ctrl Is TextBox Then ctrl.Text = "" ElseIf TypeOf ctrl Is ComboBox Then ctrl.clear End If End If Next ctrl End Sub

Private Sub txtmat_Change()Call clean(txtmat.TabIndex)End Sub

Private Sub txtmin_Change()Call clean(txtmin.TabIndex)End Sub

Private Sub txtsize_Change()Call clean(txtsize.TabIndex)End Sub

Private Sub txtuprice_Change()Call clean(txtuprice.TabIndex)End Sub

ItemsDim r As New ADODB.Recordset, rs As New ADODB.RecordsetDim cmd As New ADODB.Command

Private Sub cmdsave_Click()cmd.ActiveConnection = concmd.CommandText = "insert into pitem values('" & txtsup.Text & "','" & cmbid.Text & "'," & txtuprice.Text & ");"cmd.Executepurchase_order.cmbitem.Text = cmbid.TextCall idetail(cmbid.Text)purchase_order.txtidet.Text = detailsitempurchase_order.txtrate.Text = txtuprice.TextUnload itemspurchase_order.txtqty.SetFocusEnd Sub

Private Sub Form_Load()

Dept. of B.C.A. Chinmaya Vidyapeet

Page 84: new

Textiles Management System

Call conestablishtxtsup.Text = purchase_order.cmbsupname.TextCall titleimage(items)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled11.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub cmdextend_Click()Load itempqr = 1Unload Meitem.ShowEnd Sub

Private Sub cmbid_GotFocus()cmbid.clearr.Open "select id from item where id not in (select itemid from pitem where supid ='" & txtsup.Text & "');", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbid.AddItem r!id r.MoveNextWendr.CloseEnd Sub

Private Sub Cmbid_Click()Call idetail(cmbid.Text)'r.Open "select * from item where id='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimistic 'txtdet.Text = r!catid & vbNewLine & r!brandid & vbNewLine & r!Size 'call itemdetails(cmbid.Text) 'txtdet.Text = detailsitem'rs.Open "select * from category where catid='" & r!catid & "';", con, adOpenDynamic, adLockOptimistic'cat = rs!catname'subcat = rs!subcat'rs.Close'rs.Open "select * from brand where id='" & r!brandid & "';", con, adOpenDynamic, adLockOptimistic'bnd = rs!bname'mat = rs!material'rs.Close

Dept. of B.C.A. Chinmaya Vidyapeet

Page 85: new

Textiles Management System

'detailsitem = cat & " " & bnd & " " & mat & "" & subcat'r.Closetxtdet.Text = detailsitemEnd Sub

Login

Dim rs As New ADODB.Recordset

Private Sub Form_Load()Call conestablishlogin.Picture = LoadPicture("D:\PGMS\MINI PROJECT\resources\login1[1].jpg")'login.PaintPicture login.Picture, 0, 0, login.ScaleWidth, login.ScaleHeight'login.Picture = Picture1.ImageEnd Sub

Private Sub cmdlog_Click()rs.Open "select *from login where username='" & txtuser.Text & "' and password='" & txtpass.Text & "';", con, adOpenDynamic, adLockOptimisticIf rs.EOF Then MsgBox "incorrect login!!plz try again", vbOKOnly + vbCritical, "invalid login" txtpass.SetFocus txtpass.Text = ""Else welcome.Show Unload MeEnd Ifrs.CloseEnd Sub

Private Sub cmdexit_Click() Unload MeEnd Sub

MDI

Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)Dim frm As FormDim count As Integercount = 0For Each frm In Forms If frm.Name <> Me.Name Then If frm.Visible And frm.MDIChild Then

Dept. of B.C.A. Chinmaya Vidyapeet

Page 86: new

Textiles Management System

count = count + 1 End If End IfNext frmIf count > 0 Then i = MsgBox("there are" & count & "forms being opened.Are u sure you want to exit?", vbCritical + vbYesNo, "confirm exit") If i = vbNo Then Cancel = 1 End IfEnd IfEnd Sub

Private Sub mnubill_Click(Index As Integer)bill.ShowEnd Sub

Private Sub mnubnd_Click()brand.ShowEnd Sub

Private Sub mnucat_Click()category.ShowEnd Sub

Private Sub mnudamage_Click()DAMAGE.ShowEnd Sub

Private Sub mnudelevery_Click()delevery.ShowEnd Sub

Private Sub mnudept_Click()depart.ShowEnd Sub

Private Sub mnuemployee_Click()employee.ShowEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 87: new

Textiles Management System

Private Sub mnuitem_Click()item.ShowEnd Sub

Private Sub mnulogoff_Click()Dim i As Integeri = MsgBox("are u sure u want to log off?", vbYesNo, "confirm log off")If i = vbYes Then Dim frm As Form For Each frm In Forms If frm.Name <> MDIForm1.Name Then If frm.MDIChild = True Then Unload frm End If End If Next frm login.Show Unload MDIForm1End IfEnd Sub

Private Sub mnuporder_Click()purchase_order.ShowEnd Sub

Private Sub mnupreturn_Click()pur_return.ShowEnd Sub

Private Sub mnupurchase_Click()purchase.ShowEnd Sub

Private Sub mnurate_Click()rate.ShowEnd Sub

Private Sub mnusalesreturn_Click()salesreturn.ShowEnd Sub

Private Sub mnustock_Click()DataEnvironment1.Command1

Dept. of B.C.A. Chinmaya Vidyapeet

Page 88: new

Textiles Management System

DataReport1.ShowEnd Sub

Private Sub mnusup_Click()suppliers.ShowEnd Sub

Private Sub mnuuser_Click()USER.ShowEnd Sub

Pur_return

Dim r As New ADODB.RecordsetDim cnt As IntegerDim cmd As New ADODB.CommandPrivate Sub Cmbid_Click()Call idetail(cmbid.Text)txtidet.Text = detailsitemEnd Sub

Private Sub cmbid_GotFocus()If cmbsup.Text = "" Then MsgBox "specify supplier id" cmbsup.SetFocusElse Frame1.Enabled = False cmbid.clear r.Open "select itemid from pitem where supid='" & cmbsup.Text & "';", con, adOpenDynamic, adLockOptimistic While Not r.EOF cmbid.AddItem r!itemid r.MoveNext Wend r.CloseEnd IfEnd Sub

Private Sub cmbpbill_Click()r.Open "select rate from purchase where pbillno='" & cmbpbill.Text & "' and itemid='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimisticIf Not r.EOF Then txtuprice.Text = r!rateEnd If

Dept. of B.C.A. Chinmaya Vidyapeet

Page 89: new

Textiles Management System

r.CloseEnd Sub

Private Sub cmbpbill_GotFocus()If cmbid.Text = "" Then MsgBox "specify item id first" cmbid.SetFocusElsecmbpbill.clearr.Open "select distinct pbillno from purchase where itemid='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbpbill.AddItem r!pbillno r.MoveNextWendr.CloseEnd IfEnd Sub

Private Sub cmbsup_Click()r.Open "select address,phno from supplier where name='" & cmbsup.Text & "';", con, adOpenDynamic, adLockOptimistictxtphno.Text = r!phnotxtaddr.Text = r!addressr.CloseEnd Sub

Private Sub cmbsup_GotFocus()cmbsup.clearr.Open "select distinct supid from pitem where itemid in(select id from stock where cur>0);", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbsup.AddItem r!supid r.MoveNextWendr.CloseEnd Sub

Private Sub cmdadd_Click()Dim n As String, a As String, m As Integerr.Open "select * from preturn", con, adOpenDynamic, adLockOptimisticIf r.EOF = True And r.BOF = True Then n = "DBT001"Else

Dept. of B.C.A. Chinmaya Vidyapeet

Page 90: new

Textiles Management System

r.MoveLast n = r!dnoteno a = Mid(n, 4, 3) m = CInt(a) + 1 If m > 99 Then n = "DBT" & CStr(m) ElseIf m > 9 Then n = "DBT0" & CStr(m) Else n = "DBT00" & CStr(m) End IfEnd Ifr.Closetxtdnote.Text = ntxtrdate.Text = DateCall setgridEnd Sub

Private Sub cmdsave_Click()cmd.ActiveConnection = concmd.CommandText = "insert into preturn values('" & txtdnote.Text & "','" & cmbpbill.Text & "','" & cmbid.Text & "'," & txtrqty.Text & ",'" & txtrdate.Text & "');"cmd.Executecmd.CommandText = "update stock set cur=cur-" & txtrqty.Text & " where id='" & cmbid.Text & "';"cmd.ExecuteCall fillgridEnd Sub

Private Sub Form_Load()Call conestablishCall titleimage(pur_return)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled11.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub txtrqty_LostFocus()'if' MsgBox "invalid entry for quantity"' txtrqty.Text = ""' txtrqty.SetFocus'Else

Dept. of B.C.A. Chinmaya Vidyapeet

Page 91: new

Textiles Management System

txtamnt.Text = txtrqty.Text * txtuprice.Text'End IfEnd Sub

Public Sub setgrid()MSFG1.Visible = TrueMSFG1.TextMatrix(0, 0) = "sl no:"MSFG1.TextMatrix(0, 1) = "item id"MSFG1.TextMatrix(0, 2) = "item details"MSFG1.TextMatrix(0, 3) = "rate"MSFG1.TextMatrix(0, 4) = "bill no"MSFG1.TextMatrix(0, 5) = "ret_qty"MSFG1.TextMatrix(0, 6) = "amount"MSFG1.ColWidth(0) = 600MSFG1.ColWidth(1) = 900MSFG1.ColWidth(2) = 2000MSFG1.ColWidth(3) = 900MSFG1.ColWidth(4) = 1000MSFG1.ColWidth(5) = 900MSFG1.ColWidth(6) = 1000cnt = 0End Sub

Public Sub fillgrid()cnt = cnt + 1MSFG1.Rows = MSFG1.Rows + 1MSFG1.TextMatrix(cnt, 0) = cntMSFG1.TextMatrix(cnt, 1) = cmbid.TextMSFG1.TextMatrix(cnt, 2) = txtidet.TextMSFG1.TextMatrix(cnt, 3) = txtuprice.TextMSFG1.TextMatrix(cnt, 4) = cmbpbill.TextMSFG1.TextMatrix(cnt, 5) = txtrqty.TextMSFG1.TextMatrix(cnt, 6) = txtamnt.TextEnd Sub

Purchase

Dim cmd As ADODB.CommandDim ctrl As ControlDim rsd As New ADODB.Recordset, r As New ADODB.RecordsetDim flag As Integer, str As String, cnt As Integer, p As String, f As Integer

Public Sub reset(a As Boolean)cmdcomplete.Enabled = a

Dept. of B.C.A. Chinmaya Vidyapeet

Page 92: new

Textiles Management System

cmdok.Enabled = acmdpur.Enabled = Not aEnd Sub

Public Sub textlock()For Each ctrl In Me.Controls If TypeOf ctrl Is TextBox Then ctrl.Locked = True End IfNext ctrlEnd Sub

'Private Sub cmbid_LostFocus()'If cmbid.Locked = True Then' cmbid.Text = p'End If'End Sub

Private Sub cmbsupname_DropDown()txtaddr.Text = ""txtphno.Text = ""txttin.Text = ""End Sub

Private Sub cmbsup_Click()r.Open "select * from supplier where name='" & cmbsup.Text & "';", con, adOpenDynamic, adLockOptimisticIf Not r.EOF Then txtaddr.Text = r!address txtphno.Text = r!phno txttin.Text = r!tinEnd Ifr.CloseFrame1.Enabled = TrueEnd Sub

Private Sub cmbsup_GotFocus()cmbsup.clearr.Open "select distinct supid from psupp", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbsup.AddItem r!supid r.MoveNextWendr.Close

Dept. of B.C.A. Chinmaya Vidyapeet

Page 93: new

Textiles Management System

End Sub

Private Sub cmdcomplete_Click()flag = 1Call reset(False)Call cleartxtqty.Locked = TrueCall frmEnd Sub

Private Sub cmdpur_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)MsgBox "select a purchase order id"End Sub

Private Sub Command1_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = constr = "delete from purchase"cmd.CommandText = strcmd.ExecuteEnd Sub

Private Sub Form_Load()Call conestablishCall frmMSFG1.Visible = FalseCall reset(False)'Call textlockCall titleimage(purchase)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled22.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub cmbid_GotFocus()If cmbsup.Text = "" Then MsgBox "specify the supplier first" Frame1.Enabled = FalseElsecmbid.clearr.Open "select orderid from psupp where supid='" & cmbsup.Text & "';", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF

Dept. of B.C.A. Chinmaya Vidyapeet

Page 94: new

Textiles Management System

cmbid.AddItem r!orderid r.MoveNextWendr.CloseEnd IfEnd Sub

Private Sub cmdpur_Click()txtdate.Text = DateFrame2.Enabled = TrueFrame5.Enabled = TrueCall reset(True)End Sub

Private Sub MSFG1_Click()f = MSFG1.RowIf f = 0 Then MsgBox "not possible "Else txtitem.Text = MSFG1.TextMatrix(f, 1) txtidet.Text = MSFG1.TextMatrix(f, 2) txtqty.Text = MSFG1.TextMatrix(f, 3) - MSFG1.TextMatrix(f, 4) txtrate.Text = MSFG1.TextMatrix(f, 5) cmdok.Enabled = True txtqty.Locked = False' cmbid.Locked = TrueEnd IfEnd Sub

Private Sub cmdok_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = constr = "insert into purchase values('" & txtpbillno.Text & "','" & cmbid.Text & "','" & txtitem.Text & "'," & txtrate.Text & "," & txtqty.Text & ",'" & txtdate.Text & "');"cmd.CommandText = strcmd.ExecuteCall stock(txtitem.Text, Int(txtqty.Text))If Int(txtqty.Text) + MSFG1.TextMatrix(f, 4) = MSFG1.TextMatrix(f, 3) Then st = "delete from porder where orderid='" & cmbid.Text & "' and itemid='" & txtitem.Text & "';" cmd.CommandText = st cmd.Execute r.Open "select * from porder where orderid='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimistic If r.EOF = True Then

Dept. of B.C.A. Chinmaya Vidyapeet

Page 95: new

Textiles Management System

st = "delete from psupp where orderid='" & cmbid.Text & "';" cmd.CommandText = st cmd.Execute End If r.CloseEnd IfMsgBox "record entered successfully"r.Open "select orderid from psupp where supid='" & cmbsup.Text & "';", con, adOpenDynamic, adLockOptimisticIf r.EOF Then Call cmdcomplete_ClickEnd Ifr.Closecmdok.Enabled = Falsetxtqty.Locked = TrueCall clearCall flexEnd Sub

Public Sub clear()If flag = 1 Then txtaddr.Text = "" txtodate.Text = "" txtphno.Text = "" txtdate.Text = "" txttin.Text = "" MSFG1.clear MSFG1.Rows = 1 cmbid.clear cmbsup.clear txtpbillno.Text = "" Else ' cmbid.Text = pEnd Iftxtidet.Text = ""txtqty.Text = ""txtrate.Text = ""txtitem.Text = ""End Sub

Private Sub txtqty_LostFocus()If Int(txtqty.Text) > MSFG1.TextMatrix(f, 3) - MSFG1.TextMatrix(f, 4) Then MsgBox "invalid entry for quantity" txtqty.Text = ""

Dept. of B.C.A. Chinmaya Vidyapeet

Page 96: new

Textiles Management System

txtqty.SetFocusEnd IfEnd Sub

Public Sub flex()MSFG1.clearMSFG1.Enabled = TrueMSFG1.TextMatrix(0, 0) = "sl no"MSFG1.TextMatrix(0, 1) = "item code"MSFG1.TextMatrix(0, 2) = "item description"MSFG1.TextMatrix(0, 3) = "ordered qty"MSFG1.TextMatrix(0, 4) = "received qty"MSFG1.TextMatrix(0, 5) = "unit price"rsd.Open "select * from porder where orderid='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimisticcnt = 0MSFG1.Rows = 1While Not rsd.EOF cnt = cnt + 1 MSFG1.Rows = MSFG1.Rows + 1 MSFG1.TextMatrix(cnt, 0) = cnt MSFG1.TextMatrix(cnt, 1) = rsd!itemid Call idetail(rsd!itemid) MSFG1.TextMatrix(cnt, 2) = detailsitem MSFG1.TextMatrix(cnt, 3) = rsd!qty r.Open "select qty from purchase where itemid='" & rsd!itemid & "' and orderid='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimistic g = 0 While Not r.EOF g = g + r!qty r.MoveNext Wend MSFG1.TextMatrix(cnt, 4) = g r.Close r.Open "select rate from porder where orderid='" & cmbid.Text & "' and itemid='" & MSFG1.TextMatrix(cnt, 1) & "';", con, adOpenDynamic, adLockOptimistic If Not r.EOF Then MSFG1.TextMatrix(cnt, 5) = r!rate End If r.Close rsd.MoveNextWendrsd.CloseEnd Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 97: new

Textiles Management System

Public Sub stock(s As String, n As Integer)r.Open "select cur from stock where id='" & s & "';", con, adOpenDynamic, adLockOptimisticDim str As Stringstr = "update stock set cur=" & r!cur + n & " where id='" & s & "';"cmd.ActiveConnection = concmd.CommandText = strcmd.Executer.CloseEnd SubPrivate Sub Cmbid_Click()'p = cmbid.TextDim a As String, d As DateMSFG1.Visible = Truersd.Open "select ordate from psupp where orderid='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimistictxtodate.Text = rsd!ordatersd.CloseCall flexFrame3.Enabled = TrueEnd Sub

Public Sub frm()For Each ctrl In Me.Controls If TypeOf ctrl Is MSFlexGrid Or TypeOf ctrl Is Frame Then If Not ctrl.Name = Frame4.Name Then ctrl.Enabled = False End If End IfNext ctrlEnd Sub

Rate

Dim cmd As ADODB.CommandDim r As New ADODB.RecordsetDim flag As IntegerDim str As String

Public Sub saverate(a As Boolean)cmdsave.Enabled = Not acmdset.Enabled = acmdedit.Enabled = a

Dept. of B.C.A. Chinmaya Vidyapeet

Page 98: new

Textiles Management System

Frame2.Enabled = Not atxtdet.Locked = Truetxtuprice.Locked = TrueEnd Sub

Public Sub clear()txtdet.Text = ""txtrate.Text = ""txtuprice.Text = ""cmbid.clearEnd Sub

Private Sub cmdcancel_Click()cmdedit.Enabled = Truecmdsave.Enabled = Falsecmdset.Enabled = TrueCall clearEnd Sub

Private Sub Form_Load()Call conestablishCall saverate(True)Call titleimage(rate)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled11.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub cmdset_Click()flag = 1Call clearCall saverate(False)r.Open "select * from item where id not in(select id from rate);", con, adOpenDynamic, adLockOptimisticcmbid.clearWhile Not r.EOF cmbid.AddItem r!id r.MoveNextWendr.CloseEnd Sub

Private Sub cmdedit_Click()

Dept. of B.C.A. Chinmaya Vidyapeet

Page 99: new

Textiles Management System

flag = 2Call saverate(False)r.Open "select * from item where id in(select id from rate);", con, adOpenDynamic, adLockOptimisticcmbid.clearWhile Not r.EOF cmbid.AddItem r!id r.MoveNextWendr.CloseEnd Sub

Private Sub cmdsave_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = conIf flag = 1 Then str = "insert into rate values('" & cmbid.Text & "'," & txtrate.Text & ");" cmd.CommandText = str cmd.ExecuteElseIf flag = 2 Then str = "update rate set rate=" & txtrate.Text & " where id='" & cmbid.Text & "';" cmd.CommandText = str cmd.ExecuteEnd IfCall saverate(True)End Sub

Private Sub Cmbid_Change()Call idetail(cmbid.Text)txtdet.Text = detailsitemtxtuprice.Text = unitEnd Sub

Private Sub Cmbid_Click()Set rs = New ADODB.RecordsetSet rsd = New ADODB.RecordsetCall idetail(cmbid.Text)txtdet.Text = detailsitemtxtuprice.Text = unitIf flag = 2 Then r.Open "select rate from rate where id='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimistic txtrate.Text = r!rate r.Close

Dept. of B.C.A. Chinmaya Vidyapeet

Page 100: new

Textiles Management System

End IfEnd Sub

Sales return

Dim r As New ADODB.Recordset, rs As New ADODB.RecordsetDim cnt As IntegerDim cmd As New ADODB.Command

Public Sub setgrid()MSFG1.Visible = TrueMSFG1.TextMatrix(0, 0) = "sl no:"MSFG1.TextMatrix(0, 1) = "item id"MSFG1.TextMatrix(0, 2) = "item details"MSFG1.TextMatrix(0, 3) = "rate"MSFG1.TextMatrix(0, 4) = "qty"MSFG1.TextMatrix(0, 5) = "discount %"MSFG1.TextMatrix(0, 6) = "amount"MSFG1.ColWidth(0) = 600MSFG1.ColWidth(1) = 900MSFG1.ColWidth(2) = 2000MSFG1.ColWidth(3) = 900MSFG1.ColWidth(4) = 1000MSFG1.ColWidth(5) = 900MSFG1.ColWidth(6) = 1000cnt = 0End Sub

Public Sub fillgrid(s As String)Call setgridr.Open "select * from bill where billno='" & s & "';", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cnt = cnt + 1 MSFG1.Rows = MSFG1.Rows + 1 MSFG1.TextMatrix(cnt, 0) = cnt MSFG1.TextMatrix(cnt, 1) = r!itemid Call idetail(r!itemid) rs.Open "select rate from rate where id='" & r!itemid & "';", con, adOpenDynamic, adLockOptimistic MSFG1.TextMatrix(cnt, 2) = detailsitem MSFG1.TextMatrix(cnt, 3) = rs!rate rs.Close MSFG1.TextMatrix(cnt, 4) = r!qty MSFG1.TextMatrix(cnt, 5) = r!discount

Dept. of B.C.A. Chinmaya Vidyapeet

Page 101: new

Textiles Management System

MSFG1.TextMatrix(cnt, 6) = MSFG1.TextMatrix(cnt, 3) * MSFG1.TextMatrix(cnt, 4) r.MoveNextWendr.CloseEnd Sub

Private Sub cmbbill_Click()r.Open "select date from sales where billno='" & cmbbill.Text & "';", con, adOpenDynamic, adLockOptimistictxtbdate.Text = r!Dater.CloseCall fillgrid(cmbbill.Text)Frame4.Enabled = TrueEnd Sub

Private Sub cmbbill_GotFocus()cmbbill.clearDim d As Dater.Open "select billno,date from sales", con, adOpenDynamic, adLockOptimisticWhile Not r.EOFd = r!DateIf Date - d <= 7 Then cmbbill.AddItem r!billnoEnd Ifr.MoveNextWendr.CloseIf cmbbill.ListCount = 0 Then MsgBox "no bill exist for sales return"End IfEnd Sub

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()Call conestablishCall titleimage(salesreturn)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled11.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 102: new

Textiles Management System

Private Sub cmdadd_Click()Dim n As String, a As String, m As Integerr.Open "select * from salesreturn", con, adOpenDynamic, adLockOptimisticIf r.EOF = True And r.BOF = True Then n = "CRT001"Else r.MoveLast n = r!cnoteno a = Mid(n, 4, 3) m = CInt(a) + 1 If m > 99 Then n = "CRT" & CStr(m) ElseIf m > 9 Then n = "CRT0" & CStr(m) Else n = "CRT00" & CStr(m) End IfEnd Ifr.Closetxtcnote.Text = ntxtrdate.Text = DateCall setgridEnd Sub

Private Sub cmdsave_Click()cmd.ActiveConnection = concmd.CommandText = "insert into salesreturn values('" & txtcnote.Text & "'," & cmbbill.Text & ",'" & txtid.Text & "','" & txtrqty.Text & "','" & txtrdate.Text & "');"Text1.Text = cmd.CommandTextcmd.Executecmd.CommandText = "update stock set cur=cur+" & txtqty.Text & " where id='" & txtid.Text & "';"cmd.ExecuteCall fillgrid(cmbbill.Text)End Sub

Private Sub MSFG1_Click()f = MSFG1.RowIf f = 0 Then MsgBox "not possible "Else If Not MSFG1.TextMatrix(f, 5) = "" Then txtid.Text = MSFG1.TextMatrix(f, 1)

Dept. of B.C.A. Chinmaya Vidyapeet

Page 103: new

Textiles Management System

txtidet.Text = MSFG1.TextMatrix(f, 2) txtuprice.Text = MSFG1.TextMatrix(f, 3) txtqty.Text = MSFG1.TextMatrix(f, 4) Else MsgBox "no sales return allowed for this item" End IfEnd IfEnd Sub

Private Sub txtrqty_LostFocus()'if' MsgBox "invalid entry for quantity"' txtrqty.Text = ""' txtrqty.SetFocus'Else txtamnt.Text = txtrqty.Text * txtuprice.Text'End IfEnd Sub

Private Sub q_Change()

End Sub

Supplier

Dim cmd As ADODB.CommandDim r As New ADODB.Recordset, rsd As ADODB.RecordsetDim flag As IntegerDim str As String

Public Sub cancelsave()txtid.Text = ""txtname.Text = ""txtaddr.Text = ""txtphno.Text = ""txtemail.Text = ""txtfax.Text = ""txtweb.Text = ""txtcst.Text = ""txttin.Text = ""cmdadd.Enabled = Truecmdcancel.Enabled = Falsecmdexit.Enabled = True

Dept. of B.C.A. Chinmaya Vidyapeet

Page 104: new

Textiles Management System

cmdsave.Enabled = Falsecmdupdate.Enabled = TrueFrame2.Enabled = Falsecmbid.clearEnd Sub

Public Sub addup(a As Boolean)cmdexit.Enabled = Falsecmdsave.Enabled = Truecmdcancel.Enabled = TrueFrame2.Enabled = Truecmdadd.Enabled = Falsecmdupdate.Enabled = Falsetxtid.Visible = acmbid.Visible = Not aEnd Sub

Public Sub fill()txtid.Text = r!supidtxtname.Text = r!Nametxtaddr.Text = r!addresstxtphno.Text = r!phnotxtemail.Text = r!emailtxtfax.Text = r!faxtxtweb.Text = r!webtxttin.Text = r!tintxtcst.Text = r!cstEnd Sub

Private Sub cmdview_Click()

End Sub

Private Sub Command1_Click()str = "delete from pitem"Set cmd = New ADODB.Commandcmd.ActiveConnection = concmd.CommandText = strcmd.ExecuteMsgBox "ll"End Sub

Private Sub Form_Load()Call conestablish

Dept. of B.C.A. Chinmaya Vidyapeet

Page 105: new

Textiles Management System

Frame2.Enabled = FalseCall cancelsaveCall addedit(True)If pqr = 1 Then Call cmdadd_ClickEnd IfCall titleimage(suppliers)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled66.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub cmdadd_Click()Dim n As String, a As String, m As Integerflag = 1Call addedit(True)Call addup(True)r.Open "select * from supplier", con, adOpenDynamic, adLockOptimisticIf r.EOF = True And r.BOF = True Then n = "v001"Else r.MoveLast n = r!supid a = Mid(n, 2, 3) m = CInt(a) + 1 If m > 99 Then n = "v" & CStr(m) ElseIf m > 9 Then n = "v0" & CStr(m) Else n = "v00" & CStr(m) End IfEnd Iftxtid.Text = nr.CloseEnd Sub

Private Sub cmdupdate_Click() flag = 2 Call addup(False) r.Open "select * from supplier ", con, adOpenDynamic, adLockOptimistic If r.EOF = True And r.BOF = True Then MsgBox "no record to update!"

Dept. of B.C.A. Chinmaya Vidyapeet

Page 106: new

Textiles Management System

cmdupdate.Enabled = False End If r.CloseEnd Sub

Private Sub cmbid_GotFocus()cmbid.clearr.Open "select supid from supplier", con, adOpenDynamic, adLockOptimisticWhile Not r.EOF cmbid.AddItem r!supid r.MoveNextWendr.CloseEnd Sub

Private Sub Cmbid_Click()r.Open "select * from supplier where supid='" & cmbid.Text & "';", con, adOpenDynamic, adLockOptimisticCall fillr.CloseEnd Sub

Private Sub cmdcancel_Click()Call cancelsaveEnd Sub

Private Sub cmdexit_Click()Unload MeEnd Sub

Private Sub cmdsave_Click()Set cmd = New ADODB.Commandcmd.ActiveConnection = conIf flag = 1 Then str = "insert into supplier values('" & txtid.Text & "','" & txtname.Text & "','" & txtaddr.Text & "'," & txtphno.Text & ",'" & txtfax.Text & "','" & txtemail.Text & "','" & txtweb.Text & "'," & txttin.Text & ",'" & txtcst.Text & "');" cmd.CommandText = str cmd.Execute MsgBox "record entered successfully"ElseIf flag = 2 Then str = "update supplier set name='" & txtname.Text & "',address='" & txtaddr.Text & "',phno=" & txtphno.Text & ",fax='" & txtfax.Text & "',email='" & txtemail.Text & "',web='" & txtweb.Text & "',tin=" & txttin.Text & ",cst=" & txtcst.Text & " where supid='" & cmbid.Text & "';"

Dept. of B.C.A. Chinmaya Vidyapeet

Page 107: new

Textiles Management System

cmd.CommandText = str cmd.Execute MsgBox "record updated"End IfIf pqr = 1 Then purchase_order.cmbsupname.Text = txtname.Text purchase_order.txtaddr.Text = txtaddr.Text purchase_order.txtphno.Text = txtphno.Text purchase_order.txttin.Text = txttin.Text Unload suppliers purchase_order.Show pqr = 0ElseCall cancelsaveEnd IfEnd Sub

Public Sub addedit(a As Boolean)txtid.Visible = acmbid.Visible = Not aEnd Sub

User

Dim flag As Integer, del As IntegerDim cmd As New ADODB.Command, cm As ADODB.CommandDim str As StringDim rs As New ADODB.Recordset

Private Sub cmbuser_Click()If del = 1 Then Dim i As Integer i = MsgBox("are u sure u want to delete this record?", vbCritical + vbYesNo, "confirm delete") If i = vbYes Then Call cancelsave(True) Set cmd = New ADODB.Command cmd.CommandText = "delete from login where username='" & cmbuser.Text & "';" cmd.ActiveConnection = con cmd.Execute MsgBox "data deleted succesfully", vbInformation, "delete successfull" Call clear End If del = 0Else

Dept. of B.C.A. Chinmaya Vidyapeet

Page 108: new

Textiles Management System

txtold.SetFocusEnd IfEnd Sub

Private Sub cmbuser_GotFocus()rs.Open "select * from login", con, adOpenDynamic, adLockOptimisticWhile Not rs.EOF cmbuser.AddItem rs!UserName rs.MoveNextWendrs.CloseEnd Sub

Private Sub Form_Load()Call conestablishCall cancelsave(True)Call titleimage(USER)Picture2.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\lll\untitled66.bmp")Picture2.PaintPicture Picture2.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeightPicture2.Picture = Picture2.ImageEnd Sub

Private Sub cmdadd_Click()Call cancelsave(False)Call addedit(True)txtuser.SetFocusflag = 1End Sub

Private Sub cmdchange_Click()rs.Open "select * from login", con, adOpenDynamic, adLockOptimisticIf Not rs.EOF Then Call addedit(False) Call cancelsave(False) flag = 2Else MsgBox "no user to edit", vbInformation, "no user" Call cancelsave(True)End Ifrs.CloseEnd Sub

Private Sub cmdsave_Click()

Dept. of B.C.A. Chinmaya Vidyapeet

Page 109: new

Textiles Management System

If txtnew.Text = txtcon.Text Then Dim cm As New ADODB.Command If flag = 2 Then rs.Open "select * from login where username='" & cmbuser.Text & "';", con, adOpenDynamic, adLockOptimistic If rs!Password <> txtold.Text Then MsgBox "old password is incorrect!!.try again.", vbOKOnly, "incorrect password" txtold.Text = "" Else cm.CommandText = "update login set username='" & cmbuser.Text & "',password='" & txtnew.Text & "' where username='" & cmbuser.Text & "';" cm.ActiveConnection = con Text1.Text = cm.CommandText 'str cm.Execute MsgBox "password changed successfully!!" End If rs.Close ElseIf flag = 1 Then rs.Open "select * from login where username='" & txtuser.Text & "';", con, adOpenDynamic, adLockOptimistic If Not rs.EOF Then MsgBox "username not available!! try another name" Call clear txtuser.SetFocus Else s = "insert into login values('" & txtuser.Text & "','" & txtnew.Text & "');" cmd.CommandText = s cmd.ActiveConnection = con cmd.Execute MsgBox "user created successfully!!" End If rs.Close End IfElse MsgBox "password confirmation failed!!,try again.", vbCritical + vbOKOnly, "confirmation failed" txtnew.Text = "" txtcon.Text = "" txtnew.SetFocusEnd IfCall cancelsave(True)End Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 110: new

Textiles Management System

Private Sub cmddele_Click()Call cancelsave(False)cmdsave.Enabled = FalseMsgBox "select username to be deleted from combo box"Call addedit(False)cmdcancel.SetFocusdel = 1End Sub

Private Sub cmdcancel_Click()Call cancelsave(True)End Sub

Public Sub cancelsave(a As Boolean)Frame1.Enabled = Not acmdadd.Enabled = acmdchange.Enabled = acmddele.Enabled = acmdcancel.Enabled = Not acmdsave.Enabled = Not atxtuser.Visible = acmbuser.Visible = Not aCall cleardel = 0End Sub

Public Sub addedit(a As Boolean)txtuser.Visible = aLabel4.Visible = Not atxtold.Visible = Not acmbuser.Visible = Not aEnd Sub

Public Sub clear()txtnew.Text = ""txtcon.Text = ""txtuser.Text = ""cmbuser.cleartxtold.Text = ""End Sub

Welcome

Dim i As Integer

Dept. of B.C.A. Chinmaya Vidyapeet

Page 111: new

Textiles Management System

Dim pgrs As Integer

Private Sub Form_Load()Timer1.Enabled = TrueTimer2.Enabled = TrueTimer2.Interval = 1lblstatus.Caption = " Please wait: Establishing connection to the database"End Sub

Private Sub timer1_timer()If Timer2.Enabled = False Then lblstatus.Caption = lblstatus.Caption & "." End Ifpgrs = pgrs + 1If pgrs >= ProgressBar1.Max Then Timer1.Enabled = False MDIForm1.Show Unload MeElse ProgressBar1.Value = pgrsEnd IfEnd Sub

Private Sub Timer2_Timer()If i < 100 Then lblstatus.Caption = " Please wait: Establishing connection to the database..."ElseIf i < 500 Then lblstatus.Caption = " Please wait: Loading controls of the application..."ElseIf i < 900 Then lblstatus.Caption = " Please wait: Setting initial values for the controls..."ElseIf i = 900 Then lblstatus.Caption = " Starting application."ElseIf i < 1500 Then If i Mod 75 = 0 Then lblstatus.Caption = lblstatus.Caption & "." End IfElse Timer2.Enabled = FalseEnd Ifi = i + 2End Sub

Module

Dept. of B.C.A. Chinmaya Vidyapeet

Page 112: new

Textiles Management System

Option ExplicitPublic con As ADODB.ConnectionDim recset As ADODB.RecordsetPublic detailsitem As StringPublic unit As Integer, pqr As IntegerPublic h As String, h1 As StringPublic Sub conestablish()Set con = New ADODB.Connectioncon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\user\Desktop\jjj\textiles.mdb;Persist Security Info=False"con.OpenEnd Sub

Public Sub titleimage(ByRef frm As Form)frm.Picture1.Picture = LoadPicture("C:\Documents and Settings\user\Desktop\jjj\koc_Dewdrop[1].jpg")frm.Picture1.PaintPicture frm.Picture1.Picture, 0, 0, frm.Picture1.ScaleWidth, frm.Picture1.ScaleHeightfrm.Picture1.Picture = frm.Picture1.ImageEnd Sub

Public Sub valname(ByRef tbox As TextBox, ByRef keyascii As Integer)If ((keyascii >= Asc("a") And keyascii <= Asc("z")) Or keyascii >= Asc("A") And keyascii <= Asc("Z")) Or keyascii = Asc(vbBack) Then keyascii = keyasciiElseIf keyascii = Asc(" ") Then If Right(tbox, 1) = " " Then keyascii = 0 End IfElse keyascii = 0End IfEnd Sub

Public Sub valnum(ByRef tbox As TextBox, ByRef keyascii As Integer)If Not ((keyascii >= Asc("0") And keyascii <= Asc("9")) Or keyascii = Asc(vbBack) Or keyascii = Asc(".")) Then keyascii = 0End IfEnd Sub

Public Sub itemdetails(s As String)Dim cat As String, bnd As String, subcat As String, mat As String

Dept. of B.C.A. Chinmaya Vidyapeet

Page 113: new

Textiles Management System

Dim rs As New ADODB.RecordsetSet recset = New ADODB.Recordsetrecset.Open "select catid,brandid from item where id=(select itemid from pitem where itemid='" & s & "');", con, adOpenDynamic, adLockOptimisticrs.Open "select * from category where catid='" & recset!catid & "';", con, adOpenDynamic, adLockOptimisticcat = rs!catnamesubcat = rs!subcatrs.Closers.Open "select * from brand where id='" & recset!brandid & "';", con, adOpenDynamic, adLockOptimisticbnd = rs!bnamemat = rs!materialrs.Closedetailsitem = cat & " " & bnd & " " & mat & "" & subcatrs.Open "select uprice from pitem where itemid='" & s & "';", con, adOpenDynamic, adLockOptimisticunit = rs!upricers.Closerecset.CloseEnd Sub

Public Sub idetail(s As String)Dim cat As String, bnd As String, subcat As String, mat As StringDim rs As New ADODB.RecordsetSet recset = New ADODB.Recordsetrecset.Open "select catid,brandid from item where id='" & s & "';", con, adOpenDynamic, adLockOptimisticrs.Open "select * from category where catid='" & recset!catid & "';", con, adOpenDynamic, adLockOptimisticcat = rs!catnamesubcat = rs!subcatrs.Closers.Open "select * from brand where id='" & recset!brandid & "';", con, adOpenDynamic, adLockOptimisticbnd = rs!bnamemat = rs!materialrs.Closedetailsitem = cat & " " & bnd & " " & mat & "" & subcat'rs.Open "select uprice from pitem where itemid='" & s & "';", con, adOpenDynamic, adLockOptimistic'unit = rs!uprice'rs.Closerecset.Close

Dept. of B.C.A. Chinmaya Vidyapeet

Page 114: new

Textiles Management System

End Sub

Dept. of B.C.A. Chinmaya Vidyapeet

Page 115: new

Textiles Management System

SCREEN SHOTS

Login

Dept. of B.C.A. Chinmaya Vidyapeet

Page 116: new

Textiles Management System

Welcome form

Dept. of B.C.A. Chinmaya Vidyapeet

Page 117: new

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 118: new

Textiles Management System

Brand

Bill

Dept. of B.C.A. Chinmaya Vidyapeet

Page 119: new

Textiles Management System

Category

Dept. of B.C.A. Chinmaya Vidyapeet

Page 120: new

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 121: new

Textiles Management System

Employee

Supplier

Dept. of B.C.A. Chinmaya Vidyapeet

Page 122: new

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 123: new

Textiles Management System

User details

Purchase order

Dept. of B.C.A. Chinmaya Vidyapeet

Page 124: new

Textiles Management System

Purchase

Dept. of B.C.A. Chinmaya Vidyapeet

Page 125: new

Textiles Management System

Dept. of B.C.A. Chinmaya Vidyapeet

Page 126: new

Textiles Management System

Purchase return

Dept. of B.C.A. Chinmaya Vidyapeet

Page 127: new

Textiles Management System

Item

Dept. of B.C.A. Chinmaya Vidyapeet

Page 128: new

Textiles Management System

Bill

Dept. of B.C.A. Chinmaya Vidyapeet

Page 129: new

Textiles Management System

MDIForm

Dept. of B.C.A. Chinmaya Vidyapeet

Page 130: new

Textiles Management System

Damage stock

Dept. of B.C.A. Chinmaya Vidyapeet

Page 131: new

Textiles Management System

Sales return

Dept. of B.C.A. Chinmaya Vidyapeet

Page 132: new

Textiles Management System

Purchase order

Dept. of B.C.A. Chinmaya Vidyapeet

Page 133: new

Textiles Management System

Rate

Dept. of B.C.A. Chinmaya Vidyapeet

Page 134: new

Textiles Management System

Sales data report

Dept. of B.C.A. Chinmaya Vidyapeet

Page 135: new

Textiles Management System

Purchase report

Dept. of B.C.A. Chinmaya Vidyapeet

Page 136: new

Textiles Management System

Stock report

Dept. of B.C.A. Chinmaya Vidyapeet

Page 137: new

Textiles Management System

SYSTEM TESTING

This is the most crucial phase where the system is judged for all its worth. The system is tested under all kinds of advance situations and environments to test its performance, reliability and robustness.

System testing involves Unit testing, Integration testing, Acceptance testing. Strategies for integrating software components into a functional product include the bottom-up strategy, the top-down strategy, and the sandwich-strategy. Careful planning and scheduling are required to ensure that modules will be available for integration into the evolving software

Dept. of B.C.A. Chinmaya Vidyapeet

Page 138: new

Textiles Management System

product when needed. A series of testing are performed for the proposed system before the system is ready for user acceptance testing

The testing steps are:-

Unit Testing Integration Testing Validation Testing Output Testing User Acceptance Testing.

Unit Testing

This testing is carried out by an individual programmer during the programming stage itself. In this testing step each module is found to be working satisfactorily as regards to the expected output from the module using a method called white box testing in which the software tester has knowledge of the inner workings, structure and language of the software, or at least its purpose. A set of test was performed as and when each compilation was developed to investigate the behavior of the source code by executing the program on the test file. The strength and limitation of each unit were examined by designing the test files so as to internally break the units. Traversing a particular execution path

Tested the internal logic of the unit

In our project there are forms and each form act as independent unit.

Integration Testing

It is testing two or more modules or functions together with the intent of finding interface defects between the modules or functions. Testing completed at as a part of unit or functional testing, and sometimes, becomes its own standalone set phase. On a larger level, Integration testing can involve a putting together of groups of modules and functions with the goal of completing and verifying that the system meets the system requirements.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 139: new

Textiles Management System

The Integration testing is done on them to verify that the system meets

the system requirements.

Validation Testing

At the culmination of integration testing, software is completely assembled as a package, interfacing errors have been uncovered and corrected validation testing is said to be successful when the software functions in manner that can be reasonably expected to the customer.

Output Testing

After performing the validation testing, the next step was the output testing. It was done to clarify the output of the system. The output is considered in two ways: -

Screen Format Printed Format

The output format on screen was found satisfactory. The hard copy also matched the requirements. As a result the output-testing did not result in any changes.

User Acceptance Testing

In this phase, the system is fully tested by the client commodity against the requirements defined in the analysis and design stages, corrections are made as required, and the production system is built. User acceptance of the system is key factor for success of the system. The system under consideration is tested for user acceptance by constantly keeping in touch with the users at the time of developing and making changes whenever required.

Dept. of B.C.A. Chinmaya Vidyapeet

Page 140: new

Textiles Management System

The software system that we have developed in the above manner satisfies the user needs, confirmed to the requirements and design satisfactions. This project is working in the expected manner and performance is more than that a satisfactory one.

TEST CASE

User authentication:

It checks whether the user name and password of the user has a correct match.

Function Tested Expected Result Test result

User should enter both user name and password

When the user enters only one or none, login screen will be displayed with an error message

As expected

Logout when user wants to discontinue login section

Displaying the user logout successfully

As expected

Integer Field Check:

Checking whether a particular text field, which is supposed to receive only integers, is receiving any other characters

Input values Expected Result Result123 Display PassDqwe Doesn’t Display Pass$#*>.) Doesn’t Display Pass

Dept. of B.C.A. Chinmaya Vidyapeet

Page 141: new

Textiles Management System

Field Checking:

Checks whether the correct data is entered for the field

Function Tested Expected result Test Result

Name The name of the user is entered here. It can contain only characters and blank space

Test successful

Age, Date of birth This should only contain numbers

Test successful

IMPLEMENTATION

Dept. of B.C.A. Chinmaya Vidyapeet

Page 142: new

Textiles Management System

Implementation is the stage in the project where the theoretical design is turned into a working system. The most critical stage is achieving a successful system and in giving confidence on the new system for the users, that it will work efficient and effectively. Coding is done using VB language. The implementation involves the following formalities:

Careful Planning. Investigation of the system and constraints. Design the methods to achieve the changes. Training the staffs in the changed phase. Evaluation of the change over method.

The implementation process begins with preparing a plan for the implementation of the system. According to this plan, the activities are to be carried out in this plan; discussion has been made regarding the equipment, resources and how to test activities. Thus, a clear plan was prepared for the activities. There is three types of implementation:

Implementation of a computer system to replace a manual system. Implementation of new computer system to replace an existing one. Implementation of a modified application to replace an existing one,

using the same computer.

After considering all the phases of the system life cycle the proposed system is now implemented successfully. Apart from planning, the two major tasks of preparing for implementations are education and training of user and testing of the system. Education of users should have taken place much easier in the project. Training has to be given to staff regarding the new system. One staff has been trained, the system can be used.

MAINTENANCE

Dept. of B.C.A. Chinmaya Vidyapeet

Page 143: new

Textiles Management System

The maintenance phase of the software life cycle is the time in which software products perform useful work. After a system is successfully implemented, it should be maintained in a proper manner. System maintenance is an important aspect in the software development life cycle.

The system maintenance is for it to make adaptable to the changes in the environment. They may be social, technical and other environmental changes, which affect the system’s behavior. Software product enhancements may involve providing new functional capabilities improving user displays and mode of interaction, upgrading the performance characteristics of the system. So only through proper system maintenance procedures the system can be adapted to come up with these changes.

The first maintenance activity occurs because it is unreasonable to assume that testing will uncover all latest errors in a large software system. During the use of any large program errors will occur and be reported to the developer. The process that includes the diagnosis and connection of one or more errors is called corrective maintenance.

The second activity that contributes to a definition of maintenance occurs because rapid change that is encountered in every aspect computing. Therefore adaptive maintenance is an activity that modifies software to properly interface with a changing environment is both necessary and commonplace.

The third activity that may be applied to the definition of maintenance occ urs when a software package is successful. As the software is used, recommendations for existing functions, and general enhancement are received from the users to satisfy request in this category, perfective maintenance is performed.

The fourth maintenance activity occurs when the software is changed to improve future maintainability or reliability or to provide better basis for future enhancements.

As with the venture of human, not even one is perfect. The further modifications are left to the followers. It is because of the option or vision of a

Dept. of B.C.A. Chinmaya Vidyapeet

Page 144: new

Textiles Management System

thing is different from individual to individual. The maintenance is performed at regular intervals to keep the project safe and reliable.

SCOPE OF THE PROJECT

Dept. of B.C.A. Chinmaya Vidyapeet

Page 145: new

Textiles Management System

The effective functioning of the Dew Drop has been helped by the software we have developed on inventory management. Satisfactory all the requirements of the unit for the it’s effective functioning can be implemented in a feasible manner. The database has been normalized and with the use of stored procedures any changes required in future can be done easily. We have included all the basic needs by which the process of inventory management can be carried out efficiently. Most of the population of data is done dynamically by which it gets a universal scope. The whole project is developed using Microsoft applications such as Visual basic 6 and SQL Server which ensures ease of use and is economically feasible. It also ensures reliability as they less prone to errors. Also security problems can be resolved to a certain extent by the use of user authentication and clear separation between the

administrators and basic users.

FUTURE ENHANCEMENT

The Inventory management system proposed is having all the requirements for the Dew Drop for the process of stock management, item

Dept. of B.C.A. Chinmaya Vidyapeet

Page 146: new

Textiles Management System

and customer details for the time being but may be in future they need some changes or may arises a new need. The system is designed in such a way that any changes in the system can be easily implemented. For example now the stock and delivery process is strictly followed according to current norms. If the current norm is to be changed such as storage of certain items immediately to the unexpected demand by the public can be easily done. We have actually planned to incorporate other necessities of the joy Alukkas such as staff management. Sales of other commodities available in the open market business management etc but due to the time constraint we were forced to stop it here. But provisions are made to incorporate there features later without much difficulty.

CONCLUSION

This project has a wide and extensive ranging study of existing system for the textile management system and is recommending a new system which uses computer as hardware resource. The software package for the new

Dept. of B.C.A. Chinmaya Vidyapeet

Page 147: new

Textiles Management System

system has been designed, tested with sample data and found to be functioning very well.

This new system supports updating of data and entering new record without any data redundancy. It is easy to maintain. It also provides privacy of data. The system is designed in such a manner that only an authorized administrator can access the data.

In the traditional system there are noted down manually, which can create lots of problems like miswriting and redundancy. The data entry screen if made such that data entry is easy, given appropriate message whenever possible. This makes the interface, user friendly. The maximum data validation has been made prior to the consistency and perfection. Separate modules have been made for data entry and output.

BIBLIOGRAPHY

1. Guide To Visual Basic 6 – Peter Norton’s

Dept. of B.C.A. Chinmaya Vidyapeet

Page 148: new

Textiles Management System

2. System Analysis And Design – Elias M Award3. Micro Soft SQL Server 2005 – Internet.

Dept. of B.C.A. Chinmaya Vidyapeet