52
Book Shop Management The National Degree College Basavanagudi Page 1 PROJECT OVERVIEW Problem Definition: The main aim of the project entitled “BOOK SHOP MANAGEMENT” is to provide an application for the book shop. This project is developed with four layers, which are: 1. Security 2. Employee Details 3. Book Details 4. Maintenance of Sales and Purchase Problem Description: 1. Security: in manual book keeping all the entries are basically done through entry in the books, where chances of manipulation are more but in this project the records maintained are more secure as an outsider cannot manipulate the database without knowing the password. 2. Employee Details: This project provides a provision for maintaining the employee database apart from the maintenance of Book Database. 3. Book Details: The information regarding books i.e., book name, author, publication etc., are provided for the customers for their convenience. As this process is computerized it is easy for the owner to update the list where this process would have been difficult if he had maintained the records manually. 4. Maintenance of Sales and Purchase: All the Sales and purchases made by the owner can be recorded in the separate database provided by this tool, which would be helpful for him in the future for the development of his establishment.

Book Shop Documentation

Embed Size (px)

Citation preview

Page 1: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 1

PROJECT OVERVIEW

Problem Definition:

The main aim of the project entitled “BOOK SHOP MANAGEMENT” is to provide an

application for the book shop.

This project is developed with four layers, which are:

1. Security

2. Employee Details

3. Book Details

4. Maintenance of Sales and Purchase

Problem Description:

1. Security: in manual book keeping all the entries are basically done through entry in

the books, where chances of manipulation are more but in this project the records

maintained are more secure as an outsider cannot manipulate the database without

knowing the password.

2. Employee Details: This project provides a provision for maintaining the employee

database apart from the maintenance of Book Database.

3. Book Details: The information regarding books i.e., book name, author, publication

etc., are provided for the customers for their convenience. As this process is

computerized it is easy for the owner to update the list where this process would have

been difficult if he had maintained the records manually.

4. Maintenance of Sales and Purchase: All the Sales and purchases made by the owner

can be recorded in the separate database provided by this tool, which would be helpful

for him in the future for the development of his establishment.

Page 2: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 2

Components of Existing and Proposed System

Existing System Proposed System

People

Project Manager creates word file after

the initial project meeting

Project Manager emails tasks to specific

contractors

Project Manager never knows if tasks

have been completed and must call or

email the contractors multiple times to

check task statuses

Project Manager may forget pending tasks

brought up at initial meeting; only tasks remembered at subsequent meetings are

followed up

Project Manager creates project using new

Web-based system

Project Manager uses the system to email

tasks to specific contractors

Contractors use link in email to get to

project page and check their assigned

tasks

Contractors use the new system to show

that their task has been completed, or to

show that their task has not been completed and give reasons for this

Project Manager logs into the new system

and checks that status of each projects‟

assigned tasks

Managers can log-in to the system and create/view reports

Data

Vendor data, contractor data, project data,

task data, subtask data

Vendor data, contractor data, project data,

task data, subtask data

Information

None Project task reports showing outstanding

tasks and reasons for being outstanding

Project task reports will also show counts

of how many e-mail notifications have

been sent and how long overdue tasks are

past deadlines

Project task reports need to have sorting

feature

Software Functions

Used to create project files that shows

assigned tasks in an organized manner

Username and password verification for

Project Managers only

Randomly generated log-in key for

contractors to only see their assigned

project tasks

Task status and reasons are stored based

on actions taken by contractors on their project task pages

Hardware

Workstations

Printers

Monitors

Workstations

Printers

Monitors

Leased server space

Page 3: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 3

VISUAL BASIC

Introduction:

Visual basic 6.0(VB 6.0) is the recent addition to the family of Microsoft Visual

Studio. VB 6.0 is specifically designed to utilize the internet. User can easily create Web-

based application called ActiveX executables, which are similar to Internet Explorer 4.0

or higher Web Browsers. VB 6.0 supports ADO (Active X Data Objects), DHTML & IIS

(Internet Information Services), and ISAPI‟s (Internet Server API). The formatting, string,

numeric functions and new validates events for input controls increase learning rate of a

novice programmer Today, VB 6.0 has become technology leader, implementing original

ways of doing things before any other visual programming development tools.

History of Visual Basic:

Earlier versions of VB (1.0&2.0) were considered as “Hobbyist„s language” had limited

features & dismal performance compared to applications written in other language like C.

VB 3.0 became much more database friendly and MS Jet engine was introduced along with

MS Access Databases.

VB 4.0 supported 32-bit programs; OCX or ActiveX & DDL were introduced along with

more powerful Jet engine.

VB5.0 was the first version of VB, which provides a native code compiler. i.e. generates

Machine code. It also supports ActiveX Documents, ActiveX DLL‟s

Power of VB 6.0:-

VB is an Event-driven programming language, in which the user will have full

control over the execution of the program i.e. the user can click a desired button or

any other control tool to invokes an event, which instantly executes the code

within that event procedure by the computer.

VB is by far the most popular Visual programming tool in existence.

Microsoft estimates they there are more than 3,000,000 VB programmers.

Page 4: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 4

VB was the first programming language, which pr0vides Drag-and-drop interface

design to the general programmer.

