Upload
deep-bajwa
View
22
Download
0
Embed Size (px)
DESCRIPTION
Library Management Project for MBA
Citation preview
Library Management
INVISUAL BASIC 6.0
&MS ACCESS
Project Report Submitted in partial fulfillment of the requirementFor the award of
BACHELOR OF COMPUTER APPLICATION (BCA)
Supervised By: Submitted by:Mr. Harish Abhishek Rai Enrollment No -1202814
SATYAM Institute of ENGINEERING Technologies Amritsar
PUNJAB TECHNICAL UNIVERSITY, JALANDHAR
CERTIFICATE OF ORIGINALITY
This is certify that the project report entitled Library Management submitted
to PUNJAB TECHNICAL UNIVERSITY in Jalandhar fulfillment of the
requirement of the award of the degree of BACHELOR OF COMPUTER
APPLICATION (BCA), is an original work carried out by Mr. Abhishek Rai
Enrollment Number 1202814 under my guidance.
The matter embodied in this project is a genuine work done by the
student and has not been submitted whether to this University or to any other
University / Institute for the fulfillment of the requirement of any course of study.
Supervised By: Submitted By:
Mr. Harish Abhishek Rai Enrollment No - 1202814
ACKNOWLEDGEMENT
“Success is to be measured not so much by the position that one has reached in
life, but as by the obstacles which he has to overcome while trying to succeed”.
One must always be grateful for the help an assistance given in this self-
oriented individualistic world, which is very difficult for each and every one.
First of all, I would like to thanks to my University, PUNJAB TECHNICAL
UNIVERSITY, JALANDHAR, which have given me a chance to understand the
opportunities which comes in my carrier in IT field by doing a project on Library
management for fulfillment of BCA course. This has shown me how to tackle all the
opportunities coming in a project development life cycle.
I wish to express my sincere thanks to Mr. Harish and all the faculty
members of SATYAM INSTITUTE OF ENGINEERING Technologies Amritsar
whose guideline in the course of BCA had, bring me in the field of computer, to a so
strong position that I can do a project myself.
I also want to give thanks to my friends and classmates for their help, in
discussing a problematic situation in detail, which helps me in coping with that
problem. They had problematic me to select a good path to follow in my difficult
situations.
As a debt of more personal sort, I owe to my parents for inspiration and moral
support throughout this project. They provide me both material and money support,
which is potent for any project development.
Once again I want to give my sincere thanks to all of them who have
given me any kind of help during my project development.
Contents
Software Requirement
Hardware Requirement
Integrated Development Environment
Event Driven Programming
Database Models
System Analysis
Objective Of The Proposed System
System Study
Problem Study
Database Tables To Be Used
Program
1. ABOUT THE PROJECT
TITLE OF THE PROJECT
Computerization of Textile Firm
SOFTWARE REQUIREMENT
The Project will le implemented in High Level Language.
Front End : Visual Basic 6.0
Back End : MS Access
Operating System : Windows 9x.
Front End : Visual Basic is the most powerful rapid application development tool.
Visual Basic helps programmer to focus on the programmer to focus on the problems
at hand rather than the technical intricacies of programming in a windows
environment.
A lot many commercial applications available today are written using visual
basic. It provides a complete set of built-in intelligent tools for creating windows
application programs.
Back End: MS Access is a Relational Database Management System (RDBMS)
used to store and manipulate large collection of information of any kind. Here
RDBMS refers to the organization of data in a series of rows and columns in such a
manner that any specific piece of Information is available with the click of a mouse
and a few key strokes. MS-Access has tools which are easy to use and provide
powerful development environment, making it an appropriate choice for novices as
well as professionals. Once the records are stored, any types of queries
can be asked, reports can be created and data entry forms can be designed. At an
advanced level, Access can be used for developing custom database applications by
employing Access Basic and a Distribution kit for compiling applications.
2.3 HARDWARE REQUIREMENTS
System Configurations
Minimum Hardware Requirements:
Microprocessor : Pentium-II 350 MHZ or higher.
RAM : 32 MB or more (64 MB recommended)
Bus Speed : 100 MHZ or 133 MHZ.
Floppy Drive : 1.44 MB Double Speed High Density.
Monitor : VGA(Video Graphics Acceptor)
600x800 (Recommended).
Printer : Inkjet/Laser/Dot Matrix
2.4 OBJECTIVE
The objectives of the proposed system given are below
To minimize time taken in getting specified information.
To active maximum accuracy in maintaining records
To distribute various activities related to overall system.
To minimize overall processing time
To minimize redundancies in maintaining records.
Integrity of the data is to be maintained by the proposed system. In
inconsistencies between the two entries in the database can be avoided
Security of the data is to be maintained over the operational data.
Various authorization checks can be applied whenever access to
sensitive data is attempted.
Access to data between different users can be divided. Different views
can be constructed in order to allow a particular user with the data we
want to show.
3. VIEW OF VISUAL BASIC 6.0
Visual Basic (VB) is one of the most advanced languages in today's Computer
World. Visual Basic is most enjoyable language due to its Visual Environment.
The goal of teaching Visual Basic is to a new comer at times is challenging due to
today's broad range of computing skills. Visual basic is the most powerful rapid
application development (RAD) tool in the world. Visual Basic helps programmers
to focus on the problem at hand rather than technical intricacies of programming in
a window environment. A lot of commercial applications available today are
written using Visual Basic. It provides a complete set of built in intelligent tools
for creating Windows application programs.
Visual Basic Integrated Development Environment
The Visual Basic Integrated Development Environment (IDE) is that where
we do our programming. The IDE consists of menu bar toolbar, project explorer
properties window font layout window and the toolbox. On starting Visual Basic, six
windows appear on the screen. The top of the screen consists of the main window
consisting of the toolbar and the menus. At the center of the screen is the Form
Designer. Other windows on the opening screen are the Property windows. The Project
Explorer window, a palette window called the Toolbox and Form Layout window. On
double clicking the font with mouse, the code windows are also opened. This is the
place where you will do most of your development. The code as the name suggests is
used for writing code.
The Toolbox contains the objects and controls, which you will add to the form
to create the user interface for your project. Control like command buttons, text boxes,
radio buttons, check boxes are objects provided by control components, also known as
OCX files. The Form Designer window contains the form on which the controls and
objects are going to be placed. Your application can have more than one form. The
Project Explorer window shows all files you have used in your application. The
collection of files makes a project. The Properties window lists the properties of the
selected form or control on the form. Properties like height, appearance, color etc. are
displayed. You can position the form to the location where you want it to appear at run
time.
The Form layout window allows you to visually position the forms at design
time. All forms that are visible in the environment are displayed. You can position the
form to the location where you want it to appear at run time.
When user double click on the form, the Code Editor window opens. . You
have a code editor window for each window for each form in the application. Any
code you need to attach to the form or any control on the form you need to type it in
the Code Editor Window. A code window has drop-down list boxes at the top. The list
box on the left side displays a list of objects placed on the form. The list box on the
right side displays all the events associated with the object selected in the left side box
User Interface
User interface specifies what the user will actually see and interact with, when the user will
use the application. Before you can being to write any code, you must design what is called the user
interface. The user interface is the way the user communicates with your computer.
Visual Basic Forms
A form is a display area that corresponds to a window or dialog box that makes up the part
of an application's user interface Forms is the name given for the window in the Visual Basic. In
addition to the form, each form has properties associated with it. In Visual Basic there are two types
of forms, namely the Normal Form and a Multi-Document Interface (MDI) form. The normal form
can either exist independently or can be a child form of the MDI form. A forms collection is a
collection of all the loaded forms in an application. All the forms you add to an application are
automatically added to a form collection.
The .EXE file can be made by the combination of Forms(.FRM) Modules (.BAS), and
Control (.OCX) which can be shown as in the next page:
EVENT DRIVEN PROGRAMMING:
An event is an action perfomed by the user that starts an event handler. An event handler is
a block of code that is executed automatically when the user performs an action or event. Event
driven programming is defined a technique where the operation being perfomed by the applicationdepends upon the user action.
The user interface itself does nothing except tell the computer program what to do. When
one clicks the button with the printer icon on it, it sends the message to word processor telling that
the print button was clicked. The word processor package reacts by printing out the document.
In the same way, when you write the visual basic programs, you must tell what will happen
when the user clicks your button, or types some text into the text box. This kind of programming
where the code is executed in reaction to user action is termed as an Event Driven Programming.
An event is when the user performs an action on the computer like clicking a button or
selecting the menu item. There are a numerous number of events.
An event handler is a set of instructions that is triggered in response to an event.
The Additional Features of Visual Basic are as Follows:
* WWSIWYG : What you see is what you get. In Visual Basic platform your windows
program appears before your eyes as you add the objects.
* Using VB a useful user interface can be created.
* Using the Application Wizard to generate a program shell instantly.
* VB can use tools from other languages and windows applications.
* VB can incorporated database technologies in the programs.
* VB is master in the art of getting the errors.
* VB has ability to creat brand new ActiveX Control.
* VB can create Graphics to add pizzazz to the screens that you design.
* Using common dialog boxes, user can access typical features expect in windows
application.
* VB also provides the facility to add Multimedia sound and
graphics in the programs.
DATABASE MODELS
* Hierachical
* Network
* Relational
Hierarchical Model
This model was introduced in the Information Management System (IMS) developed by IBM in
1968. This model is like a hierarchical tree structure, used to construct a hierarchy record in the
form of nodes and branches. The data elements present in the structure have a Parent-Child
relationship. Closely related information in the Parent-Child structure is stored together as a
logical unit. A parent unit may have many child units, but a child is restricted to have only one
parent.
1. The hierarchical structure is not flexible enough to represent all the relationship
proportions, which occur in the real world.
2. It cannot demonstrate the overall data model for enterprise because of the non-availability
of actual data at the time of designing the data model.
3. It cannot represent the Many-to-Many relationship.
4. The Hierarchical Model is used when the concerned data has a clearly hierarchical
character with a single root, for example the Dos Directory Structure.
Network Model
It is an improvement on the hierarchical model. Here multiple parent-child relationships are
used. Rapid and easy access to data is possible in this model due to multiple access paths to the data
elements.
Transaction is maintained using pointers and having to trace the pointers is the drawback of
this design.
Relational Model
* Data is organized in terms of row and columns in a table known as relations.
* The position of row in a table is of no importance.
* The intersection of a row and column must give a single value.
* All values appearing in the columns are derived from the underlying domain.
* Row must be unique.
* Column Name must be unique.
* All column values are atomic.
* In relational databases, there are no hard-coded relationships defined between tables.
* A relationship can. be specified at any time using column name.
The publication of the paper "A Relational Model of Data for large Shared Databases" by
E.F. Code in June 1970 in the "Communication of ACM", set a trend for vigorous and extensive
investigation into a theoretical framework to support further work in the area of Data Modeling.
The end result is the Relational Database Management Systems (RDBMS).
In RDBMS, the data is organized in tables consisting of rows and columns.
Properties of Relational Database
A Relational Database Management System (RDBMS) has the following Properties :
* Represents data in the form of tables.
* Do not hard-code relationships between tables.
* Doesn't require the user to understand its physical implementation.
* Provides information about its content and structure in system table.
* Support the concept of NULL values.
The 12 Rules for an RDBMS (Code's Rule)
* Information Representation
* Guaranteed Access
* Systematic Treatment of NULL Values.
* Database Description Rule
* Comprehensive Data Sub- Language-.
* View Updating
* High-Level Update, Insert, Delete
* Physical Data Independence
* Logical Data Independence
* The Distribution Rule
* Non-Subversion
* Integrity Rule
Normalization
Normalization is the process of refining the data model built by the Entity-Relationship
Diagram. The Normalization technique logically groups the data over a number of tables, which are
independent and contain no duplicate data.
The entities or tables resulting from Normalization contain simple data items, with
relationships being represented by replication of key data item(s).
The goal of a relationship database design is to generate a set of relation schemes that allow
us to store information without redundant data and allow us to retrieve information easily and
efficiently. The approach followed is to design schemes that are in an appropriate one of the so-
called Normal Form.
Need for Normalization
Improves database design
Ensures minimum redundancy of data.
Reduces need to reorganize data when design is modified/enhanced.
Removes anomalies for database activities.
Unnormalized Data Structures.
An Un-normalized Data structure contains redundant and disorganized data, which needs to
be organized, by dividing the data over several tables to avoid redundancy. This is achieved by going
through the process of Normalization.
Steps in Normalization
First Normal Form (1 NF)
* Identify repeating groups of fields
* Remove repeating groups to a separate table.
* Identify the keys for the tables.
* Key of parent table is brought as part of the concatenated key of the second table.
Second Normal Form (2 NF)
* Check if all fields are dependent on the whole key.
* Removes fields that depend on the part of the key.
* Group partially dependent fields as a separate table.
* Name the tables.
* Identify the key(s) to the table(s).
Third Normal Form (3 NF)
Remove field that
* Depend on other non-keys fields
* Can be calculated or derived from logic
* Group interdependent fields as separate tables, identify the key and name the table.
Relational Database Management System (RDBMS)
A Relational Database Management System (RDBMS) is an information system that presents
information as rows contained in a collection of tables, each table possessing a set of one or more
columns. Code described the elements of a relational database as relation, attributes, domains and
the relational operators.
5. SYSTEM ANALYSIS
Feasibility Study
The objective of Initial Investigation is to determine whether the request is valid and feasible
before a recommendation is reached to do nothing, improve, or modify the existing system, or build
a new one.
Depending on the results of the initial investigation, the survey is expanded to a more
detailed feasibility study. A feasibility study is a test of a system proposal according to its
workability, impact on the organization, ability to meet user needs, and effective use of resources. It
focuses on three major
1. What are the user's demonstrable needs and how does a candidate system meet them?
2. What resources are available for given candidate systems?
3. What is the likely impact of the candidate system on the organization?
THERE ARE MAJOR CHARACTERSTICS TO BE
TAKEN INTO ACCOUNT
1. Economic Feasibility
2. Technical Feasibility
3. Behavioral Feasibility.
ECONOMIC FEASIBILITY:
Economic Analysis is the most frequently used method for evaluating the effectiveness of a
candidate system. A procedure of cost/ benefit analysis is applied to determine the savings and
benefits outweigh the costs, then the decision is made to design and implement the system.
Otherwise, further justification or alterations in the propose system will have to be made if it is to
have a chance of being approved. This is an ongoing effort that improves in accuracy at each phase
of the system life cycle.
SOCIAL FEASIBILITY:
It is important to study the social implications when a new product or system is introduced. People
are inherently resistant to change and computers have been known to facilitate change. An estimate
should be made of how strong a reaction user staff is likely to have towards the development of a
computerized system. It is common that computer installation results in turnover, transfers,
retraining and changes in the employee's job status. Therefore, it is undesirable that the introduction
of the candidate system requires special effect to educate, sell, and train the staff on new ways of
conducting business. When we explained our system to users, they gave a good response.
BEHAVIORAL FEASIBILITY:
People are inherently resistant to change and computers have be known to facilitate change it
is common knowledge that the computer installation has something to with turnover, transfer,
retraining and changes in the employee job status therefore it is understandable that the introduction
of the candidate system requires special effort to educate and train the staff on new ways of
conducting business.
Points that the user staff raised against the new system.
1. It would render a large number of the employees jobless.
2. Difficult training would have to be undertaken at personal costs.
3. Change in job status and may be demotion, if found not qualified for the job.
4. Difficulties in change the old record.
5. Transfer of employees to less relevant job station.
6. Difficult to maintain the long run.
7. Difficult and time consuming requires if system failure occurs during the working hours.
8. Loss of time and working hours if the system is not repaired on the time.
The user staff that had to directly work on the new system gave all the limitation or the
apprehensions that are listed above they feared that the new system would result in the demotions or
they will be out of their jobs. They may not be computer literate they said that in order to retain their
jobs they would have to understand computer training at the private institute which is very expensive
and difficult at their personal cost.
All the fears that were expressed by the user staff are only humor because every human has
been known to resist change unless or otherwise he has the necessary qualifications. The users staff
fears are genuine but they can be met in an efficient manner.
TECHNICAL FEASIBILITY:
It involves determining whether or not a system can actually be constructed to solve the
problem at hand. Technical feasibility centers on the existing computer system (hardware, software)
etc. and to what extent it can support the proposed system. System developed by us is technically
feasible because no system was previously running on their system as he has purchased a new
system. Our system would be easy to use as it is user friendly to a person who knows simple English
can easily use it effectively and it is capable of fulfilling their requirements about the production,
sales, purchase, stock control of products and employee information.
The various issues considered for the technical feasibility are :
* Proposed system and component provide adequate responses to inquires.
* Technical guaranties of accuracy, reliability, ease of access and data security.
* Streamlining of the records into a single system.
* Usefulness in panning purposes.
* Easy accessibility of the records.
* Comprehensive and full proof interdependence.
* Inter connection of the various nodes.
* Easy to operate and maintain in the long run.
* Can be easily enhanced in the future.
As the user know that the existing system that is in the use at the users work place at the
manual. All the operations that are being done on the data are manual. This system is working well
but it resulting in huge loss. All the time loss and money lost can be put to various other uses, if all
the time lost can be recovered. The new system can be designed in such a way that it retains the
basic structure of the user's manual system that is in use at the moment, because then it would not be
the difficult for the user and user staff to acquaint them with the new system. The new system would
be made on software that is easy to understand for the user staff and they can be given the adequate
training for operating it the new system would be based on such software that it is easy to maintain
and repair. The equipment's used in the system have the capacity to hold the data required.
The major and basic advantage of the new system that it would be greatly reduce the load
on the employees of College. They; would be able to do same amount of work in less amount of
time. The new system should be design in such a way that is able to hold a large amount of data. The
transfer of the data from one place to other place would be quite easy. The new system should be
very interactive in nature as compared to the existing one.
DATA COLLECTION TOOLS TO BE USED
No two projects are same, this means that the analysis must decide on the information
gathering tools and how they must be used all though there are no standard rules for tool for
specifying there use an important role is that information must be acquired accurately, methodically,
under the right conditions and minimum interruption to user personal that is if the analyst needs for
only the information available in existing manuals, then interviewing is necessary aspect where
manual is not upto date if additional information in existing manual is not available up to date and
additional information is needed on the site observation or a question name be considered.
REVIEWS OF LITERATURES AND PROCEDURES
Very few system problems are unique. The increasing number of software packages suggests that
problem solutions are becoming standardized. Therefore, as a first step a search of the literature
through professional, references and procedures manuals, textbooks or consultant studies may prove
invaluable. The primary drawback of this search is time. Often it is difficult to get required data,
publication may be expensive.
Procedure manuals and forms are useful sources for the analyst. They describe the
format and functions of the present system. Included in most manuals are system requirement
that help determine how well various objectives are met. Up to date manuals save hours of
information gathering time. Unfortunately, in may cases, manuals do not exist or are
seriously out of date.
6.1 DATA ANALYSIS AND INTERPRETATION TOOLSTO BE USED
The most critical phase of the system development is System Analysis. Analysis is a
detailed study of the various operations performed by the system. One aspect of
analysis is defining the boundaries of the system and determining whether or not a
candidate system should consider other related system. To launch a system
Investigation we need master plan to achieve our target. The major steps of analysis is
designing to see the user requirements by studying the present system, to verify the
problem and to the requirement wanted to designed the candidate system to meet user
requirements.
The goal of system analysis is to see whether existing system can be improved
or not. If it can be improved cost to implement that system is justified what
improvements are done in the system. Here in this case there is the doubt that
presently existing manual systems can be improved tremendously by changing certain
few procedures and giving training to the employees. But from the study of present
manual system it's found that there is a large amount of redundancy i.e. some of
information has to be recorded and checked repeatedly which lead to enormous
wastage of time and increase the possibility of committing errors.
Considering all these aspects, the introduction of computer is done to
overcome the difficulties, which provide a complete justification to computerize the
existing System.
DESIGN APPROACH SELECTED
Design is the process of developing the technical and operational specifications of a
candidate system for implementation. In this project, top-down design approach is
being used. A design is said to be top-down if it consists of a hierarchy of modules,
with each module having a single entry and single exit subroutine. The primary
advantages of this design are as follows:
1. Critical interfaces are tested first.
2. Early versions of the design, though incomplete, are useful enough resemble
the real system.
3. Structuring the design provides control and improves morale.
4. The procedural characteristics define the order that determines processing.
The top level shows the most important division of work, the lowest level at the
bottom shows the details.
The documentation tool for design is the hierarchy or structure chart. It is a
graphic tool for representing hierarchy, and it has three elements.
a. The MODULE is represented by a rectangle with a name. It is a contiguous
set of elements.
b. The CONNECTION is represented by a vector linking two modules.It usually
means one module has called another module.
c. The COUPLE is represented by an arrow with a circular tail. It represents data items
moved from one module to another.
DRAWBACK OF THE OLD SYSTEM:
There are some problems and drawbacks in the existing manual system which are given
below:
* Existing System is very time consuming. There is a lot of wastage of time in
posting transaction entries.
* There is a lot of wastage of man power in the existing manual system due to
the time consumption in the checking of various entries and the time consumed in
typing various reports.* It adds to volume of paper and file work, which becomes inconvenient and untidy.
* The existing manual system is a very expensive method, as lot of paper work
has to be done and lot of wastage of manpower, which increase the expenses of the
existing system.
* Each entry has to be made many times.
* There are more chances of mistakes in the existing system as entries have to be made many times.* Integrity of data is not supported by the existing manual system. Data in files has to be transferred from one department to another manually.* Redundancy is not avoided in the present system, which leads to inconvenience.* The different users in the different departments cannot share data simultaneously.* Security features are not prominent in the existing system.
summary, cash summary, admission summary etc.
Now they can keep information about the admission of the students, the information
regarding the payment of fees and various students and
employees of the college. The major advantage of proposed system are :
1. Accuracy will be highly enhanced.
2. Data stored will be come much easy and compact.
3. Reports and bills can be made available which is a must for them.
4. A lot of computational burden will be off.
.5. Even stranger to computer can use the system being menu driven,
with little efforts.
PROPOSED SYSTEM:
Certainly, there is no doubt that existing manual system can be improved
tremendously by changing few or some processes and employing trained manpower. The proposed
system is aimed to computerize and replace the manual system so as to bring correctness , efficiency,
security and integrity. Through this method detailed and comprehensive reports can be prepared . As
already explained that the existing system have workload unnecessary botheration about the records
of sample data conceiving the problem of existing system along with its limitation.
The only viable solution left is to computerization of textile firm. The prime reason
being that the computer is capable of processing large amount of data enormously that human take
error in every 500 to 1000 operations with the calculator the circuits of computer on the other hand
can perform millions of operations every seconds and run errorless for hours and days at a time. This
is because they require no human intervention between processing operations and have no
mechanical parts to wear and malfunction. The proposed system will fulfill it’s input requirements
from:
Existing System:
With this information, the proposed system will be capable of generating important and
indispensable reports namely Pending data and Despatched data etc.
Now they can keep information about the Sample Data, Child Sample Data. The
major advantages of proposed system are:
1. Accuracy will be highly enhanced.
2. Data stored will be come much easy and compact.
3. Reports and bills can be made available which is must for them.
4. A lot of computational burden will be off.
5. Even stranger to computer can use the system being menu driven, with little efforts.
OBJECTIVES OF THE PROPOSED SYSTEM:
The Objectives of the proposed system are given below:
* To minimize the time taken for the preparation of various stock reports and the cost reports
which are required for the production management.
* To achieve maximum accuracy in maintaining records and obtain maximum efficiency in the system.
* To centralize the various activities related to overall system.
* To minimize the redundancies in maintaining the register.
* To minimize the expenses of the existing manual system by efficiently using the manpower
and reducing the paper work done in existing system.
* All the work of the system should be done interactive.
* To take accurate and quick information for decision making of the management of the
college administration.
* Integrity of data is maintained by the proposed system. In this way inconsistencies between
two entries in the database can be avoided.
* Security of data is maintained over the operational data. Various authorization checks can be
applied whenever access to sensitive data is attempted. Different checks can be established for each
type of access (retrieve, modify, delete etc.) to each piece of information in the database.
* Proposed system also supports the sharing of data. Data can be shared among different users.
Concurrent sharing is also possible i.e. various users can share the same piece of data at the same
time.
* Access to data between different users can be divided. Different views can be constructed in order to allow a particular student an employees with the data that we want to show.
Considering all these aspects, the introduction, of computers to overcome the above mentioned difficulties provide a complete justification to computerize the existing system of firm.
SYSTEM STUDY
A system study is an orderly grouping of interrelated, interdependent components linked
together according to a predefined plan to achieve a specific objective. For example telephone
system, business system, transportation system etc. Any predefined or programmed techniques or
steps that help to complete a certain job in efficient manner, can be called a system. When the new
system is developed we need to study the old system and their relationship within and outside of the
system. A key question is what must be done to solve the problem. During the system study data are
collected on files decision points and transaction handled by the present system in this system we
need to analysis how manual system for payroll system work.
* Organisation: Organisation implies the structure and order. It is the arrangement of the components that help to achieve the objectives. for example in a business the hierarchical relationships.
* Intersection: Intersection refer to the manner in which each component function with other components of the system. E.g. Payroll with personnel.
* Interdependence : It means that a part of the system depends upon another part. Output of one sub system is required input of another system and vice-versa E.g.
User Area
Integration: Integration refers to the holism of the system successful integration will typically produce the synergistic effect and greater the total impact than if component works independently.
THE DATA FLOW DIAGRAM (DFD)
The DFD was first developed by Larry Constantine, as a way of expressing system
requirements in a graphical form, this led to a modular design.
A DFD is also known as a "bubble chart". A DFD has the purpose of clarifying system
requirements and identifying major transformations that will become programs in system design. So
it is the starting point of the design phase that functionally decomposes the requirements
specifications down to the lowest level of detail. A DFD consists of a series of bubbles joined lines.
The bubbles represent data transformations and the lines represent data flows in the system.
DFD Symbols
In the DFD, there are four symbols.
1. A square defines a source (originator) or destination of system data.
2. An arrow identifies data flow - data in motion. It pipeline through which information flows.
3. A circle or a "bubble" (or an oval bubble) represents a process that transforms incoming data flow(s) into outgoing data flow(s).
System Analysis Programming Operations
5. An open rectangle is a data store-data at rest, or temporary repository of data.
A DFD describes what data flows i.e. logical data flow rather than how they are processed,
and so it does not depend on hardware, software, data structures, or file organization.
Constructing a DFD
Several rules of thumb are used in drawing DFDs.
1. Processes should be named and numbered for easy reference. Each name should be representative of the process.
2. The direction of flow is from top to bottom and from left to right. Data traditionally flow from source (upper left comer) to the destination (lower right comer) although they may flow back to a source. One way to indicate this is to draw along flow back to a source. An alternative way is to repeat the source symbol as a destination. Since it is used more than once in a DFD, it is marked with a short diagonal in the lower right corner.
3. When a process is exploded into lower-level details, they are numbered.
4. The names of data stores, sources, and destinations are written in
capital letters. Process and data flow names have the first letter of each word capitalized.
5. SYSTEM DESIGN
System design is most creative phase of the system development. The term design describes
a final system and the process it is developed. It includes the construction of programs and program
testing. The key question of system design is, how should problem be solved.
A systematic method has to achieve the beneficial results at the end. It involves starting with
a vague idea and developing it into a series of steps. The series of steps for successful system
development or successful system design are given below :
1. The first step is to study problem completely because first of all we should know the goal, which we have to achieve.
2 The second step we should see what kind of output we require and what kind of input we give so that we can get desired output from system. It is very challenging step of the system development.
3. According to input requirement of the system the structure of various databases should be design.
4. Next we should know what kind of program should be developed which will reach us to reach final goal.
5. Then we write this individual program, which later on joining solve problem.
6. Then we test these programs and make necessary correction in them to achieve target of the programs.
7. At last combining all these problems in the form of a bar in the menu of the window, which all complete software package for stock and billing system of Firm.
In other words, various steps involved in system design are:
1. Problem Definition
2. Input/Output Specification.
3. Database Design
4. Modular program design.
5. Preparing of individual programs.
6. Testing and debugging.
7. Now we shall discuss each of these steps in detail to our project.
PROBLEM DEFINATION
A software development is like a puzzle, which is to be solved to create a new system. When
we start we should know clearly and exactly about the problem, where it exists and we should know
every aspect of our problem before we start to solve the problem. The problem seems vague at
starting because we are unaware that how the work is done actually what kind of difficulty are met
and how they are tackled every detail has to be studied because a little mistake in studying detail
leads to drastic change in the results. Here my project is to maintain. The main aim of the software is
to keep data of Labels that are pending and dispatched.
INPUT/OUTPUT SPECIFICATIONS
On this step we should see what kind of output we required and then plan what kind of input
we give so that we can get the desired output from the system. In this design, user oriented inputs are
converted into computer based format.
In output design the emphasis is on producing a hard copy of in formation required or
displaying the output on monitor in a predefined format.
* Monthly cash receipts reports are generated to give information about the material that are
pending or dispatched.
* Also lot of paper work and manual work is prevented. Because we can get every information
regarding sample data, child sample data from the software.
* Case is to be taken so as to design the reports with necessary information and on the same
time avoiding the unnecessary information because a irrelevant information are worse than no
information.
CODING : Once the design is complete, most of the major decision about the system has been
made. Now next phase of the system development is the coding. The goal of the coding phase is to
translate the design of the system into code in a given programming language. In this phase we
aimed to implement the design in the best possible manner which is already prepared. Many of the
detail about the coding depends on the programming language chosen, are not specified during the
design. In our case we use VISUAL BASIC 6.0 as the programming language. The Coding phase
affect both testing and maintenance profoundly. The well-written code reduces the testing and the
maintenance phase. So during the coding phase our focus was on developing the programs that are
easy to read and understandable and also simple to write.
An important concept considered in the coding is the structured programming that helps in
understanding the programs in the better way. The goal of the structured programming is to linearize
the control flow in the program. The text in the program is organized as a sequence of statement and
the statements are executed in a sequence given in the program.
The coding in the Visual Basic helps us in many ways. Like whenever an error occurs it gives
the necessary message immediately. Error message prompt us when ever wrong action is taken.
The characteristics of my coding are :
* All code is written in the independent procedure.
* The top approach of programming is used.
* The coding is well documented.
* I use meaningful names and labels in the programming.
* Jumps are tried to avoid as much as possible. Modules are made fairly general.
* Emphasis is given on simplicity and comprehensibility.
* Modules are tried to keep short.
The following pages enlist the coding for the project Computerization of Firm.
STUDENT ISSUE
Imports System.Data.OleDbPublic Class Form1 Inherits System.Windows.Forms.Form
Dim dr As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next Me.Size = New Size(800, 600) Me.Location = New Point(80, 25) bol = "lib" DateTimePicker1.Value = Today ListView1.Items.Clear() ListView1.Columns(0).Text = "Library Card No" ListView1.Columns(1).Text = "Student Name" ListView1.Columns(2).Text = "Roll No" ListView1.Columns(3).Text = "Class" s = "select cardno,sname,rollno,class from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) 'MsgBox(ds.Tables(0).Rows.Count) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then MsgBox("Incomplete Informaton", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub End If s = "select * from student where cardno='" & Trim(TextBox1.Text) & "'and sname='" & Trim(TextBox3.Text) & "'and class='" & Trim(TextBox4.Text) & "'and rollno='" & Trim(TextBox5.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet()
da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Student record not matched", MsgBoxStyle.Exclamation) TextBox3.Focus() Exit Sub End If s = "select bookid,bname from book where bookid='" & Trim(TextBox2.Text) & "'and bname='" & Trim(TextBox8.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Book record not found", MsgBoxStyle.Information) TextBox8.Focus() Exit Sub End If s = "select cardno from studentissue where cardno='" & Trim(TextBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then MsgBox("Cannot Issue" & ControlChars.CrLf & "Book already issue to student", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub End If s = "select bookid from studentissue where bookid='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then MsgBox("Cannot Issue" & ControlChars.CrLf & "Select Book already issue to another student", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub End If dr = Format(DateAdd(DateInterval.Day, 14, DateTimePicker1.Value), "dd/MMMM/yyyy") s = "insert into studentissue values('" & Trim(TextBox1.Text) & "','" & Trim(TextBox2.Text) & "','" & Trim(TextBox3.Text) & "','" & Trim(TextBox4.Text) & "','" & Trim(TextBox5.Text) & "','" & Trim(TextBox8.Text) & "','" & DateTimePicker1.Value & "','" & dr & "')" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds)
MsgBox("Book Issued" & ControlChars.CrLf & "Date of Issue:" & Format(DateTimePicker1.Value, "dd/MMM/yyyy") & ControlChars.CrLf & "Date of Return:" & dr, MsgBoxStyle.Information) Button3.PerformClick() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If Not TextBox1.Text = "" Then s = "select * from student where cardno='" & Trim(TextBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Invalid Library card number", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub Else TextBox5.Text = ds.Tables(0).Rows(0)(0) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox4.Text = ds.Tables(0).Rows(0)(3) End If End If If Not TextBox2.Text = "" Then s = "select bname from book where bookid='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Invalid Book ID", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub Else TextBox8.Text = ds.Tables(0).Rows(0)(0) End If End If End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
On Error Resume Next If Asc(e.KeyChar) = 13 Then On Error Resume Next bol = "lib" Label6.Text = "Student Record" ListView1.Items.Clear() ListView1.Columns(0).Text = "Library Card No" ListView1.Columns(1).Text = "Student Name" ListView1.Columns(2).Text = "Roll No" ListView1.Columns(3).Text = "Class" s = "select cardno,sname,rollno,class from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If End If End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress On Error Resume Next If Asc(e.KeyChar) = 13 Then bol = "book" Label6.Text = "Book Record" ListView1.Items.Clear() ListView1.Columns(0).Text = "Book ID" ListView1.Columns(1).Text = "Book Name" ListView1.Columns(2).Text = "Author Name" ListView1.Columns(3).Text = "Publisher" s = "select bookid,bname,aname,publisher from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If
End If End Sub
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
'If bol = "lib" Then ' TextBox1.Text = col ' TextBox3.Text = col1 ' TextBox5.Text = col3 ' TextBox4.Text = col2 'Else ' TextBox2.Text = col ' TextBox8.Text = col1 'End If 'bol = "" End Sub
Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.DoubleClick On Error Resume Next bol = "lib" Label6.Text = "Student Record" ListView1.Items.Clear() ListView1.Columns(0).Text = "Library Card No" ListView1.Columns(1).Text = "Student Name" ListView1.Columns(2).Text = "Roll No" ListView1.Columns(3).Text = "Class" s = "select cardno,sname,rollno,class from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If 'Dim f13 As New Form13() 'f13.ShowDialog() 'Me.Hide() End Sub
Private Sub TextBox2_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.DoubleClick On Error Resume Next
bol = "book" Label6.Text = "Book Record" ListView1.Items.Clear() ListView1.Columns(0).Text = "Book ID" ListView1.Columns(1).Text = "Book Name" ListView1.Columns(2).Text = "Author Name" ListView1.Columns(3).Text = "Publisher" s = "select bookid,bname,aname,publisher from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click On Error Resume Next TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox8.Clear() TextBox1.Focus() 'TextBox9.Clear() End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged On Error Resume Next If bol = "lib" Then TextBox1.Text = ListView1.SelectedItems(0).Text TextBox3.Text = ListView1.SelectedItems(0).SubItems(1).Text TextBox5.Text = ListView1.SelectedItems(0).SubItems(2).Text TextBox4.Text = ListView1.SelectedItems(0).SubItems(3).Text Else TextBox2.Text = ListView1.SelectedItems(0).Text TextBox8.Text = ListView1.SelectedItems(0).SubItems(1).Text End If End Sub
End Cla
STUDENT RETURN
Imports System.Data.OleDbPublic Class Form2 Inherits System.Windows.Forms.Form
Dim f1 As Integer
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next TextBox12.Text = 0 ListView1.Columns(0).Text = "Library Card No" ListView1.Columns(1).Text = "Student Name" ListView1.Columns(2).Text = "Book ID" ListView1.Columns(3).Text = "Book Name" ListView1.Columns(4).Text = "Issue Date" ListView1.Columns(5).Text = "Class" ListView1.Columns(6).Text = "Roll No." s = "select * from studentissue" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5)) ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(6))) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(4)) Next End If End Sub
Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.DoubleClick On Error Resume Next bol = "lib" ListView1.Items.Clear() ListView1.Columns(0).Text = "Library Card No" ListView1.Columns(1).Text = "Student Name" ListView1.Columns(2).Text = "Book ID"
ListView1.Columns(3).Text = "Book Name" ListView1.Columns(4).Text = "Issue Date" s = "select * from studentissue" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5)) ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(6))) Next End If End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress On Error Resume Next If Asc(e.KeyChar) = 13 Then bol = "lib" ListView1.Items.Clear() ListView1.Columns(0).Text = "Library Card No" ListView1.Columns(1).Text = "Student Name" ListView1.Columns(2).Text = "Book ID" ListView1.Columns(3).Text = "Book Name" ListView1.Columns(4).Text = "Issue Date" s = "select * from studentissue" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5)) ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(6))) Next End If End If End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
'Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated ' If bol = "issue" Then ' TextBox1.Text = col ' TextBox3.Text = col1 ' TextBox2.Text = col2 ' TextBox9.Text = col3 ' TextBox4.Text = col4 ' TextBox5.Text = col5 ' TextBox10.Text = col6 ' DateTimePicker1.Value = col7 ' End If ' bol = "" 'End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If Not TextBox1.Text = "" Then s = "select * from studentissue where cardno='" & Trim(TextBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Library card number not found", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub Else TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox4.Text = ds.Tables(0).Rows(0)(3) TextBox5.Text = ds.Tables(0).Rows(0)(4) End If End If If Not TextBox2.Text = "" Then s = "select * from studentissue where bookid='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Book ID not found", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub Else TextBox9.Text = ds.Tables(0).Rows(0)(5)
TextBox10.Text = ds.Tables(0).Rows(0)(6) DateTimePicker1.Value = ds.Tables(0).Rows(0)(7) End If End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Then MsgBox("Incomple information", MsgBoxStyle.Exclamation) TextBox1.Focus() Exit Sub End If 's = "select * from studentissue where cardno='" & Trim(TextBox1.Text) & "' and bookid='" & Trim(TextBox2.Text) & "' and sname='" & Trim(TextBox3.Text) & "' and class='" & Trim(TextBox4.Text) & "' and rollno='" & Trim(TextBox5.Text) & "' and bname='" & Trim(TextBox9.Text) & "' and issuedate='" & DateValue(Trim(TextBox10.Text)) & "'" s = "select * from studentissue where cardno='" & Trim(TextBox1.Text) & "'and bookid='" & Trim(TextBox2.Text) & "' and sname='" & Trim(TextBox3.Text) & "' and class='" & Trim(TextBox4.Text) & "' and rollno='" & Trim(TextBox5.Text) & "' and bname='" & Trim(TextBox9.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Record not found", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub End If f1 = DateDiff(DateInterval.Day, DateValue(ds.Tables(0).Rows(0)(7)), DateValue(DateTimePicker1.Value)) If f1 > 0 Then f1 = f1 * 2 Else f1 = 0 End If TextBox12.Text = f1 s = "delete from studentissue where bookid='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Book return" & ControlChars.CrLf & "Fine::" & f1, MsgBoxStyle.Information)
ListView1.Items.Clear() s = "select * from studentissue" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5)) ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(6))) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(4)) Next End If End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() 'TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged On Error Resume Next TextBox1.Text = ListView1.SelectedItems(0).Text TextBox3.Text = ListView1.SelectedItems(0).SubItems(1).Text TextBox2.Text = ListView1.SelectedItems(0).SubItems(2).Text TextBox9.Text = ListView1.SelectedItems(0).SubItems(3).Text TextBox10.Text = ListView1.SelectedItems(0).SubItems(4).Text TextBox4.Text = ListView1.SelectedItems(0).SubItems(5).Text TextBox5.Text = ListView1.SelectedItems(0).SubItems(6).Text f1 = DateDiff(DateInterval.Day, DateValue(ds.Tables(0).Rows(0)(7)), DateValue(DateTimePicker1.Value))
If f1 > 0 Then f1 = f1 * 2 Else f1 = 0 End If TextBox12.Text = f1 End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
End SubEnd Class
TEACHER ISSUE
Imports System.Data.OleDbPublic Class Form3 Inherits System.Windows.Forms.Form
Dim nm, dr As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If Not TextBox2.Text = "" Then s = "select * from teacher where teacher_id ='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Invalid Teacher ID", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub Else TextBox5.Text = ds.Tables(0).Rows(0)(1) TextBox4.Text = ds.Tables(0).Rows(0)(2) End If End If If Not TextBox1.Text = "" Then s = "select bname from book where bookid='" & Trim(TextBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Invalid Book ID", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub Else TextBox7.Text = ds.Tables(0).Rows(0)(0) End If End If End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click On Error Resume Next TextBox1.Clear() TextBox2.Clear() TextBox4.Clear() TextBox5.Clear() TextBox7.Clear() End Su Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next Me.Size = New Size(800, 600) Me.Location = New Point(80, 25) DateTimePicker1.Value = Today bol = "book" ListView1.Items.Clear() ListView1.Columns(0).Text = "Book ID" ListView1.Columns(1).Text = "Book Name" ListView1.Columns(2).Text = "Author Name" ListView1.Columns(3).Text = "Publisher" s = "select bookid,bname,aname,publisher from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox4.Text = "" Then MsgBox("Incomplete Informaton", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub End If s = "select * from teacher where teacher_id='" & Trim(TextBox2.Text) & "'and firstname='" & Trim(TextBox4.Text) & "'and department='" & Trim(TextBox5.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Teacher record not matched", MsgBoxStyle.Exclamation) TextBox1.Focus() Exit Sub End If s = "select bookid,bname from book where bookid='" & Trim(TextBox1.Text) & "'and bname='" & Trim(TextBox7.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Book record not found", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub End If s = "select bookid from studentissue where bookid='" & Trim(TextBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then MsgBox("Cannot Issue" & ControlChars.CrLf & "Select Book already issue to another student", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub End If s = "select book_id from teacherissue where book_id='" & Trim(TextBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot Issue" & ControlChars.CrLf & "Select Book already issue to another teacher", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub End If dr = Format(DateAdd(DateInterval.Day, 14, DateTimePicker1.Value), "dd/MMMM/yyyy") s = "insert into teacherissue values('" & Trim(TextBox1.Text) & "','" & Trim(TextBox2.Text) & "','" & Trim(TextBox4.Text) & "','" & Trim(TextBox5.Text) & "','" & DateTimePicker1.Value & "','" & Trim(TextBox7.Text) & "')" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Book Issued" & ControlChars.CrLf & "Date of Issue:" & Format(DateTimePicker1.Value, "dd/MMM/yyyy") & ControlChars.CrLf & "Date of Return:" & dr, MsgBoxStyle.Information) End Sub
Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.DoubleClick On Error Resume Next Label5.Text = "Book Record" bol = "book" ListView1.Items.Clear() ListView1.Columns(0).Text = "Book ID" ListView1.Columns(1).Text = "Book Name" ListView1.Columns(2).Text = "Author Name" ListView1.Columns(3).Text = "Publisher" s = "select bookid,bname,aname,publisher from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress On Error Resume Next If Asc(e.KeyChar) = 13 Then bol = "book"
Label5.Text = "Book Record" ListView1.Items.Clear() ListView1.Columns(0).Text = "Book ID" ListView1.Columns(1).Text = "Book Name" ListView1.Columns(2).Text = "Author Name" ListView1.Columns(3).Text = "Publisher" s = "select bookid,bname,aname,publisher from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) Next End If End If End Sub
Private Sub TextBox2_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.DoubleClick On Error Resume Next Label5.Text = "Teacher Record" bol = "tea" ListView1.Items.Clear() ListView1.Columns(0).Text = "Teacher ID" ListView1.Columns(1).Text = "Deparment" ListView1.Columns(2).Text = "Teacher Name" ListView1.Columns(3).Text = "" s = "select * from teacher" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) Next End If End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged On Error Resume Next
If bol = "tea" Then TextBox2.Text = ListView1.SelectedItems(0).Text TextBox5.Text = ListView1.SelectedItems(0).SubItems(1).Text TextBox4.Text = ListView1.SelectedItems(0).SubItems(2).Text Else TextBox1.Text = ListView1.SelectedItems(0).Text TextBox7.Text = ListView1.SelectedItems(0).SubItems(1).Text End If End SubEnd Class
TEACHER RETURN
Imports System.Data.OleDbPublic Class Form4 Inherits System.Windows.Forms.Form
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() End Sub
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next ListView1.Columns(0).Text = "Book ID" ListView1.Columns(1).Text = "Teacher ID" ListView1.Columns(2).Text = "Name" ListView1.Columns(3).Text = "Department" ListView1.Columns(4).Text = "Issue Date" ListView1.Columns(5).Text = "Book Name" s = "select * from teacherissue" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) ListView1.Items(i).SubItems.Add((ds.Tables(0).Rows(i)(4))) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5)) Next End If End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged On Error Resume Next ComboBox1.Text = ListView1.SelectedItems(0).Text ComboBox2.Text = ListView1.SelectedItems(0).SubItems(1).Text TextBox4.Text = ListView1.SelectedItems(0).SubItems(2).Text TextBox5.Text = ListView1.SelectedItems(0).SubItems(3).Text TextBox6.Text = Format(DateValue(ListView1.SelectedItems(0).SubItems(4).Text), "dd/MMM/yyyy") TextBox7.Text = ListView1.SelectedItems(0).SubItems(5).Text End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next If TextBox4.Text = "" Or TextBox6.Text = "" Or TextBox5.Text = "" Or TextBox7.Text = "" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Then MsgBox("Incomple information", MsgBoxStyle.Exclamation) ComboBox1.Focus() Exit Sub End If s = "select * from teacherissue where book_id='" & Trim(ComboBox1.Text) & "'and teacher_id='" & Trim(ComboBox2.Text) & "' and teacher_name='" & Trim(TextBox4.Text) & "' and book_name='" & Trim(TextBox7.Text) & "' and department='" & Trim(TextBox5.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Record not found", MsgBoxStyle.Information) ComboBox1.Focus() Exit Sub End If s = "delete from teacherissue where book_id='" & Trim(ComboBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Book return", MsgBoxStyle.Information)
ListView1.Items.Clear() s = "select * from teacherissue" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ListView1.Items.Add(ds.Tables(0).Rows(i)(0)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2)) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3)) ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(4))) ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5))
Next End If End SubEnd Class
ADD NEW BOOK
Imports System.Data.OleDbPublic Class Form5 Inherits System.Windows.Forms.Form
Dim max As Short, bid As String, id As String
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next Me.Location = New Point(50, 20) maxid() TextBox7.Text = Today TextBox8.Text = TimeOfDay End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear()
TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() TextBox7.Text = Today TextBox8.Text = TimeOfDay maxid() End Sub
Public Sub maxid() On Error Resume Next s = "select max(id) from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then If IsDBNull(ds.Tables(0).Rows(0)(0)) = False Then max = ds.Tables(0).Rows(0)(0) Else max = 0 End If Else max = 0 End If max = max + 1 If max < 10 Then bid = "BID-0" & max Else bid = "BID-" & max End If TextBox1.Text = bid End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "" Or TextBox2.Text = "" Then MsgBox("empty") Exit Sub End If For i = 0 To Val(TextBox10.Text) - 1 s = "insert into book values('" & bid & "','" & Trim(TextBox2.Text) & "','" & Trim(TextBox3.Text) & "','" & Trim(TextBox4.Text) & "','" & Trim(TextBox5.Text) & "','" & Trim(TextBox6.Text) & "','" & Trim(TextBox7.Text) & "','" & Trim(TextBox8.Text) & "','" & Trim(TextBox9.Text) & "','" & Trim(TextBox10.Text) & "'," & max & ")" da = New OleDbDataAdapter(s, dc)
ds = New DataSet() da.Fill(ds) max = max + 1 bid = "BID-0" & max Next MsgBox("books added", MsgBoxStyle.Information) maxid() End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged
End Sub
Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged
End Sub
Private Sub TextBox10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox10.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox9_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End SubEnd ClassDELETE BOOK
Imports System.Data.OleDbPublic Class Form6 Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next s = "select bookid from studentissue where bookid='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then MsgBox("Cannot delete Book is issued", MsgBoxStyle.Information) Exit Sub End If s = "select book_id from teacherissue where book_id='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then MsgBox("Cannot delete Book is issued", MsgBoxStyle.Information) Else s = "delete from book where bookid='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet()
da.Fill(ds) MsgBox("Book deleted", MsgBoxStyle.Information) End If End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged On Error Resume Next s = "select * from book where bookid='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) TextBox2.Text = ds.Tables(0).Rows(0)(1) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox4.Text = ds.Tables(0).Rows(0)(3) TextBox5.Text = ds.Tables(0).Rows(0)(4) TextBox6.Text = ds.Tables(0).Rows(0)(5) TextBox7.Text = ds.Tables(0).Rows(0)(6) TextBox8.Text = ds.Tables(0).Rows(0)(7) TextBox9.Text = ds.Tables(0).Rows(0)(8) TextBox10.Text = ds.Tables(0).Rows(0)(9) End Sub
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next s = "select bookid from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox1.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next TextBox2.Clear() TextBox3.Clear()
TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox9.Clear() TextBox10.Clear() End SubEnd Class
ADD STUDENT
Imports System.Data.OleDbPublic Class Form8 Inherits System.Windows.Forms.Form
Dim gen As String, max As Short, card As String
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click On Error Resume Next If TextBox20.Text = "" Or TextBox21.Text = "" Or TextBox18.Text = "" Or _ ComboBox4.Text = "" Or RichTextBox1.Text = "" Or TextBox16.Text = "" Then MsgBox("Incomplete Information", MsgBoxStyle.Information) TextBox21.Focus() Exit Sub End If If RadioButton1.Checked = True Then gen = "male" Else gen = "female" End If s = "insert into student values('" & Trim(TextBox21.Text) & "','" & TextBox12.Text & "','" & TextBox20.Text & "','" & ComboBox4.Text & "','" & gen & "','" & TextBox18.Text & "','" & TextBox16.Text & "','" & RichTextBox1.Text & "','" & TextBox15.Text & "','" & TextBox14.Text & "','" & TextBox11.Text & "'," & max & ")" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Student Record added", MsgBoxStyle.Information) Button5.PerformClick() maxno() End Sub
Public Sub maxno() On Error Resume Next s = "select max(cno) from student"
da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then If IsDBNull(ds.Tables(0).Rows(0)(0)) = False Then max = ds.Tables(0).Rows(0)(0) Else max = 0 End If Else max = 0 End If max = max + 1 If max < 10 Then card = "LBM-0" & max Else card = "LBM-" & max End If TextBox12.Text = card End Sub Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next Me.Location = New Point(100, 20) maxno() End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click On Error Resume Next TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() TextBox21.Clear() TextBox20.Clear() TextBox18.Clear()
TextBox14.Clear() TextBox11.Clear() ComboBox4.Text = "" RichTextBox1.Clear() TextBox16.Clear() TextBox15.Clear() TextBox21.Focus() End Sub
Private Sub TextBox21_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox21.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox15_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox15.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox14_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox14.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox20_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox20.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox16_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox16.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox18_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox18.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True
End If End SubEnd Class
DELETE STUDENT
mports System.Data.OleDbPublic Class Form9 Inherits System.Windows.Forms.Form
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub
Private Sub Form9_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next Me.Location = New Point(80, 20) s = "select rollno from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox3.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If s = "select cardno from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox4.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next s = "select rollno from student where rollno='" & ComboBox3.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then MsgBox("Cannot delete student", MsgBoxStyle.Information)
Else s = "delete from student where bookid='" & ComboBox3.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Student deleted", MsgBoxStyle.Information) End If End Sub
Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged On Error Resume Next s = "select * from student where rollno ='" & ComboBox3.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds)
ComboBox4.Text = ds.Tables(0).Rows(0)(1) TextBox2.Text = ds.Tables(0).Rows(0)(3) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox1.Text = ds.Tables(0).Rows(0)(4) TextBox5.Text = ds.Tables(0).Rows(0)(5) RichTextBox1.Text = ds.Tables(0).Rows(0)(7) TextBox7.Text = ds.Tables(0).Rows(0)(6) TextBox8.Text = ds.Tables(0).Rows(0)(8) TextBox9.Text = ds.Tables(0).Rows(0)(9) TextBox10.Text = ds.Tables(0).Rows(0)(10) End Sub
Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged On Error Resume Next s = "select * from student where cardno ='" & ComboBox4.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds)
ComboBox3.Text = ds.Tables(0).Rows(0)(0) TextBox2.Text = ds.Tables(0).Rows(0)(3) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox1.Text = ds.Tables(0).Rows(0)(4) TextBox5.Text = ds.Tables(0).Rows(0)(5) RichTextBox1.Text = ds.Tables(0).Rows(0)(7) TextBox7.Text = ds.Tables(0).Rows(0)(6) TextBox8.Text = ds.Tables(0).Rows(0)(8) TextBox9.Text = ds.Tables(0).Rows(0)(9)
TextBox10.Text = ds.Tables(0).Rows(0)(10) End SubEnd Class
ADD TEACHER
Imports System.Data.OleDbPublic Class Form10 Inherits System.Windows.Forms.Form
Dim gen As String, max As Short, card As String
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub
Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label12.Click
End Sub
Private Sub Form10_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load maxno() End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next TextBox2.Clear() ' TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() End Sub
Public Sub maxno() On Error Resume Next s = "select max(cno) from teacher" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then If IsDBNull(ds.Tables(0).Rows(0)(0)) = False Then
max = ds.Tables(0).Rows(0)(0) Else max = 0 End If Else max = 0 End If max = max + 1 If max < 10 Then card = "TID-0" & max Else card = "TID-" & max End If TextBox1.Text = card End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If RadioButton1.Checked = True Then gen = "male" Else gen = "female" End If If TextBox7.Text = "" Then TextBox7.Text = "NULL" End If If TextBox8.Text = "" Then TextBox8.Text = "NULL" End If If TextBox9.Text = "" Then TextBox9.Text = "NULL" End If s = "insert into teacher values('" & TextBox1.Text & "','" & ComboBox1.Text & "','" & TextBox2.Text & "','" & gen & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "'," & max & ")" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Teacher record added", MsgBoxStyle.Information) maxno() End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox6_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox8.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox9_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End SubEnd ClassDELETE TEACHER
Imports System.Data.OleDbPublic Class Form11 Inherits System.Windows.Forms.Form
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next s = "select teacher_id from teacherissue where teacher_id='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then MsgBox("Cannot delete Teacher" & ControlChars.CrLf & "Book is issued to Teacher", MsgBoxStyle.Information) Else s = "delete from teacher where teacher_id='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Teacher deleted", MsgBoxStyle.Information) End If End Sub Private Sub Form11_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next s = "select teacher_id from teacher" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox1.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged On Error Resume Next
s = "select * from teacher where teacher_id ='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) TextBox1.Text = ds.Tables(0).Rows(0)(1) TextBox2.Text = ds.Tables(0).Rows(0)(2) TextBox3.Text = ds.Tables(0).Rows(0)(3) TextBox10.Text = ds.Tables(0).Rows(0)(4) TextBox4.Text = ds.Tables(0).Rows(0)(5) TextBox5.Text = ds.Tables(0).Rows(0)(6) TextBox6.Text = ds.Tables(0).Rows(0)(7) TextBox7.Text = ds.Tables(0).Rows(0)(8) TextBox8.Text = ds.Tables(0).Rows(0)(9) TextBox9.Text = ds.Tables(0).Rows(0)(10) End SubEnd ClassCHANGE PASSWORDImports System.Data.OleDbPublic Class Form14 Inherits System.Windows.Forms.Form Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If TextBox1.Text = "" Or TextBox2.Text = "" Or ComboBox1.Text = "" Then MsgBox("Incomplete Information", MsgBoxStyle.Information) Exit Sub End If If Len(TextBox3.Text) < 6 Then MsgBox("Password should be atleast six characters", MsgBoxStyle.Information) TextBox3.Focus() Exit Sub End If s = "select * from login where username='" & Trim(TextBox1.Text) & "'and pass='" & Trim(TextBox2.Text) & "'and type='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then If TextBox3.Text = TextBox4.Text Then s = "update login set pass='" & TextBox3.Text & "' where username='" & Trim(TextBox1.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Password changed", MsgBoxStyle.OKOnly) Else MsgBox("Password not Matched", MsgBoxStyle.Information) TextBox3.Focus() Exit Sub End If Else MsgBox("Record not Found", MsgBoxStyle.Information) Exit Sub End If End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub Form14_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next ComboBox1.Items.Clear() If us = "ad" Then ComboBox1.Items.Add("Administrator") ComboBox1.Items.Add("User") Else ComboBox1.Items.Add("User") End If End SubEnd ClassUSER LOGINImports System.Data.OleDbPublic Class Form15 Inherits System.Windows.Forms.Form Private Sub Form15_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.Text = "Administrator" End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If TextBox1.Text = "" Or TextBox2.Text = "" Or ComboBox1.Text = "" Then
MsgBox("Incomplete Information", MsgBoxStyle.Information) Exit Sub End If s = "select * from login where username='" & Trim(TextBox1.Text) & "'and pass='" & Trim(TextBox2.Text) & "'and type='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then If ComboBox1.Text = "Administrator" Then us = "ad" Else us = "user" End If Me.Hide() Dim f As New Form7() f.ShowDialog() Else MsgBox("Invalid user name or password or type", MsgBoxStyle.Information) End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End SubEnd ClassEDIT STUDENT
Imports System.Data.OleDbPublic Class Form16 Inherits System.Windows.Forms.FormPrivate Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox5.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() RichTextBox1.Clear() End Sub
Private Sub Form16_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next s = " select rollno from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox3.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If s = " select cardno from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox4.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If End Sub
Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged On Error Resume Next s = "select * from student where rollno ='" & ComboBox3.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) ComboBox4.Text = ds.Tables(0).Rows(0)(1) RichTextBox1.Text = ds.Tables(0).Rows(0)(7) TextBox1.Text = ds.Tables(0).Rows(0)(4) TextBox2.Text = ds.Tables(0).Rows(0)(3) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox5.Text = ds.Tables(0).Rows(0)(5) TextBox7.Text = ds.Tables(0).Rows(0)(6) TextBox8.Text = ds.Tables(0).Rows(0)(8) TextBox9.Text = ds.Tables(0).Rows(0)(9) TextBox10.Text = ds.Tables(0).Rows(0)(10) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next s = " update student set sname = '" & TextBox3.Text & "', gender = '" & TextBox1.Text & "', class = '" & TextBox2.Text & "', city = '" & TextBox5.Text
& "',distt = '" & TextBox7.Text & "',phoneno = '" & TextBox8.Text & "', mobileno = '" & TextBox9.Text & "', email = '" & TextBox10.Text & "', address = '" & RichTextBox1.Text & "' where rollno = '" & ComboBox3.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Student Record Updated", MsgBoxStyle.Information) End Sub Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged On Error Resume Next s = "select * from student where cardno ='" & ComboBox4.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) ComboBox3.Text = ds.Tables(0).Rows(0)(0) RichTextBox1.Text = ds.Tables(0).Rows(0)(7) TextBox1.Text = ds.Tables(0).Rows(0)(4) TextBox2.Text = ds.Tables(0).Rows(0)(3) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox5.Text = ds.Tables(0).Rows(0)(5) TextBox7.Text = ds.Tables(0).Rows(0)(6) TextBox8.Text = ds.Tables(0).Rows(0)(8) TextBox9.Text = ds.Tables(0).Rows(0)(9) TextBox10.Text = ds.Tables(0).Rows(0)(10) End Sub Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox9_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox8.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End SubEnd ClassEDIT TEACHERImports System.Data.OleDbPublic Class Form17 Inherits System.Windows.Forms.FormPrivate Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next s = " update teacher set department = '" & TextBox1.Text & "', firstname = '" & TextBox2.Text & "', gender = '" & TextBox10.Text & "', address = '" & TextBox4.Text & "', city = '" & TextBox5.Text & "', distt = '" & TextBox6.Text & "', e_mail = '" & TextBox7.Text & "', phnumber = '" & TextBox8.Text & "', mobnumber = '" & TextBox9.Text & "' where teacher_id = '" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Teacher Record Updated", MsgBoxStyle.Information) End Sub
Private Sub Form17_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next s = "select teacher_id from teacher" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox1.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged On Error Resume Next s = "select * from teacher where teacher_id ='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) TextBox1.Text = ds.Tables(0).Rows(0)(1) TextBox2.Text = ds.Tables(0).Rows(0)(2) 'TextBox3.Text = ds.Tables(0).Rows(0)(3) TextBox10.Text = ds.Tables(0).Rows(0)(3) TextBox4.Text = ds.Tables(0).Rows(0)(4) TextBox5.Text = ds.Tables(0).Rows(0)(5) TextBox6.Text = ds.Tables(0).Rows(0)(6) TextBox7.Text = ds.Tables(0).Rows(0)(7) TextBox8.Text = ds.Tables(0).Rows(0)(8) TextBox9.Text = ds.Tables(0).Rows(0)(9) End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If
End Sub Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox6_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox10.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox8.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub
Private Sub TextBox9_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End SubEnd ClassEDIT BOOKImports System.Data.OleDbPublic Class Form18 Inherits System.Windows.Forms.Form Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() TextBox9.Clear() End Sub
Private Sub Form18_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next s = "select bookid from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then For i = 0 To ds.Tables(0).Rows.Count - 1 ComboBox1.Items.Add(ds.Tables(0).Rows(i)(0)) Next End If End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged On Error Resume Next s = "select * from book where bookid='" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) TextBox2.Text = ds.Tables(0).Rows(0)(1) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox4.Text = ds.Tables(0).Rows(0)(3) TextBox5.Text = ds.Tables(0).Rows(0)(4) TextBox6.Text = ds.Tables(0).Rows(0)(5) TextBox7.Text = ds.Tables(0).Rows(0)(6) TextBox8.Text = ds.Tables(0).Rows(0)(7) TextBox9.Text = ds.Tables(0).Rows(0)(8) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next s = " update book set bname = '" & TextBox2.Text & "', aname = '" & TextBox3.Text & "', publisher = '" & TextBox4.Text & "',cost = '" & TextBox5.Text & "', edition = '" & TextBox6.Text & "', almirah = '" & TextBox9.Text & "' where bookid = '" & ComboBox1.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("Book Record Updated", MsgBoxStyle.Information) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then e.Handled = True End If End Sub Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End Sub Private Sub TextBox9_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then e.Handled = True End If End SubEnd ClassVIEW RECORDSImports System.Data.OleDbPublic Class Form19 Inherits System.Windows.Forms.Form Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next s = "select * from book" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) DataGrid1.DataSource = ds DataGrid1.DataMember = ds.Tables(0).ToString End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click On Error Resume Next s = "select * from student" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) DataGrid1.DataSource = ds DataGrid1.DataMember = ds.Tables(0).ToString End Sub Private Sub Form19_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click On Error Resume Next s = "select * from teacher" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) DataGrid1.DataSource = ds DataGrid1.DataMember = ds.Tables(0).ToString End SubEnd ClassSTUDENT SEARCHImports System.Data.OleDbPublic Class Form20 Inherits System.Windows.Forms.Form Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox2.Focus() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If Not TextBox2.Text = "" Then s = "select * from student where rollno ='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc)
ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Name not exists", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub Else TextBox1.Text = ds.Tables(0).Rows(0)(2) TextBox3.Text = ds.Tables(0).Rows(0)(3) TextBox4.Text = ds.Tables(0).Rows(0)(1) TextBox5.Text = ds.Tables(0).Rows(0)(7) End If End If If Not TextBox4.Text = "" Then s = "select * from student where cardno ='" & Trim(TextBox4.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Name not exists", MsgBoxStyle.Information) TextBox4.Focus() Exit Sub Else TextBox1.Text = ds.Tables(0).Rows(0)(2) TextBox3.Text = ds.Tables(0).Rows(0)(3) TextBox2.Text = ds.Tables(0).Rows(0)(0) TextBox5.Text = ds.Tables(0).Rows(0)(7) End If End If End Sub Private Sub Form20_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End SubEnd Class
TEACHER SEARCHImports System.Data.OleDbPublic Class Form21 Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear()
TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If Not TextBox2.Text = "" Then s = "select * from teacher where teacher_id='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox("Invalid Library card number", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub Else TextBox1.Text = ds.Tables(0).Rows(0)(2) TextBox3.Text = ds.Tables(0).Rows(0)(1) TextBox4.Text = ds.Tables(0).Rows(0)(5) TextBox5.Text = ds.Tables(0).Rows(0)(6) TextBox6.Text = ds.Tables(0).Rows(0)(8) TextBox7.Text = ds.Tables(0).Rows(0)(9) TextBox8.Text = ds.Tables(0).Rows(0)(10) End If End If End Sub
Private Sub Form21_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End SubEnd Class
BOOK SEARCHImports System.Data.OleDbPublic Class Form22 Inherits System.Windows.Forms.Form Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear()
TextBox8.Clear() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If Not TextBox2.Text = "" Then s = "select * from book where bookid ='" & Trim(TextBox2.Text) & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count <= 0 Then MsgBox(" Teacher not exists", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub Else TextBox1.Text = ds.Tables(0).Rows(0)(1) TextBox3.Text = ds.Tables(0).Rows(0)(2) TextBox4.Text = ds.Tables(0).Rows(0)(3) TextBox5.Text = ds.Tables(0).Rows(0)(4) TextBox6.Text = ds.Tables(0).Rows(0)(5) TextBox7.Text = ds.Tables(0).Rows(0)(8) TextBox8.Text = ds.Tables(0).Rows(0)(9) End If End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub Form22_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End SubEnd ClassDELETE USERImports System.Data.OleDbPublic Class Form23 Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox1.Focus() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next
If TextBox1.Text = "" Or ComboBox1.Text = "" Then MsgBox("Incomplete Information", MsgBoxStyle.Information) Exit Sub End If s = "select * from login where username='" & Trim(TextBox1.Text) & "'and pass='" & TextBox2.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then s = "delete from login where username='" & Trim(TextBox1.Text) & "'and pass='" & TextBox2.Text & "'" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("User Deleted", MsgBoxStyle.Information)
Else MsgBox("Invalid user name or password or type", MsgBoxStyle.Information) End If End Sub
Private Sub Form23_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next ComboBox1.Items.Clear() If us = "ad" Then ComboBox1.Items.Add("Administrator") ComboBox1.Items.Add("User") Else ComboBox1.Items.Add("User") End If End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End SubEnd Class
CREATE NEW PASSWORD
Imports System.Data.OleDbPublic Class Form24 Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error Resume Next If TextBox1.Text = "" Or TextBox2.Text = "" Then MsgBox("Incomplete Information", MsgBoxStyle.Information) TextBox1.Focus() Exit Sub End If If Len(TextBox2.Text) < 6 Then MsgBox("Password should be atleast six characters", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub End If If Not TextBox2.Text = TextBox3.Text Then MsgBox("Passwprd not matched", MsgBoxStyle.Information) TextBox2.Focus() Exit Sub End If s = "insert into login values('" & Trim(TextBox1.Text) & "','" & Trim(TextBox2.Text) & "','" & Trim(ComboBox1.Text) & "')" da = New OleDbDataAdapter(s, dc) ds = New DataSet() da.Fill(ds) MsgBox("User added", MsgBoxStyle.Information) End Sub
Private Sub Form24_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next ComboBox1.Items.Clear() If us = "ad" Then ComboBox1.Items.Add("Administrator") ComboBox1.Items.Add("User") Else ComboBox1.Items.Add("User") End If End SubEnd Class
LOADING FORM
Public Class Form25 Inherits System.Windows.Forms.Form
Dim i As Integer Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick On Error Resume Next i = i + 1 ProgressBar1.Value = ProgressBar1.Value + 10 If i = 10 Then Timer1.Enabled = False Me.Hide() Dim f As New Form15() f.ShowDialog() End If End Sub
Private Sub Form25_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next PictureBox1.Image = Image.FromFile("2.jpg") End SubEnd Class
ADD BOOK
ADD STUDENT
ADD TEACHER
ADD USER
SEARCH BOOK
CHANGE PASSWORD
DELETE BOOK
DELETE STUDENT
DELETE TEACHER
DELETE USER
EDIT BOOK
EDIT STUDENT
STUDENT ISSUE
STUDENT RETURN
STUDENT SEARCH
TEACHER ISSUE
USER LOGIN
VIEW RECORDS