VB PROVIDES Intelligence (The Visual Basic Text editor uses Intelligence to

make writing your code easier and more error-free. IntelliSense options

Include Statement Completion, which provides quick access to valid member

function or variables, including global, via the Members list. Selecting from the

list inserts the member into your code) Integrated Development Environment.

VB is unexcelled for RAP (Rapid Application Development) through its new Data

Environment and Data Report facilities specially meant for hierarchical database

organization & new wizards like Package and Development wizard and

Deployment wizard and Data Object generators wizards enables the users to easily

create setup programs and archives for the distribution of VB applications&

components & middle tier objects that are bound to User Controls & Data

Environments.

Visual Basic is not a case sensitive language & if the variables are not

System requirements for Visual Basic 6.0 Programming:-

Windows 95/NT4.0 or higher environment 32MB+ RAM 1 GB hard disk or capacity Color monitor (preferably) CD-ROM drive (Visual studio is available only on CD-ROM ) Mouse or any other Pointing Device

Creating Control arrays:

A control array is a group of controls that share the same name, type and same event

procedure. A control array should satisfy the following properties:

Contains at least one element and grow to as many elements as required by the

application.

It may contain up to 32767 elements.

Each control has a unique index.

Page 5: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 5

There are three ways to create a control array at design time:

1. Assign the same name to more than one control.

2. Copy an existing control and then paste it onto the form.

3. Set the control‟s index property to a value that is not Null.

Data Access Objects (DAO):

Data Access Object was the first object-oriented interface that exposed the Microsoft Jet

database engine and allowed Visual Basic developers to directly connect to access tables as

well as other databases through ODBC. DAO is suited for either single-system application or

for small, local deployments

The General Characteristics of DAO are:

1. Difficulty in coding

2. Flexibility, with facilities to access many different Data sources.

3. Adequate-to-slow performance.

4. Dynamic Data Language (DDl) functionality.

5. Support for complex cursors

To create a new data report:

To create a new data report with the data report designer, a simple project that was created

earlier with the Data Environment designer will be used here. If the data report is not created

earlier, select project menu, click Add Data Report and visual basic will add the data

report to the project explorer window and display on the screen .If the designer is not on

the project menu, click Components, click the designer tab and then click Data Report to

add the designer to the menu.

On the properties window, click Data Source and then click Data Envirnoment1.then click

Student Table. Right –click the Data Report designer, a shortcut menu appear on the screen

and then click Retrieve Structure to retrieve all the field structures of the command object

student table to Header and other sections. The Data Report designer added a new group

section to the designer .Each group section has a one-to-one correspondence to a command

object in the data environment; in case the new group section corresponds to the student

table command object.

Page 6: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 6

MICROSOFT ACCESS

Databases are store –houses of information. For retrieving any information, we fall back on

databases. Herein comes the role of database management system which helps in systematic

organization of information. Amongst the many database management systems available in

the market, Access is quite useful and popular because of its unique features.

A database has many advantages. Many of the useful databases are those which can provide

latest information. The information in a database should be organized in such a way that it is

easy to update. And only then, it can quickly provide the information.

Any stored information or a database, whether electronic or manual, helps you by keeping

track of your inventories, payroll, invoicing or anything else that you consider important.

Defining a Database

A database is an organized collection of related information about a particular subject or

purpose; for example, information regarding the price of a book or the profile of an

individual in any organization. Consider, for instance, the example of a box full of index

cards carrying the names and prices of the books of a particular author.

In computers, a database is like a box containing index cards. The only is the difference is

that instead of index cards, a computer database is filled with records. While each index

card in the box contains information written in many lines, a record in a database contains all

the information related to an item in just one line. Information in a database is stores in rows

(records) and columns (fields), as shown below:

Column 1 Column 2 Column 3 Column 4

Field 1

BOOK NAME

Field 2

BOOK CODE

Field 3

AUTHOR

Field 4

PRICE

C PROGRAMMING 4521 P.B. KOTUR 150

VISUAL BASIC 4522 DIETAL & DIETAL 450

Table

Page 7: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 7

The names given to each column, i.e. BOOK NAME, BOOK CODE, AUTHOR and PRICE

are called field names. In the given database, the first record contains the information about

the book C-PROGRAMMING. The second record contains information about the book

VISUAL BASIC. In the above example, we have shown only two records. But in computers,

a database can contain large amount of information. Such type of database is called an

electronic database.

Thus, an electronic database is a collection of logically related information that you store in

your computer. It also acts like an assistant to you who is always ready to store, organize and

extract information.

RDBMS

A Relational Database Management system is defined as a method of viewing information

from several, separate databases that relate to one another through keywords or values. The

main advantage of a relational database management system is that you can simultaneously

use more than one database to see information stored in them.

Another advantage of relational database design is that you can extract fields from different

databases and see them on the screen at one time thus reducing the complexity.

Objects of a Relational Database

Microsoft Access is based on RDBMS. Therefore, to have better understandings of working

in Access, you should be familiar with four basic objects of RDBMS as described below:

RDBMS

Tables Queries Forms Reports

Tables

A Table is a collection of information on a specific topic. In a table, the information is stored

in rows and columns. You can store different types of data in different tables.

Page 8: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 8

Queries

Queries are a systematic way of retrieving information from a database.

Forms

Forms present the information stores in a database in an easy to use format. Through Forms,

you can view, enter or update information in a database, Forms present one record at a time

on the screen. But if you wish to enter or update information in your database.

Reports

Let us assume that you are in charge of maintaining the list food items in your company and

your boss has asked you to produce a report of the items which have a demand in the market.

In such a case, you can use the Reports feature to design the requires report in such a way

that it becomes easy for your boss to quickly understand all its details.

Decision making, keeping &

Analyzing information

Access Database Helps in Keeping track of information

Retrieving information easily

Creating any kind of reports

By keeping track of and

Analyzing information

Functions of a Database Management System (DBMS)

A database management system is a tool for managing information, stored in the database.

Managing a database includes the following functions:

Creating a Database

Modifying a Database

Adding Records in a Database

Deleting a Records in a Database

Selecting Records in a Database

Page 9: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 9

Brief History of SQL

SQL or Structured Query Language is the language used to talk to Relational Databases. The

Relational Database model for database design was invented by Dr.E.F. Cobb in 1969 and

published in Computer World in 1985.SQL was first implemented in 1974 at IBM the San

Jose Research Laboratory. SQL is essentially a non-procedural language that uses English-

like words to talk to a database. The American National Standards Institute (ANSI) is

continually updating their versions of SQL standards.

Page 10: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 10

SOFTWARE ENGINEERING

Software Engineering is a systematic approach to the development, operation, maintenance

and requirement of software. The basic goal of the software engineering is to provide high

quality software at low cost. The basic activity or phrases to be performed for developing a

software system are:

Requirement Analysis:

In this phase, the software engineers carry out a detailed study of user‟s requirements. The

emphasis in requirement analysis is on identifying what is needed from the system and how

the system will achieve the goal.

There are two main activities in this phase:

1. Problem Analysis: Here the analyst has to understand problem and its content.

2. Requirement Specification: It focuses on clearly specifying the requirement in a

document issues such as

Representation

Specification languages and

Tools

In most software projects, the requirement phase ends with a document describing all

requirements, which is called as Software Requirement Specification (SRS) document.

Software Design:

The purpose of the design phase is to specify the particular software system that will meet

the stated requirements. The design of a system is perhaps the most critical factor affecting

the quality of the software and has a major impact on later phase.

The design specifications that get generated at the end of this phase are technical in nature

and contain:

Page 11: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 11

1. User Interfaces

2. Databases and Data structures

3. Algorithms

The design activity is divided into two phases:

1. System Design: It is also called as top level design. It aims to identify the modules

that should be in the system, the specification of this module, and how they interact

with each other to produce the desired results

2. Detailed Design: During this phase, internal logic of each of the modules specified in

System Design is decided and further details of data structure and algorithmic design

of each of the modules is specified

Coding:

The goal of this phase is to translate design of the system into code in a give programming

language. The coding phase affects both testing and maintenance phase. If design is

performed in a detailed manner coding can be accomplished easily. Hence during this phase

the focus should be on developing the programs that are easy to write. Simplicity and Clarity

should be tried to follow during this phase.

Coding Style:

In a bottom-up approach the individual base elements of the system are first specified in

great detail. These elements are then linked together to form larger subsystem, which then in

turn are linked, sometimes in many levels, until a complete top-level system is formed. This

strategy often resembles a “seed” model, whereby the beginnings are small, but eventually

grow in complexity and completeness.

Object Oriented Programming (OOP) is a programming parading that uses “objects“ to

design application and computer programs.

In Mechanical Engineering with software program such as Pro/ENGINEER, Solid works,

and Autodesk Inventor users can design products as pieces not part of the whole and later

add those pieces together to form assemblies like building LEGO. Engineers call this piece

part design.

Page 12: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 12

This bottom-up approach has one weakness. We need to use a lot of intuition to decide the

functionality that is to be provided by the module. If a system is to be built from existing

system, this approach is more suitable as it starts from some existing modules.

A bottom-up approach is the piecing together of systems to give rise to grander systems,

thus making the original systems sub-systems of the emergent system. In a bottom-up

approach the individual base elements of the system are first specified in great detail. These

elements are then linked together to form larger subsystems, which then in turn are linked,

sometimes in many levels, until a complete top-level system is formed. This strategy often

resembles a "seed" model, whereby the beginnings are small but eventually grow in

complexity and completeness. However, "organic strategies" may result in a tangle of

elements and subsystems, developed in isolation and subject to local optimization as opposed

to meeting a global purpose.

Testing:

Testing plays a very critical role for quality assurance and for insuring the reliability of

software. During testing the program to be tested is executed with a set of Test Cases and

output of the program for the test cases is evaluated to determine if the program is

performing as it is expected to.

There are four major types of testing:

1. Unit Testing: Here each module is tested separately. The coders himself often

perform this simultaneously along with coding of the module.

2. Integration Testing: Here many tested module are combined into subsystems, which

are then tested. The goal here is to see if the module can be integrated properly, the

emphasis being on testing interfaces between modules.

3. System Testing: Here the system is tested against the system requirements to see if

all the requirements are met and if the system performs as per the requirements

specified.

Page 13: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 13

4. Sample Test Cases:

Login Form

Test

Case

ID

Test Case

Description

Test Case Procedure Test Data Expected Result Actual Result

1. Checking

for

Username

Place the Cursor in

the Username

Textbox

Pustmane Invalid Username Invalid

Username

2. Checking

for

Password

Place the Cursor in

the Password

Textbox

1234 Invalid Password Invalid

Password

3. Checking

for

Username

Place the Cursor in

the Username

Textbox

Pustakamane Checks for valid

Password and

Should go to

Administrator Form

Accepted and

entered into

Administrator

Form

4. Checking

for

Password

Place the Cursor in

the Password

Textbox

books Checks for the valid

username and

should go to

Administrator Form

Accepted and

entered into

Administrator

Form

Billing Form

Test

Case ID

Test Case

Description

Test Case

Procedure

Test Data Expected Result Actual Result

1. Checking for

Valid ISBN

Stored in the

Database

Place the Cursor

in the Book Code

Textbox

201a0 Invalid ISBN

Number

Invalid ISBN

Number

2. Checking for

Quantity

Place the Cursor

in the Quantity

Text Box

0 Quantity Cannot be

Zero

Quantity cannot

be Zero

3. Checking for

valid ISBN

Number

Place the cursor in

the Book Code

Textbox

20104 The Details of the

book gets added to

the billing List

The Details of

the book gets

added to the

billing List

4. Checking for

Quantity

Place the Cursor

in the Quantity

Text Box

1 The amount is

being calculated

with the basic price

of the amount

The amount is

being calculated

with the basic

price of the

amount

Page 14: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 14

Maintenance:

Maintenance is a process of repairing and upgrading the system when required, to ensure

correct working of the system at all times. Any changes for the system required are intimated

to the analyst by the user. The analyst prepares an incremental model accessing the input of

modification. The management decides whether or not to implement the change. If the

change is approved, the analyst modifies the system documentation to reflect the changes.

Programmers help to modify and test the programs.

Maintenance is required when:

User requests change in the system

Programmers modify the programs

Testing team test the modified programs

Analyst modifies all system modification to reflect change

Page 15: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 15

Entity Relationship Diagram

Book Shop Management

Address

Book Shop

Pin Code

Phone No.

Name

Generates

Tax Invoice

Book ISBN

Bill

No

Bill

Date Book

ID

Book

Name Qu

ant

ity

Price

Net

Amo

unt

Disc

ount

Total Grand

Total

Provides Book Information

Book Name

Author

Publication

Price

No. of Copies Left

Maintains

Stock

No. of Copies Book ISBN

Employee ID

Book Name

Do

Purchase

Book ISBN

Book Name

Amount

Quantity

Category

Maintains

Employees

Name

DOB

Address

Gender Contact No.

Salary

Page 16: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 16

Data Flow Diagram

Supplier

Supplies Payments

Receive Payment

Arrange

Order Supply

Administrator

Owner

Check for

Discrepancy

Takes Order

Supply

Payment Receipt

Produce Bill

Customer

Process Order

Page 17: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 17

TABLES

1. Billing Table

Field Name Data Type Description

Number Number Bill Number

ISBN Number Book Code

Particulars Text Book Name

Quantity Number Quantity

Price Number Selling Price

Total Number Total Amount

2. Customer Table

Field Name Data Type Description

Number Number Bill Number

Date Date/Time Billing Date

Name Text Customer Name

Discount Number Discount

Disc_Amount Number Discount Amount

Total Number Total Amount

3. Employee Table

Field Name Data Type Description

ID Number Employee ID

Name Text Employee Name

DOB Date/Time Date Of Birth

Gender Text Gender

Address Memo Emplyee Address

Phone Number Contact Number

Salary Number Employee Salary

Page 18: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 18

4. Purchase Table

Field Name Data Type Description

Date Date/Time Date/Time

Number Number Bill Number

ISBN Number Book Code

Name Text Book Name

Author Text Book Author

Publication Text Publication Name

Buying_Price Number Buying Price

Selling_Price Number Selling Price

Category Text Category

Qty Number Number of Copies

5. Stock Table

Field Name Data Type Description

ISBN Number Book Code

Name Text Book Name

Author Text Book Author

Publication Text Publication Name

Buying_Price Number Buying Price

Seeling_Price Number Selling Price

Category Text Category

Stock Number Number

Page 19: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 19

USER MANUAL

Form 1: Administrative Menu

Here Logged in User can access different forms such as Purchase, Employee Details, Tax

Invoice , Stock Info. And here the user has the right to change password.

Form 2: Employee Details

This form holds the personal details of the Employees. The employee number is auto

generated; birth date of the employee has to be entered in DD/MM/YYYY format. Here we

can generate particular employee report or all the employee reports.

Form 3: Purchase

This form contains information about the books being purchased .Here the bill date is auto

generated and it is in the format DD/MMM/YYYY and the user can edit buying and selling

price according to the market. If the book being purchased already exits in the stock all the

details are automatically filled else user has to manually enter the details.

Form 4: Tax Invoice

Here the user prepares/generate invoice for the customer. In this form Bill no is incremented

automatically each time the purchase is made by the customer. If necessary the user can

allow the discount for the purchase made by the customer and finally Invoice Bill is printed.

Form 5: Stock Info

Here the customer gets the respective book details available in the stock on request and

number of copies available in the book shop.

Form 6: Change Password

This form is used by the user to change his existing password. Firstly the user has to enter

the existing password in order to change the password.

Page 20: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 20

SCREEN SHOTS

Page 21: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 21

Page 22: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 22

Page 23: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 23

Page 24: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 24

LOGIN FORM CODE

Dim rs As DAO.Recordset

Dim con As DAO.Connection

Dim db As DAO.Database

Private Sub Login Click ()

Dim password, name As String

name = rs.Fields(0)

password = rs.Fields(1)

If Text1.Text = name And Text2.Text = password Then

Timer1.Enabled = True

frmadmin.Show

frmlogin.Hide

ElseIf Text1.Text = "" And Text2.Text = "" Then

MsgBox "Please Enter the User Name & Password", vbInformation + vbYesNo,

"Message"

Text2.SetFocus

Text1.SetFocus

ElseIf Text1.Text <> name Or Text2.Text <> password Then

MsgBox "Please Enter the Username & Password Correctly", vbInformation + _

vbOKCancel + vbDefaultButton1, "Message"

Text1.Text = ""

Text2.Text = ""

Text2.SetFocus

Text1.SetFocus

End If

Text1.Text = ""

Text2.Text = ""

End Sub

Private Sub Form Load ()

Set db = OpenDatabase ("E:\Book Shop\database.mdb")

Set rs = db.OpenRecordset ("Password")

Timer1.Enabled = True

End Sub

Page 25: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 25

Private Sub Timer1_Timer()

Label4.Caption = Format(Date, "dd-mmm-yyyy")

Label7.Caption = Format(Time, "hh:mm:ss AM/PM")

End Sub

Private Sub Exit_Click()

Dim temp As Integer

temp = MsgBox("Are you sure to Quit", vbYesNo + vbQuestion, "Message")

If temp = vbYes Then

Beep

Unload Me

Else

frmlogin.Show

End If

End Sub

Page 26: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 26

ADMINISTRATOR FORM CODING

Private Sub mnuchangepassword_Click()

frmchangepsw.Show

End Sub

Private Sub mnuEmployee_Click()

frmemployee.Show

End Sub

Private Sub mnulogout_Click(Index As Integer)

Dim temp

temp = MsgBox("Do you really want to quit", vbOKCancel + vbQuestion, "Administrator

Message")

If temp = vbOK Then

Unload Me

frmlogin.Show

End If

End Sub

Private Sub mnupurchase_Click()

frmpurchase.Show

End Sub

Private Sub mnutax_Click()

frminvoice.Show

frminvoice.Text1.SetFocus

Private Sub mnuinventory_Click()

frmchkstock.Show

End Sub

Page 27: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 27

CHANGE PASSWORD CODING

Dim rs As DAO.Recordset

Dim con As DAO.Connection

Dim db As DAO.Database

Private Sub Exit_Click()

Unload Me

End Sub

Private Sub Form_Load()

Set db = OpenDatabase("e:\Book Shop\Database.mdb")

Set rs = db.OpenRecordset("Password")

End Sub

Private Sub reset_Click()

Dim name As String

Dim password As String

password = rs.Fields(1)

If Text1.Text <> password Then

MsgBox "Enter the Password correctly", vbInformation, "Admin Message"

Exit Sub

End If

If Len(Text2) < 7 Then

MsgBox "Entered Password should at least contain 7 Characters", vbOKOnly,

"Pustakamane"

Text2 = ""

Text3 = ""

Text2.SetFocus

Exit Sub

End If

If Text1.Text = password And Text2.Text <> "" And Text3.Text <> "" Then

If Text2.Text = Text3.Text Then

password = Text2.Text

rs.Edit

rs.Fields(1) = password

Page 28: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 28

rs.Update

MsgBox "Password Changed Successfully", vbInformation, "Admin Message"

Beep

Else

MsgBox "Enter the Password Correctly", vbInformation + vbOKOnly

Text2 = ""

Text3 = ""

Exit Sub

End If

End If

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

End Sub

Page 29: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 29

SPLASH FORM (CREDITS) CODING

Private Sub Form_Load()

Timer1.Enabled = True

End Sub

Private Sub Timer1_Timer()

frmcredits.Refresh

Me.Hide

Unload Me

frmadmin.Show

End Sub

Page 30: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 30

EMPLOYEE FORM CODING

Dim db As DAO.Database

Dim con As DAO.Connection

Dim rm As DAO.Recordset

Private Sub Add_Click ()

On Error GoTo Err_Add

Find.Visible = False

Add.Enabled = False

next1.Enabled = False

previous.Enabled = False

first.Enabled = False

last.Enabled = False

Report.Enabled = False

Delete.Enabled = False

Clear_C

Id_Gen

Text2.SetFocus

Find.Enabled = False

MsgBox "Enter The Record Details & Click on Save Button", vbInformation, "Message"

Exit Sub

Err_Add:

MsgBox Err.Description

End Sub

Private Sub Clear_Click()

Clear_C

Find.Enabled = True

End Sub

Page 31: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 31

Private Sub Combo1_LostFocus()

If Combo1.Text = "Please Specify" Then

MsgBox "Select the Gender to Proceed", vbInformation, "Message"

Combo1.SetFocus

End If

End Sub

Private Sub Details_Click()

Dim Temp As Integer

Temp = InputBox("Enter The Employee ID:")

Load DataEnvironment1

With DataEnvironment1

.Employee1 Trim(Temp)

End With

DataReport2.Refresh

DataReport2.Show

Unload DataEnvironment1

End Sub

Private Sub Delete_Click()

On Error GoTo Err_Del

Dim wish As Integer

wish = MsgBox("Delete Current Record Yes/No", vbQuestion + vbYesNo, "DELETION!!")

If wish = vbYes Then

rm.Delete

rm.MoveNext

If rm.EOF=True Then

rm.MoveLast

End If

Clear_C

Fill

End If

Exit Sub

Err_Del:

MsgBox Err.Description

Clear_C

End Sub

Page 32: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 32

Private Sub Exit_Click()

Unload Me

End Sub

Private Sub Find_Click()

If Text1.Text = "" Then

MsgBox "Please enter the Employee ID", vbInformation + vbOKOnly, "Message"

Text1.SetFocus

End If

rm.MoveFirst

Do Until rm.EOF = True

If Text1.Text = rm(0) Then

Fill

End If

rm.MoveNext

Loop

rm.MoveFirst

End Sub

Private Sub first_Click()

rm.MoveFirst

Fill

End Sub

Private Sub Form_Load()

Set db = OpenDatabase("E:\Book Shop\Database.mdb")

Set rm = db.OpenRecordset("Employee")

End Sub

Public Sub Fill()

Text1 = rm(0)

Text2 = rm(1)

Text3 = rm(2)

Text6 = rm(4)

Combo1 = rm(3)

Page 33: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 33

Text4 = rm(5)

Text5 = rm(6)

End Sub

Private Sub last_Click()

rm.MoveLast

Fill

End Sub

Private Sub mnuexit_Click()

Unload Me

End Sub

Private Sub mnupurchase_Click()

frmpurchase.Show

End Sub

Private Sub next1_Click()

rm.MoveNext

If rm.EOF Then

MsgBox "End of Employee Record", vbInformation

rm.MoveLast

End If

Fill

End Sub

Private Sub previous_Click()

rm.MovePrevious

If rm.BOF Then

MsgBox "Beginning of Employee Record", vbInformation

rm.MoveFirst

End If

Fill

Exit Sub

End Sub

Page 34: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 34

Private Sub Report_Click()

DataReport1.Show

End Sub

Private Sub Save_Click()

If Text2 = "" Then

MsgBox "Please Enter Employee's Name"

Text2.SetFocus

Exit Sub

End If

If Text5 = "" Then

MsgBox "Please Enter Employee's Salary"

Text5.SetFocus

Exit Sub

End If

If Text6 = "" Then

MsgBox "Please Enter Employee's Address"

Text6.SetFocus

Exit Sub

End If

On Error GoTo Err_Save

rm.AddNew

rm(0) = Text1.Text

rm(1) = Text2.Text

rm(2) = Text3.Text

rm(3) = Combo1.Text

rm(4) = Text6.Text

rm(5) = Text4.Text

rm(6) = Text5.Text

rm.Update

MsgBox "Record Saved Successfully", vbInformation, "Message"

Add.Enabled = True

next1.Enabled = True

previous.Enabled = True

first.Enabled = True

last.Enabled = True

Page 35: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 35

Report.Enabled = True

Delete.Enabled = True

Find.Enabled = True

Text1.Enabled = True

Clear_C

Exit Sub

Err_Save:

MsgBox Err.Description

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)

Dim char As String

char = Chr(KeyAscii)

If char >= "0" And char <= "9" Then

KeyAscii = 0

Else

If char >= "a" And char <= "z" Then

KeyAscii = KeyAscii - 32

End If

End If

End Sub

Private Sub Text3_LostFocus()

If Text3.Text = "" Or Not IsDate(Text3) Then

MsgBox "Enter a Valid Date of Birth", vbInformation, "Employee Message"

Text3 = ""

Text3.SetFocus

End If

End Sub

Public Sub Clear_C()

Text1 = ""

Text2 = ""

Text3 = ""

Text4 = ""

Text5 = ""

Page 36: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 36

Text6 = ""

Combo1.Text = "Please Specify"

Find.Visible = True

End Sub

Public Sub Id_Gen()

Dim var As Integer

rm.MoveLast

var = Val(rm.Fields(0))

var = var + 1

Text1.Enabled = False

Text1.Text = var

End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Enter Numbers Only"

End If

End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Enter Numbers Only"

End If

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)

Dim char As String

char = Chr(KeyAscii)

If char >= "a" And char <= "z" Then

KeyAscii = KeyAscii - 32

End If

End Sub

Page 37: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 37

BILLING FORM CODING

Dim i, count1 As Integer

Dim db As DAO.Database

Dim con As DAO.Connection

Dim rs As DAO.Recordset

Dim rs2 As DAO.Recordset

Dim rs3 As DAO.Recordset

Private Sub Calculate_Click()

Dim i, Temp As Integer

Dim sum, discount, a, b As Double

'Dim discount As Integer

sum = 0

If Text10 = "" Then

MsgBox "Enter Customer Name"

Text10.SetFocus

Exit Sub

End If

For i = 0 To count1

If i > 7 Then

Add.Enabled = False

MsgBox "Please Genrate the Bill to proceed"

End If

Text6(i) = Val(Text4(i)) * Val(Text5(i))

sum = sum + Val(Text6(i))

rs.MoveFirst

Do Until rs.EOF = True

If rs(i) = Text2(i) Then

rs.Edit

rs(7) = rs(7) - Val(Text4(i))

rs.Update

End If

rs.MoveNext

Loop

Next i

Page 38: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 38

Text8 = sum

discount = -(sum * Val(Text12) / 100)

For i = 0 To count1

rs3.AddNew

rs3(0) = Text9

rs3(1) = Text2(i)

rs3(2) = Text3(i)

rs3(3) = Text4(i)

rs3(4) = Text5(i)

rs3(5) = Text6(i)

rs3.Update

Next i

Add.Enabled = False

MsgBox discount

Text8 = (sum + discount)

rs2.AddNew

rs2(0) = Text9

rs2(1) = Text11

rs2(2) = Text10

rs2(3) = Text12

rs2(4) = discount

rs2(5) = Text8

rs2.Update

Calculate.Visible = True

Text8.Visible = True

End Sub

Private Sub Add_Click()

Dim mess As String

Dim Temp As Integer

If Text1 = "" Then

MsgBox "Please Enter the Book ISBN", vbInformation + vbOKOnly, "Message"

Text1.SetFocus

Exit Sub

End If

If Text7 = "" Or Text7 = 0 Then

Page 39: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 39

MsgBox "Please Enter the Number of Quantity", vbInformation + vbOKOnly,

"Message"

Exit Sub

Text7.SetFocus

End If

rs.MoveFirst

Do Until rs.EOF = True

If Text1 = rs(0) Then

If Val(Text7.Text) > rs(7) Then

Temp = rs(7)

mess = "You have only " & Temp & " Quantity to Sell"

MsgBox mess

Exit Sub

End If

End If

rs.MoveNext

Loop

Calculate.Visible = True

rs.MoveFirst

Do Until rs.EOF = True

If Val(Text1) = rs(0) Then

Text2(i) = rs(0)

Text3(i) = rs(1)

Text4(i) = Text7

Text5(i) = rs(5)

i = i + 1

count1 = i - 1

Text1 = ""

Text7 = ""

rs.MoveFirst

Text1.SetFocus

Exit Sub

End If

rs.MoveNext

Loop

End Sub

Page 40: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 40

Private Sub Generate_Click()

If Text9 = "" Then

MsgBox "Please Enter the Bill Number to Generate"

Generate.SetFocus

Exit Sub

Else

Load DataEnvironment1

With DataEnvironment1

.Command1 Trim(Text9.Text)

End With

DataReport3.Refresh

DataReport3.Show

Unload DataEnvironment1

Call Clear

Call Bill_Gen

Calculate.Visible = False

Text8.Visible = False

End If

End Sub

Private Sub Exit_Click()

Unload Me

End Sub

Private Sub Form_Load()

Text11 = Format(Date, "dd-mmm-yyyy")

Set db = OpenDatabase("E:\Book Shop\Database.mdb")

Set rs = db.OpenRecordset("Stock")

Set rs2 = db.OpenRecordset("Customer")

Set rs3 = db.OpenRecordset("Billing")

Call Bill_Gen

Calculate.Visible = False

Text8.Visible = False : i = 0

End Sub

Page 41: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 41

Public Sub Bill_Gen()

Dim Temp As Integer

rs2.MoveLast

Temp = rs2(0)

Temp = Temp + 1

Text9 = Temp

End Sub

Public Sub Clear()

Dim i, j As Integer

For i = 0 To 7

Text2(i) = ""

Text3(i) = ""

Text4(i) = ""

Text5(i) = ""

Text6(i) = ""

Next i

Text8 = ""

Text12 = ""

Text10 = ""

Add.Enabled = True

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc ("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Enter Numbers Only"

End If

End Sub

Private Sub Text10_KeyPress (KeyAscii As Integer)

Dim char As String

char = Chr(KeyAscii)

If char >= "0" And char <= "9" Then

KeyAscii = 0

Else

If char >= "a" And char <= "z" Then

Page 42: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 42

KeyAscii = KeyAscii - 32

End If

End If

End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Enter Numbers Only"

End If

End Sub

Page 43: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 43

PURCHASE FORM CODING

Dim rs1 As DAO.Recordset

Dim rs2 As DAO.Recordset

Dim db As DAO.Database

Dim con As DAO.Connection

Private Sub Clear_Click()

Clear1

End Sub

Private Sub Done_Click()

Dim Temp As Boolean

Dim var As Double

If Text3.Text = "" Then

MsgBox "Please Enter the Bill Number"

Exit Sub

End If

rs1.AddNew

rs1(0) = Text1.Text

rs1(1) = Text2.Text

rs1(2) = Text3.Text

rs1(3) = Text4.Text

rs1(4) = Text5.Text

rs1(5) = Text6.Text

rs1(6) = Text7.Text

rs1(7) = Text8.Text

rs1(8) = Combo1.Text

rs1(9) = Text9.Text

rs1.Update

rs2.MoveFirst

Do Until rs2.EOF = True

If rs2(0) = Text3.Text Then

rs2.Edit

var = Val(rs2(7))

rs2(7) = var + Text9.Text

rs2.Update

Page 44: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 44

MsgBox "Record Saved Successfully", vbInformation, "Message"

Clear1

Exit Sub

End If

rs2.MoveNext

Loop

End Sub

Private Sub Done1_Click()

Dim Temp As Boolean

Dim var As Double

rs1.AddNew

rs1(0) = Text1.Text

rs1(1) = Text2.Text

rs1(2) = Text3.Text

rs1(3) = Text4.Text

rs1(4) = Text5.Text

rs1(5) = Text6.Text

rs1(6) = Text7.Text

rs1(7) = Text8.Text

rs1(8) = Combo1.Text

rs1(9) = Text9.Text

rs1.Update

rs2.AddNew

rs2(0) = Text3.Text

rs2(1) = Text4.Text

rs2(2) = Text5.Text

rs2(3) = Text6.Text

rs2(4) = Text7.Text

rs2(5) = Text8.Text

rs2(6) = Combo1.Text

rs2(7) = Text9.Text

rs2.Update

MsgBox "Record Saved Successfully", vbInformation, "Message"

Clear1

Exit Sub

End Sub

Page 45: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 45

Private Sub Edit_Click()

Text7.Enabled = True

Text8.Enabled = True

Text7 = ""

Text8 = ""

rs2.MoveFirst

Do Until rs2.EOF = True

If Text3 = rs2(0) Then

If Text7 <> "" Or Text8 <> "" Then

rs2.Edit

rs2(4) = Val(Text7)

rs2(5) = Val(Text8)

rs2.Update

Else

MsgBox "Buying Price or Selling Price Missed. Re-Enter"

Exit Sub

End If

Exit Sub

End If

rs2.MoveNext

Loop

End Sub

Private Sub Exit_Click()

Unload Me

End Sub

Private Sub Form_Load()

Set db = OpenDatabase("E:\Book Shop\Database.mdb")

Set rs1 = db.OpenRecordset("Purchase")

Set rs2 = db.OpenRecordset("Stock")

Text1.Enabled = False

Clear1

End Sub

Page 46: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 46

Public Sub Clear1()

Text1 = Format(Date, "DD-MMM-YYYY")

'Text2 = ""

Text3 = ""

Text4 = ""

Text5 = ""

Text6 = ""

Text7 = ""

Text8 = ""

Text9 = ""

Combo1 = "Please Specify"

Text3.Enabled = True

Text4.Enabled = True

Text5.Enabled = True

Text6.Enabled = True

Text7.Enabled = True

Text8.Enabled = True

Combo1.Enabled = True

End Sub

Public Sub Fill()

Text3 = rs2(0)

Text4 = rs2(1)

Text5 = rs2(2)

Text6 = rs2(3)

Text7 = rs2(4)

Text8 = rs2(5)

Combo1 = rs2(6)

'Text9 = rs2(7)

End Sub

Public Sub Find1()

If Text2.Text = "" Then

MsgBox "Please Enter the Purchase Bill Number"

Text2.SetFocus

Exit Sub

End If

Page 47: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 47

If Text3.Text = "" Then

MsgBox "Enter The Book Id & then Search", vbInformation, "Message"

Text4.SetFocus

End If

rs2.MoveFirst

Do Until rs2.EOF = True

If rs2(0) = Text3.Text Then

Temp = True

Fill

Done.Visible = True

Text3.Enabled = False

Text4.Enabled = False

Text5.Enabled = False

Text6.Enabled = False

Text7.Enabled = False

Text8.Enabled = False

Combo1.Enabled = False

Text9.SetFocus

Done.Visible = True

Done1.Visible = False

Exit Sub

End If

If Text3.Text <> rs2(0) Then

Done.Visible = False

Done1.Visible = True

End If

rs2.MoveNext

Loop

End Sub

Private Sub Text3_LostFocus()

Find1

End Sub

Page 48: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 48

Private Sub Text2_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Please Enter No Only", vbInformation, "Message"

Text2.Text = " "

Text2.SetFocus

End If

End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Please Enter No Only", vbInformation, "Message"

Text3.Text = " "

Text3.SetFocus

End If

End Sub

Private Sub Text4_Change()

If IsNumeric(Text4) Then

MsgBox "Enter Character Only", vbInformation, "Message"

Text4.Text = ""

Text4.SetFocus

End If

End Sub

Private Sub Text5_Change()

If IsNumeric(Text5) Then

MsgBox "Enter Character Only", vbInformation, "Message"

Text5.Text = ""

Text5.SetFocus

End If

End Sub

Page 49: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 49

Private Sub Text6_Change()

If IsNumeric(Text6) Then

MsgBox "Enter Character Only", vbInformation, "Message"

Text6.Text = ""

Text6.SetFocus

End If

End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Enter Numbers Only", vbInformation, "message"

End If

End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Enter Numbers Only", vbInformation, "message"

End If

End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer)

If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then

KeyAscii = 0

MsgBox "Please Enter No Only", vbInformation, "Message"

Text9.Text = " "

Text9.SetFocus

End If

End Sub

Page 50: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 50

APPENDICES

Appendix I – Screen Shots

Appendix II – Source Code

Page 51: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 51

CONCLUSION

Development of this project has been great experience in knowing about Visual Basics and

MS-Access skills.

We thank our friends and seniors who gave us valuable suggestions to carry out this project.

They have been a helping hand in keeping us in good spirits throughout this project.

Our lecturers have been a great source of technical support and inspiration in the completion

of this project.

Page 52: Book Shop Documentation

Book Shop Management

The National Degree College Basavanagudi Page 52

BIBLIOGRAPHY

1. Software Engineering and Visual Basics 6.0

- Dr. M.A. Ramaa

2. Software Engineering

- Pankaj Jalote

3. Visual Basics 6.0

- Dietal & Dietal