You are on page 1of 176

INTRODUCTION

BOOK SHOP AUTOMATION SYSTEM

The information System of the old times totally differs from the todays. It is automation
system of a book shop or any information system. In the previous ages the process of
maintaining data and record seemed very difficult. Now days, Computer is very essential
component. The implementation of computer based Information System can be depicted as
the ease in handling and maintaining the data bank of any size.

The Information system can be used to maintain the system of much system like Library
Management System

My project is about Book Shop Information System. The present deals with almost all the
information of Book Shop. It keeps the database for customer record and publishing record.
It also keeps the author list, charges and Book-title list.

The business of Book Shop is spread all over the world. From public is gaining a great

[BOOK SHOP MANAGEMENT SYSTEM]


business. To sell books in the Book Shop also a great business every year. A large record
should also be maintained very correctly for running of Book Shop such as Sell of Book,
Purchase order, daily transaction

176
OBJECTIVE OF THE PROJECT

1. To search a records of Book-database with efficiently.

2. It keeps database of publishing details price and Customer record.

3. It is easiest way to maintain publishing record data.

4. It can generate knowledge about books.


5. It Helps to Keep the entire information of the book shop in a systematic way so that it
becomes easier to know about the books and sale/purchase.
6. It also generates the reports like sales/purchase.

[BOOK SHOP MANAGEMENT SYSTEM]

176
PLATFORMS AND LANGUAGE TO BE USED
SYSTEM ANALYSIS

System Analysis refers to the process of examining a business situation with the intent of improving it
through better procedures and methods. It may be termed as a process of gathering and interpreting facts,
diagnosing problems and using the information to recommend improvement to the system. System
Analysis helps us in designing a new system or improving an existing system. When there is a proposal
for a new system to be developed there are various steps involved before the development can be started.
Software requirement analysis is bridge between system engineering and software design.

System

Engineerin
g

Software

Requireme
nt

[BOOK SHOP MANAGEMENT SYSTEM]


Analysis

Software
Design

The software development life cycle for this system goes through following steps

 Preliminary investigation:-

 Request clarification
 Feasibility
 Request approval

176
Feasibility Study

This means that after the above requirement is finished then there is to find that is the project
requested by the organization is worth doing as it requires cost and time to finish. Test such as the
following are taken to find the feasibility for the system

 Technical feasibility-
There are number of technical issues which are generally raised during the feasibility stage of
investigation

 Does the necessary technology exist to do what is suggested?


 Does the proposed equipment have the technical capacity to hold the data
required to use in new system?
 Can the system be upgraded if developed?
 Are there technical guarantees of accuracy, reliability, ease of access and data
security?
After taking into consideration all the above points a conclusion is made that yes there is a
technology which exist to do the required job. Tools such as vb and OS Win Server/Win Xp can
be used to connect the department .As far as holding data is concerned use of Oracle is the best

[BOOK SHOP MANAGEMENT SYSTEM]


one as it can hold huge amount of data.

 Economical feasibility:

The system which is to be installed should be economically feasible to the organization.


Financial benefits should be equal or exceed the costs. Various questions such as

 The cost to conduct a full system investigation


 Cost of hardware and software for the class of
application being

176
Considered.

 Benefits in form of reduced costs or fewer costly errors.


After the economically feasibility study takes place the management is quite satisfied with the
cost being incurred and has said to move forward.

 Operational feasibility:

In this feasibility analysis we try to analyze the fact that whether the proposed system is
operationally feasible or not if it meets the requirements within the platform we selected
that’s whether visual basic and oracle is able to work properly long for long period of time
and without error. It also includes that whether the format we choose for report generation
that’s crystal report is workable with the above configuration or not. If it workable then we
suppose that it is operationally feasible, and in our case we find that whatever platform and
software we choose for the development is applicable and runs with each other without any
problem.

The proposed system is technical as well as economical feasible though it has no any
problem in operational feasibility

[BOOK SHOP MANAGEMENT SYSTEM]


Need of the system: -

A System is required to keep the record of Client, Product, Payments, Inventory etc..

176
Who is behind this software request: -

This is concerned with that person who is directly involved with this software and on
whose request this software is to be built. The main organization or company whom
require this software is Loaning sector. They can use this software as much as their
requirement.

When this software is required: -

The main reason to develop such software is that keeping the manual records of the in this era is really a
bit tough. For that reason, Loaning require computerized process software so that they can navigate the all
information of the persons.

Real time processing and ease to handle the software.

[BOOK SHOP MANAGEMENT SYSTEM]

176
Software Engineering Paradigm applied

The Design phase

In order to develop the system we need to understand the availability and must remember our goal, and
then we need to decide a time schedule or milestone so that we should bound to achieve the goal in right
time.

The Designing phase is the most important and crucial stage in system development life cycle, and
includes so many important steps within it the first and most important step for the development is the
choice of correct software engineering paradigms. Here in our case as it is a simple and there is no any
strong time bound therefore we can simply use the “waterfall model.”

The Waterfall Model

The simplest, oldest and most widely used process model for software development is Waterfall model. In
the early days the software development process was not really a process at all.

There used to be a very rudimentary study of the system, which was immediately

[BOOK SHOP MANAGEMENT SYSTEM]


followed by coding. Needless to say, with this kind of approach, large systems seldom saw the light of
day. In order to address the problems of this state of chaos, Royce in 1970 proposed what has come to
known as the Waterfall approach.

This model acquires its name from the fact that the classic software life cycle is
represented as a sequence of descending steps. The different levels of the waterfall correspond to the
distinct phases of the software development process.

The essence of this model is that the process of software development consists
of a linear set of distinct phases.

176
These are:-

 Identification of required software


 Analysis of the software requirements
 Detailed specification of the software requirements
 Software design
 Programming
 Testing
 Maintenance

The software development process is guided by some systematic software development method (SDM),
also referred to by a number of terms, like process models, development guidelines, and systems
development life cycle models (SDLC). There are many approaches to development taken by SDLC
models. Some of these models include

The Waterfall Model

A classic SDLC model, with a linear and sequential method that has goals for each development phase.
The waterfall model simplifies task scheduling, because there are no iterative or overlapping steps. One
drawback of the waterfall model is that it does not allow for much revision.

[BOOK SHOP MANAGEMENT SYSTEM]


Rapid Application Development (RAD)

This model is based on the concept that better products can be developed more quickly by using
workshops or focus groups to gather system requirements.

Joint application development (JAD)

This model involves the client or end user in the design and development of an application, through a
series of collaborative workshops called JAD sessions.

176
Prototyping Model

In this model, a prototype (an early approximation of a final system or product) is built, tested, and then
reworked as necessary until an acceptable prototype is finally achieved from which the complete system
or product can now be developed.

Synchronize-and-Stabilize

This model involves teams working in parallel on individual application modules, frequently
synchronizing their code with that of other teams and stabilizing code frequently throughout the
development process.

[BOOK SHOP MANAGEMENT SYSTEM]

176
Spiral Model

This model of development combines the features of the prototyping model and the waterfall model. The
spiral model is favored for large, expensive, and complicated projects. (Where the costs and end date
spiral out of control)

We shall consider the `waterfall' or `cascade' lifecycle model for software development illustrated in
Figure 1 and give a brief description of the stages below.

[BOOK SHOP MANAGEMENT SYSTEM]

Figure 1: The Waterfall Model of Software Development

176
Feasibility

The feasibility study determines whether a particular development project should go ahead. If the project
is to proceed then a project plan and budget estimate for the other stages of development will be
produced.

Requirements analysis

The requirements for the new or modified system are gathered at this stage. They should be recorded so
that at the end of the project the software can be tested to ensure it fulfills the requirements.

Design specification

Design focuses on:

High level design, e.g. what programs are needed, what are their inputs and outputs, what are their
interactions with other software or the operating system.

Low level design, e.g. how will the program work, what models or algorithms will be used, what libraries
are required.

Data design, e.g. for input and output, data structures in the software.

The level of detail in the design may be a matter of personal choice or may be specified by particular

[BOOK SHOP MANAGEMENT SYSTEM]


development procedures. Having a detailed design will make generating the code easier but will make
changing things difficult whereas a more broad brush design will leave more work in the implementation
phase but allows room for the details to come out as the development progresses. Above all the design
should be documented including reasons for making particular choices if a number of options were
available. This makes it much easier for new developers to join a project and helps when new features are
required.

176
Coding

In this phase the designs are translated into code. Programming tools such as compilers and quality
assurance tools are used to generate good quality source code and the software application. Testing of
small self-contained parts (modules) of the overall application may take place depending on the
modularity of the code.

Testing

The overall system is tested to ensure that it works on the intended platforms, giving correct results or
showing the required behavior defined in the requirements document. The use of debuggers and profiling
tools will be useful at this stage to identify errors in the code and get the best possible performance from
the code. Optimum performance is especially important in scientific computing applications.

Maintenance

Once the system is delivered to users it will inevitably need maintenance. There may be bugs caused by
unexpected input values (add them to a test suite) or by unexpected (inappropriate) use of the software
(tighten up the documentation). In addition users will want more or different functionality and will
definitely want it to run faster or address bigger problems! The software development process should be
able to accommodate changes at this stage through a well thought out design and any changes should
have their own requirements, design, coding and testing stages.

[BOOK SHOP MANAGEMENT SYSTEM]


We are interested in tools aimed at the following stages of the cycle:

 Coding and unit testing


 Integration and system testing
 Delivery and maintenance (especially of legacy code).

For the remainder of this report we will take each of these stages and consider the tools that may help
developer produce high quality software

176
The salient characteristics of this model are that

 It brought a definite structure to the process of software development, which was a major
improvement over the previous "code and fix" culture.
 Each phase is distinct and is mandatory for every project irrespective of project size.
 Every phase has well-defined entry and exit criteria.
 This is achieved through the process of reviews and documentation.
 At every phase there is provision for verification and validation and correction of errors and
inconsistencies.

This model was certainly a major step in the right direction. Proper documentation
and reviews at different stages of any project is necessary to ensure that the final product is what the user
originally required.

The strength of the waterfall model is that it allows for communication


between the user and developer and specifies what will be delivered, when and at what cost.

The weakness of this model is its insistence on a complete set of user requirements before
commencement of design.

How we applied this software model in our project:-

[BOOK SHOP MANAGEMENT SYSTEM]


This is the most common and traditional model of development where maintaining
everything with respect to time bound is excellent, the most important thing in this model of development
is the validation/verification checks

on every stage of development.

Once its decided to develop the software means it is verified that it is feasible then
we follow the waterfall model and draw the time chart that up to which time frame a particular part of the
software must be finished so that on time delivery of the software is possible, validation checks must be
declared, so that each part should be verified and validated which leads to the correct way of development
of the software.

Requirement analysis is done in first phase where every requirement is


identified and reviewed individually so that facts are identified which will help in development of the

176
software. In the second phase of development designing part is done, which includes everything
including DFD, STRUCTURE CHART, and HIERARCHICAL DIAGRAM, working process and
explanation of the whole software in a written format. Input out screen layouts are sketched which gives
an idea about the layout of the project.

In the coding phase the whole design is coded in a particular language which
allows the project to work, in the next stage of development we make integrations of the various
individual modules and then tested that whether it is working properly or not, it is checked that does any
type of bug exists in the software or not if there is any bug then it is make error free. Lastly after
confirming that it is working properly and it is meeting all requirements of the management, it is
delivered.

[BOOK SHOP MANAGEMENT SYSTEM]

176
1

Pay Book Shop Purchase


Shopkeeper Shopkeeper
Information

System

Service

Management

[BOOK SHOP MANAGEMENT SYSTEM]

176
E_name
Empid Job Pay

Published P_addres
s

Shopkeeper Publisher
Purcha
se
B_title
Bid Publishe
Order d
ha
No.
s
Book
Did
Order No

Price
ISBN
Distributor
NO
Bill Sell

Price

[BOOK SHOP MANAGEMENT SYSTEM]


Did

Cid Bid
ha
s
Price
E_mpi Cid D_name
d D_addres
s
Customer
Book-catalog

Cid

Book-

Book- Type
Caddress C_nam
176
e Type
176
[BOOK SHOP MANAGEMENT SYSTEM]
FrmSplash

'All form ontop stuff :)

Const HWND_TOPMOST = -1

Const HWND_NOTOPMOST = -2

Const SWP_NOSIZE = &H1

Const SWP_NOMOVE = &H2

Const SWP_NOACTIVATE = &H10

Const SWP_SHOWWINDOW = &H40

Private Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As
Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As
Long)

Private Sub Form_Activate()

SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or

[BOOK SHOP MANAGEMENT SYSTEM]


SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE

End Sub

Private Sub Form_Load()

'Centers the form.

Left = (Screen.Width - Width) \ 2

Top = (Screen.Height - Height) \ 2

End Sub

176
Private Sub Timer1_Timer()

ProgLoad.Value = ProgLoad.Value + 5

'If the Progress Bar (ProgLoad) is 100% then your function happens.

If ProgLoad.Value = 100 Then

'Your function, can be anything. Open another form, frmMain.show... Ect.

frmLogin.Show

'Unloads this form

Unload Me

End If

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]

176
frmLogin

Dim rs As New ADODB.Recordset

Public LoginSucceeded As Boolean

Dim Counter As Integer

Private Sub cmdCancel_Click()

'set the global var to false

'to denote a failed login

LoginSucceeded = False

Unload Me

End Sub

Private Sub cmdOK_Click()

On Error Resume Next

If txtPasswd.Text = "" Then

[BOOK SHOP MANAGEMENT SYSTEM]


MsgBox "Enter A Password:", vbCritical

txtPasswd.SetFocus

Exit Sub

End If

'rs.Close 'After the user_id are loaded into dbUserId close the

'Recordset for further usage

rs.Open "Select User_Password from users where User_Name= '" & dcUser.Text & "'", Con,
adOpenDynamic, adLockOptimistic

176
If rs.EOF <> True Then 'If Search is found

If rs(0) = txtPasswd Then

DoEvents

'Check If user is Admin

'Checking : To allow Settings Menu Available only to Admin

Unload Me

frmMain.Show

DoEvents

' Srchflag = True

Exit Sub

rs.Close

[BOOK SHOP MANAGEMENT SYSTEM]


Else

MsgBox "Invalid Password!!!" & vbCrLf & "Note : Password is same as Username",
vbInformation, "Enjoy Freeware"

txtPasswd.Text = ""

txtPasswd.SetFocus

rs.Close

Exit Sub

End If

End If

176
'If Srchflag = False Then 'Display msg when search not found

' MsgBox "Invalid Password" & vbCrLf & "No Access!!!", vbCritical, "Invalid User"

' End

'End If

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]

176
FrmChangePassword

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Dim rs As New ADODB.Recordset

Private Sub cmdCancel_Click()

Unload Me

End Sub

Private Sub cmdOK_Click()

On Error Resume Next

If txtNewPassword <> txtReType Then

MsgBox "In correct retype password", vbCritical

txtReType.SetFocus

[BOOK SHOP MANAGEMENT SYSTEM]


Exit Sub

End If

Dim rsChk As Recordset

Set rsChk = New ADODB.Recordset

rsChk.Open "Select * from Users where User_Name = '" & dcUser.Text & "'", Con, adOpenDynamic,
adLockPessimistic

176
If rsChk.EOF = True Then

MsgBox "Invalid User Name", vbCritical

txtUserName.SetFocus

rsChk.Close

Exit Sub

End If

Dim pass As String

If rsChk.EOF = False Then

If rsChk.RecordCount = 1 Then

pass = rsChk(1)

If txtOldPassword <> pass Then

MsgBox "Invalid Old Password", vbCritical

rsChk.Close

[BOOK SHOP MANAGEMENT SYSTEM]


Exit Sub

End If

rsChk(1) = txtNewPassword

rsChk.Update

MsgBox "Password has been changed sucessfully", vbInformation

rsChk.Close

Unload Me

Else

176
MsgBox "An Error Occured", vbCritical

rsChk.Close

Exit Sub

End If

End If

End Sub

Private Sub Form_Load()

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

DoResize = False ' Flag for Resize Event

' Set up the screen values

[BOOK SHOP MANAGEMENT SYSTEM]


Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

176
'Exit Sub ' uncomment to see how Form1 looks without resizing

Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

MyForm.Height = Me.Height ' Remember the current size

MyForm.Width = Me.Width

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]

176
FrmUser

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Dim WithEvents adoPrimaryRS As Recordset

Dim mbChangedByCode As Boolean

Dim mvBookMark As Variant

Dim mbEditFlag As Boolean

Dim mbAddNewFlag As Boolean

Dim mbdatachanged As Boolean

Private Sub cmdUsertype_Click()

frmUserTypes.Show

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub Form_Load()

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

176
DoResize = False ' Flag for Resize Event

' Set up the screen values

Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

'Exit Sub ' uncomment to see how Form1 looks without resizing

Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

MyForm.Height = Me.Height ' Remember the current size

[BOOK SHOP MANAGEMENT SYSTEM]


MyForm.Width = Me.Width

Me.WindowState = vbMaximized

Set adoPrimaryRS = New Recordset

adoPrimaryRS.Open "select
User_Name,User_Password,User_Type,First_Name,Last_Name,Gender,Address,Email,Telephone,Status
,Notes from Users", Con, adOpenDynamic, adLockPessimistic

Dim oText As TextBox

'Bind the text boxes to the data provider

176
For Each oText In Me.txtFields

Set oText.DataSource = adoPrimaryRS

oText.Enabled = False

Next

mbdatachanged = False

'Call Functions.DisableMenu

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If mbEditFlag Or mbAddNewFlag Then Exit Sub

Select Case KeyCode

Case vbKeyEscape

cmdClose_Click

Case vbKeyEnd

[BOOK SHOP MANAGEMENT SYSTEM]


cmdLast_Click

Case vbKeyHome

cmdFirst_Click

Case vbKeyUp, vbKeyPageUp

If Shift = vbCtrlMask Then

cmdFirst_Click

Else

cmdPrevious_Click

176
End If

Case vbKeyDown, vbKeyPageDown

If Shift = vbCtrlMask Then

cmdLast_Click

Else

cmdNext_Click

End If

End Select

End Sub

Private Sub Form_Unload(Cancel As Integer)

Screen.MousePointer = vbDefault

' Call Functions.EnableMenu

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal
pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As
ADODB.Recordset)

'This will display the current record position for this recordset

lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition)

End Sub

Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal


cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

'This is where you put validation code

176
'This event gets called when the following actions occur

Dim bCancel As Boolean

Select Case adReason

Case adRsnAddNew

Case adRsnClose

Case adRsnDelete

Case adRsnFirstChange

Case adRsnMove

Case adRsnRequery

Case adRsnResynch

Case adRsnUndoAddNew

Case adRsnUndoDelete

Case adRsnUndoUpdate

Case adRsnUpdate

[BOOK SHOP MANAGEMENT SYSTEM]


End Select

If bCancel Then adStatus = adStatusCancel

End Sub

Private Sub cmdAdd_Click()

On Error GoTo AddErr

Dim oText As TextBox

176
'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Enabled = True

Next

txtFields(2).Locked = True

With adoPrimaryRS

If Not (.BOF And .EOF) Then

mvBookMark = .Bookmark

End If

.AddNew

lblStatus.Caption = "Add record"

mbAddNewFlag = True

SetButtons False

End With

[BOOK SHOP MANAGEMENT SYSTEM]


Exit Sub

AddErr:

MsgBox err.Description

End Sub

Private Sub cmdDelete_Click()

On Error GoTo DeleteErr

176
If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "Confirm Delete")
= vbNo Then

Exit Sub

End If

With adoPrimaryRS

.Delete

.MoveNext

If .EOF Then .MoveLast

End With

Exit Sub

DeleteErr:

MsgBox err.Description

End Sub

Private Sub cmdRefresh_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


'This is only needed for multi user apps

On Error GoTo RefreshErr

adoPrimaryRS.Requery

Exit Sub

RefreshErr:

MsgBox err.Description

End Sub

176
Private Sub cmdEdit_Click()

On Error GoTo EditErr

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Enabled = True

Next

txtFields(1) = Functions.Decrypt(txtFields(1))

txtUserPass = txtFields(1)

lblStatus.Caption = "Edit record"

mbEditFlag = True

SetButtons False

Exit Sub

[BOOK SHOP MANAGEMENT SYSTEM]


EditErr:

MsgBox err.Description

End Sub

Private Sub cmdCancel_Click()

On Error Resume Next

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

176
oText.Enabled = False

Next

SetButtons True

mbEditFlag = False

mbAddNewFlag = False

adoPrimaryRS.CancelUpdate

If mvBookMark > 0 Then

adoPrimaryRS.Bookmark = mvBookMark

Else

adoPrimaryRS.MoveFirst

End If

mbdatachanged = False

End Sub

Private Sub cmdUpdate_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


'On Error GoTo UpdateErr

Dim oText As TextBox

If txtFields(2) = "" Then

MsgBox "Please Select the User type", vbCritical, "Error"

cmdUsertype.SetFocus

Exit Sub

End If

If txtFields(0) = "" Then

176
MsgBox "Please Enter User Name", vbCritical, "Error"

txtFields(0).SetFocus

Exit Sub

End If

'txtFields(1) = Functions.Encrypt(txtFields(1))

If txtFields(1) <> txtUserPass Then

MsgBox "Password does not match", vbCritical

txtUserPass.SetFocus

SendKeys "{Home}+{End}"

Exit Sub

End If

txtFields(1) = txtFields(1)

adoPrimaryRS.UpdateBatch adAffectAll

[BOOK SHOP MANAGEMENT SYSTEM]


'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Enabled = False

Next

txtUserPass = ""

If mbAddNewFlag Then

adoPrimaryRS.MoveLast 'move to the new record

176
End If

mbEditFlag = False

mbAddNewFlag = False

SetButtons True

mbdatachanged = False

Exit Sub

UpdateErr:

MsgBox err.Description

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub cmdFirst_Click()

On Error GoTo GoFirstError

adoPrimaryRS.MoveFirst

mbdatachanged = False

Exit Sub

GoFirstError:

176
MsgBox err.Description

End Sub

Private Sub cmdLast_Click()

On Error GoTo GoLastError

adoPrimaryRS.MoveLast

mbdatachanged = False

Exit Sub

GoLastError:

MsgBox err.Description

End Sub

Private Sub cmdNext_Click()

On Error GoTo GoNextError

[BOOK SHOP MANAGEMENT SYSTEM]


If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext

If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveLast

End If

'show the current record

mbdatachanged = False

176
Exit Sub

GoNextError:

MsgBox err.Description

End Sub

Private Sub cmdPrevious_Click()

On Error GoTo GoPrevError

If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious

If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveFirst

End If

[BOOK SHOP MANAGEMENT SYSTEM]


'show the current record

mbdatachanged = False

Exit Sub

GoPrevError:

MsgBox err.Description

End Sub

Private Sub SetButtons(bVal As Boolean)

176
cmdAdd.Visible = bVal

cmdEdit.Visible = bVal

cmdUpdate.Visible = Not bVal

cmdCancel.Visible = Not bVal

cmdDelete.Visible = bVal

cmdClose.Visible = bVal

cmdRefresh.Visible = bVal

cmdNext.Enabled = bVal

cmdFirst.Enabled = bVal

cmdLast.Enabled = bVal

cmdPrevious.Enabled = bVal

txtUserPass.Visible = Not bVal

txtFields(1).Visible = Not bVal

lblLabels(1).Visible = Not bVal

[BOOK SHOP MANAGEMENT SYSTEM]


lblUserPass.Visible = Not bVal

cmdViewAll.Visible = bVal

cmdUsertype.Visible = Not bVal

End Sub

176
FrmUserType

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Private Sub cmdCancel_Click()

frmUserDetails.Enabled = True

Unload Me

End Sub

Private Sub cmdOK_Click()

Dim sel As String

If Option1(0).Value = True Then ' if admin

sel = "1"

[BOOK SHOP MANAGEMENT SYSTEM]


ElseIf Option1(1).Value = True Then 'if Guest

sel = "0"

ElseIf Option1(2).Value = True Then 'if Patient Manager

sel = "3"

ElseIf Option1(3).Value = True Then 'if Pharmacy Manager

sel = "4"

ElseIf Option1(4).Value = True Then 'if Employee Manager

sel = "2"

176
ElseIf Option1(5).Value = True Then 'if Hospital Manager

sel = "5"

ElseIf Option1(6).Value = True Then 'if Patient User

sel = "7"

ElseIf Option1(7).Value = True Then 'if pharmacy User

sel = "8"

ElseIf Option1(8).Value = True Then 'if Employee User

sel = "6"

End If

frmUserDetails.Enabled = True

frmUserDetails.txtFields(2) = sel

Me.Hide

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub Form_Activate()

frmUserDetails.Enabled = False

End Sub

Private Sub Form_Deactivate()

frmUserDetails.Enabled = True

End Sub

176
Private Sub Form_Load()

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

DoResize = False ' Flag for Resize Event

' Set up the screen values

Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

[BOOK SHOP MANAGEMENT SYSTEM]


ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

'Exit Sub ' uncomment to see how Form1 looks without resizing

Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

MyForm.Height = Me.Height ' Remember the current size

MyForm.Width = Me.Width

frmUserDetails.Enabled = False

End Sub

176
frmMain

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Private Sub backup_Click()

frmBackUp.Show 1

End Sub

Private Sub CoolGreen_Click()

Call select_color_type(3)

sys_color = "3"

End Sub

Private Sub Default_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


Call select_color_type(0)

sys_color = "0"

End Sub

Private Sub LightBrown_Click()

Call select_color_type(5)

sys_color = "5"

End Sub

176
Private Sub LightViolet_Click()

Call select_color_type(4)

sys_color = "4"

End Sub

Private Sub MacGrey_Click()

Call select_color_type(1)

sys_color = "1"

End Sub

Private Sub MDIForm_Load()

MyForm.Height = Me.Height

MyForm.Width = Me.Width

frmContainer.Show

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub mnsCust_Click()

FrmCustomers.Show 1

End Sub

Private Sub mnnuPurInv_Click()

FrmPurchases.Show

End Sub

176
Private Sub mnuAbout_Click()

frmAbout.Show 1

End Sub

Private Sub mnuAdCust_Click()

FrmCustomers.Show

End Sub

Private Sub mnuAdNew_Click()

frmUserDetails.Show

End Sub

Private Sub mnuAdProd_Click()

FrmProducts.Show

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub mnuAdSup_Click()

FrmSuppliers.Show

End Sub

Private Sub mnuCalc_Click()

Shell "calc.exe", vbNormalFocus

End Sub

176
Private Sub mnuCredit_Click()

frmCredits.Show 1

End Sub

Private Sub mnuCur_Click()

frmCurrency.Show 1

End Sub

Private Sub mnuExit_Click()

Unload frmMain

End Sub

Private Sub mnuLogout_Click()

If MsgBox("Are you sure you want to Log Off the system ?", vbYesNo + vbQuestion, "Log off") =
vbYes Then

[BOOK SHOP MANAGEMENT SYSTEM]


Unload Me

frmLogin.Show

End If

End Sub

Private Sub mnuNote_Click()

Shell "Notepad.exe", vbNormalFocus

End Sub

176
Private Sub mnuPass_Click()

frmChangePassword.Show

End Sub

Private Sub mnuPurRep_Click()

frmPurchasesReport.Show

End Sub

Private Sub mnuSale_Click()

frmSaleInvoice.Show

End Sub

Private Sub mnuSaleRep_Click()

frmSalesReport.Show

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub WinClassic_Click()

Call select_color_type(6)

sys_color = "6"

End Sub

Private Sub XPBlue_Click()

Call select_color_type(2)

sys_color = "2"

End Sub

176
frmProduct

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Dim WithEvents adoPrimaryRS As Recordset

Dim mbChangedByCode As Boolean

Dim mvBookMark As Variant

Dim mbEditFlag As Boolean

Dim mbAddNewFlag As Boolean

Dim mbdatachanged As Boolean

Private Sub cmbCID_KeyPress(KeyAscii As Integer)

Dim llngRet As Long

Dim lstrFind As String

[BOOK SHOP MANAGEMENT SYSTEM]


Dim objcb As New Class1

If KeyAscii >= 33 And KeyAscii <= 126 Then

If cmbCID.SelLength = 0 Then

lstrFind = cmbCID.Text & Chr(KeyAscii)

Else

lstrFind = Left(cmbCID.Text, cmbCID.SelStart) & Chr(KeyAscii)

End If

176
llngRet = objcb.WinCBFindString(cmbCID.hwnd, lstrFind, False)

If llngRet <> -1 Then

cmbCID.ListIndex = llngRet

cmbCID.SelStart = Len(lstrFind)

cmbCID.SelLength = Len(cmbCID.Text) - cmbCID.SelStart

KeyAscii = 0

End If

End If

End Sub

Private Sub cmbSID_KeyPress(KeyAscii As Integer)

Dim llngRet As Long

Dim lstrFind As String

Dim objcb As New Class1

[BOOK SHOP MANAGEMENT SYSTEM]


If KeyAscii >= 33 And KeyAscii <= 126 Then

If cmbSID.SelLength = 0 Then

lstrFind = cmbSID.Text & Chr(KeyAscii)

Else

lstrFind = Left(cmbSID.Text, cmbSID.SelStart) & Chr(KeyAscii)

End If

llngRet = objcb.WinCBFindString(cmbSID.hwnd, lstrFind, False)

If llngRet <> -1 Then

cmbSID.ListIndex = llngRet

176
cmbSID.SelStart = Len(lstrFind)

cmbSID.SelLength = Len(cmbSID.Text) - cmbSID.SelStart

KeyAscii = 0

End If

End If

End Sub

Private Sub cmbSID_LostFocus()

Dim rs As New ADODB.Recordset

Dim rs1 As New ADODB.Recordset

Dim SID As Long

Dim Sup As String

rs.Open "select * from Suppliers where CompanyName = '" & cmbSID.Text & "'", Con,
adOpenKeyset, adLockPessimistic

rs1.Open "select SupplierId from Suppliers", Con, adOpenKeyset, adLockPessimistic

[BOOK SHOP MANAGEMENT SYSTEM]


While rs1.EOF = False

SID = rs1(0) + 1

rs1.MoveNext

Wend

rs1.Close

Sup = cmbSID.Text

176
'While Not rs.EOF

If rs.EOF = False Then

Exit Sub

Else

rs.AddNew

rs.Fields(0) = SID

rs.Fields(1) = Sup

rs.Update

rs.Close

cmbSID.Clear

Dim rs2 As New ADODB.Recordset

rs2.Open "select CompanyName from Suppliers", Con, adOpenDynamic, adLockOptimistic

rs2.MoveFirst

[BOOK SHOP MANAGEMENT SYSTEM]


While rs2.EOF = False

cmbSID.AddItem rs2(0)

rs2.MoveNext

Wend

rs2.Close

End If

'Wend

176
cmbSID.Text = Sup

End Sub

Private Sub cmdViewAll_Click()

FrmVProducts.Show

End Sub

Private Sub cmbCID_LostFocus()

'dim rsSearch as New ADODB.Recordset

Dim rs As New ADODB.Recordset

Dim rs1 As New ADODB.Recordset

Dim CID As Long

Dim Cat As String

rs.Open "select * from categories where categoryname = '" & cmbCID.Text & "'", Con,
adOpenKeyset, adLockPessimistic

[BOOK SHOP MANAGEMENT SYSTEM]


rs1.Open "select categoryID from categories", Con, adOpenKeyset, adLockPessimistic

While rs1.EOF = False

CID = rs1(0) + 1

rs1.MoveNext

Wend

rs1.Close

176
Cat = cmbCID.Text

'While Not rs.EOF

If rs.EOF = False Then

Exit Sub

Else

rs.AddNew

rs.Fields(0) = CID

rs.Fields(1) = Cat

rs.Update

rs.Close

cmbCID.Clear

Dim rs2 As New ADODB.Recordset

rs2.Open "select CategoryName from Categories", Con, adOpenDynamic, adLockOptimistic

[BOOK SHOP MANAGEMENT SYSTEM]


rs2.MoveFirst

While rs2.EOF = False

cmbCID.AddItem rs2(0)

rs2.MoveNext

Wend

rs2.Close

End If

'Wend

176
cmbCID.Text = Cat

End Sub

Private Sub Combo1_Click()

If txtFields(3).Text = "" Then

MsgBox "Please enter money"

Exit Sub

End If

Dim rs2 As New ADODB.Recordset

Dim i As Long

rs2.Open "select cur_value from MoneyChanger where currency_name = '" & Combo1.Text & "' ",
Con, adOpenDynamic, adLockPessimistic

i = Val(txtFields(3).Text) * rs2(0)

[BOOK SHOP MANAGEMENT SYSTEM]


txtFields(8).Text = i

rs2.Close

End Sub

Private Sub Form_Load()

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

176
DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

DoResize = False ' Flag for Resize Event

' Set up the screen values

Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

'Exit Sub ' uncomment to see how Form1 looks without resizing

[BOOK SHOP MANAGEMENT SYSTEM]


Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

MyForm.Height = Me.Height ' Remember the current size

MyForm.Width = Me.Width

Dim rsCategories As Recordset

Dim rsSuppliers As Recordset

Set rsCategories = New ADODB.Recordset

176
Set rsSuppliers = New ADODB.Recordset

Set adoPrimaryRS = New Recordset

adoPrimaryRS.Open "select * from Books", Con, adOpenStatic, adLockOptimistic

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

On Error Resume Next

Set oText.DataSource = adoPrimaryRS

oText.Enabled = True

oText.Locked = True

Next

mbdatachanged = False

rsSuppliers.Open "select * from Suppliers", Con, adOpenDynamic, adLockOptimistic

[BOOK SHOP MANAGEMENT SYSTEM]


If rsSuppliers.EOF = False Then

rsSuppliers.MoveFirst

While rsSuppliers.EOF = False

cmbSID.AddItem rsSuppliers(1)

rsSuppliers.MoveNext

Wend

End If

176
rsCategories.Open "select * from Categories", Con, adOpenDynamic, adLockOptimistic

Debug.Print rsCategories.RecordCount

Debug.Print rsSuppliers.RecordCount

'If rsCategories.EOF = False Then

rsCategories.MoveFirst

While rsCategories.EOF = False

cmbCID.AddItem rsCategories(1)

rsCategories.MoveNext

Wend

'End If

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If mbEditFlag Or mbAddNewFlag Then Exit Sub

Select Case KeyCode

Case vbKeyEscape

cmdClose_Click

Case vbKeyEnd

cmdLast_Click

Case vbKeyHome

176
cmdFirst_Click

Case vbKeyUp, vbKeyPageUp

If Shift = vbCtrlMask Then

cmdFirst_Click

Else

cmdPrevious_Click

End If

Case vbKeyDown, vbKeyPageDown

If Shift = vbCtrlMask Then

cmdLast_Click

Else

cmdNext_Click

End If

End Select

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub Form_Unload(Cancel As Integer)

Screen.MousePointer = vbDefault

End Sub

Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal


pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As
ADODB.Recordset)

'This will display the current record position for this recordset

lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition)

End Sub

176
Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal
cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

'This is where you put validation code

'This event gets called when the following actions occur

Dim bCancel As Boolean

Select Case adReason

Case adRsnAddNew

Case adRsnClose

Case adRsnDelete

Case adRsnFirstChange

Case adRsnMove

Case adRsnRequery

Case adRsnResynch

Case adRsnUndoAddNew

Case adRsnUndoDelete

[BOOK SHOP MANAGEMENT SYSTEM]


Case adRsnUndoUpdate

Case adRsnUpdate

End Select

If bCancel Then adStatus = adStatusCancel

End Sub

Private Sub cmdAdd_Click()

On Error GoTo AddErr

Dim rsAddProducts As New Recordset

176
Dim PID As Long

Set rsAddProducts = New ADODB.Recordset

'PID = Functions.UID(6, "MedID_")

rsAddProducts.Open " Select max(Book_ID) from books", Con, adOpenKeyset, adLockPessimistic

While rsAddProducts.EOF = False

PID = rsAddProducts(0) + 1

rsAddProducts.MoveNext

Wend

rsAddProducts.Close

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = False

[BOOK SHOP MANAGEMENT SYSTEM]


Next

txtFields(1).SetFocus

txtFields(0).Locked = True

CurrencyManage

txtFields(3).Locked = False

Combo1.Locked = False

txtFields(8).Locked = True

cmbCID.ZOrder 0

176
cmbSID.ZOrder 0

cmbCID.TabIndex = 2

cmbSID.TabIndex = 6

txtFields(7).TabIndex = 26

txtFields(9).TabIndex = 27

cmdUpdate.Enabled = True

cmdCancel.Enabled = True

On Error GoTo AddErr

With adoPrimaryRS

If Not (.BOF And .EOF) Then

mvBookMark = .Bookmark

End If

.AddNew

[BOOK SHOP MANAGEMENT SYSTEM]


txtFields(0).Text = PID

lblStatus.Caption = "Add record"

mbAddNewFlag = True

SetButtons False

End With

Exit Sub

AddErr:

MsgBox err.Description

End Sub

176
Private Sub cmdDelete_Click()

On Error GoTo DeleteErr

If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "Confirm Delete")
= vbNo Then

Exit Sub

End If

With adoPrimaryRS

.Delete

.MoveNext

If .EOF Then .MoveLast

End With

Exit Sub

DeleteErr:

MsgBox err.Description

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub cmdRefresh_Click()

'This is only needed for multi user apps

On Error GoTo RefreshErr

adoPrimaryRS.Requery

Exit Sub

RefreshErr:

MsgBox err.Description

End Sub

176
Private Sub cmdEdit_Click()

On Error GoTo EditErr

txtFields(1).SetFocus

cmdUpdate.Enabled = True

cmdCancel.Enabled = True

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = False

Next

txtFields(3).Locked = True

lblStatus.Caption = "Edit record"

mbEditFlag = True

[BOOK SHOP MANAGEMENT SYSTEM]


SetButtons False

CurrencyManage

txtFields(3).Locked = False

Combo1.Locked = False

txtFields(8).Locked = True

cmbCID.ZOrder 0

cmbSID.ZOrder 0

176
cmbCID.TabIndex = 2

cmbSID.TabIndex = 6

txtFields(7).TabIndex = 26

txtFields(9).TabIndex = 27

Exit Sub

EditErr:

MsgBox err.Description

End Sub

Private Sub cmdCancel_Click()

On Error Resume Next

cmdUpdate.Enabled = False

cmdCancel.Enabled = False

[BOOK SHOP MANAGEMENT SYSTEM]


txtFields(3).Locked = True

Combo1.Locked = True

SetButtons True

mbEditFlag = False

mbAddNewFlag = False

adoPrimaryRS.CancelUpdate

If mvBookMark > 0 Then

adoPrimaryRS.Bookmark = mvBookMark

176
Else

adoPrimaryRS.MoveFirst

End If

mbdatachanged = False

cmbCID.ZOrder 1

cmbSID.ZOrder 1

cmbCID.TabIndex = 26

cmbSID.TabIndex = 27

txtFields(7).TabIndex = 2

txtFields(9).TabIndex = 6

End Sub

Private Sub cmdUpdate_Click()

txtFields(7).Text = cmbCID.Text

txtFields(9).Text = cmbSID.Text

[BOOK SHOP MANAGEMENT SYSTEM]


On Error GoTo UpdateErr

' txtFields(2).Text = cmbSID.Text

' txtFields(3).Text = cmbCID.Text

adoPrimaryRS.UpdateBatch adAffectAll

If mbAddNewFlag Then

adoPrimaryRS.MoveLast 'move to the new record

End If

176
cmbCID.ZOrder 1

cmbSID.ZOrder 1

cmbCID.TabIndex = 26

cmbSID.TabIndex = 27

txtFields(7).TabIndex = 2

txtFields(9).TabIndex = 6

cmdUpdate.Enabled = False

cmdCancel.Enabled = False

txtFields(3).Locked = True

Combo1.Locked = True

mbEditFlag = False

mbAddNewFlag = False

[BOOK SHOP MANAGEMENT SYSTEM]


SetButtons True

mbdatachanged = False

Exit Sub

UpdateErr:

MsgBox err.Description

End Sub

176
Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdFirst_Click()

On Error GoTo GoFirstError

adoPrimaryRS.MoveFirst

mbdatachanged = False

Exit Sub

GoFirstError:

MsgBox err.Description

End Sub

Private Sub cmdLast_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


On Error GoTo GoLastError

adoPrimaryRS.MoveLast

mbdatachanged = False

Exit Sub

GoLastError:

MsgBox err.Description

End Sub

176
Private Sub cmdNext_Click()

On Error GoTo GoNextError

If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext

If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveLast

End If

'show the current record

mbdatachanged = False

Exit Sub

GoNextError:

MsgBox err.Description

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub cmdPrevious_Click()

On Error GoTo GoPrevError

If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious

If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveFirst

End If

176
'show the current record

mbdatachanged = False

Exit Sub

GoPrevError:

MsgBox err.Description

End Sub

Private Sub SetButtons(bVal As Boolean)

cmdAdd.Enabled = bVal

cmdEdit.Enabled = bVal

cmdDelete.Enabled = bVal

cmdClose.Enabled = bVal

cmdRefresh.Enabled = bVal

cmdNext.Enabled = bVal

[BOOK SHOP MANAGEMENT SYSTEM]


cmdFirst.Enabled = bVal

cmdLast.Enabled = bVal

cmdPrevious.Enabled = bVal

cmdViewAll.Enabled = bVal

End Sub

Private Sub CurrencyManage()

Dim rs2 As New ADODB.Recordset

Combo1.Clear

176
rs2.Open "select currency_name from moneychanger", Con, adOpenDynamic, adLockOptimistic

While rs2.EOF = False

Combo1.AddItem rs2(0)

Combo1.Text = rs2(0)

rs2.MoveNext

Wend

rs2.Close

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]

176
FrmCustomer

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Dim WithEvents adoPrimaryRS As Recordset

Dim mbChangedByCode As Boolean

Dim mvBookMark As Variant

Dim mbEditFlag As Boolean

Dim mbAddNewFlag As Boolean

Dim mbdatachanged As Boolean

Private Sub cmdViewAll_Click()

FrmVCustomers.Show

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub Form_Load()

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

DoResize = False ' Flag for Resize Event

176
' Set up the screen values

Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

'Exit Sub ' uncomment to see how Form1 looks without resizing

Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

MyForm.Height = Me.Height ' Remember the current size

MyForm.Width = Me.Width

[BOOK SHOP MANAGEMENT SYSTEM]


Set adoPrimaryRS = New Recordset

adoPrimaryRS.Open "select * from Customers", Con, adOpenStatic, adLockOptimistic

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

Set oText.DataSource = adoPrimaryRS

oText.Enabled = True

oText.Locked = True

176
Next

mbdatachanged = False

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If mbEditFlag Or mbAddNewFlag Then Exit Sub

Select Case KeyCode

Case vbKeyEscape

cmdClose_Click

Case vbKeyEnd

cmdLast_Click

Case vbKeyHome

cmdFirst_Click

Case vbKeyUp, vbKeyPageUp

If Shift = vbCtrlMask Then

[BOOK SHOP MANAGEMENT SYSTEM]


cmdFirst_Click

Else

cmdPrevious_Click

End If

Case vbKeyDown, vbKeyPageDown

If Shift = vbCtrlMask Then

cmdLast_Click

Else

176
cmdNext_Click

End If

End Select

End Sub

Private Sub Form_Unload(Cancel As Integer)

Screen.MousePointer = vbDefault

End Sub

Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal


pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As
ADODB.Recordset)

'This will display the current record position for this recordset

lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition)

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal
cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

'This is where you put validation code

'This event gets called when the following actions occur

Dim bCancel As Boolean

Select Case adReason

Case adRsnAddNew

Case adRsnClose

176
Case adRsnDelete

Case adRsnFirstChange

Case adRsnMove

Case adRsnRequery

Case adRsnResynch

Case adRsnUndoAddNew

Case adRsnUndoDelete

Case adRsnUndoUpdate

Case adRsnUpdate

End Select

If bCancel Then adStatus = adStatusCancel

End Sub

Private Sub cmdAdd_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


On Error GoTo AddErr

Dim rsAddCustomers As New Recordset

Dim CID As Long

Set rsAddCustomers = New ADODB.Recordset

' CID = Functions.UID(6, "CID_")

rsAddCustomers.Open " Select max(CustomerID) from Customers", Con, adOpenKeyset,


adLockPessimistic

176
While rsAddCustomers.EOF = False

CID = rsAddCustomers(0) + 1

rsAddCustomers.MoveNext

Wend

rsAddCustomers.Close

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = False

Next

cmbContactTitle.ZOrder 0

txtFields(0).Locked = True

With adoPrimaryRS

If Not (.BOF And .EOF) Then

[BOOK SHOP MANAGEMENT SYSTEM]


mvBookMark = .Bookmark

End If

.AddNew

txtFields(0).Text = CID

lblStatus.Caption = "Add record"

mbAddNewFlag = True

SetButtons False

End With

176
Exit Sub

AddErr:

MsgBox err.Description

End Sub

Private Sub cmdDelete_Click()

On Error GoTo DeleteErr

If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "Confirm Delete")
= vbNo Then

Exit Sub

End If

With adoPrimaryRS

.Delete

.MoveNext

If .EOF Then .MoveLast

[BOOK SHOP MANAGEMENT SYSTEM]


End With

Exit Sub

DeleteErr:

MsgBox err.Description

End Sub

176
Private Sub cmdRefresh_Click()

'This is only needed for multi user apps

On Error GoTo RefreshErr

adoPrimaryRS.Requery

Exit Sub

RefreshErr:

MsgBox err.Description

End Sub

Private Sub cmdEdit_Click()

On Error GoTo EditErr

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = False

[BOOK SHOP MANAGEMENT SYSTEM]


Next

cmbContactTitle.ZOrder 0

lblStatus.Caption = "Edit record"

mbEditFlag = True

SetButtons False

Exit Sub

176
EditErr:

MsgBox err.Description

End Sub

Private Sub cmdCancel_Click()

On Error Resume Next

cmbContactTitle.ZOrder 1

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = True

Next

SetButtons True

mbEditFlag = False

mbAddNewFlag = False

[BOOK SHOP MANAGEMENT SYSTEM]


adoPrimaryRS.CancelUpdate

If mvBookMark > 0 Then

adoPrimaryRS.Bookmark = mvBookMark

Else

adoPrimaryRS.MoveFirst

End If

mbdatachanged = False

End Sub

176
Private Sub cmdUpdate_Click()

txtFields(4).Text = cmbContactTitle.Text

cmbContactTitle.ZOrder 1

On Error GoTo UpdateErr

adoPrimaryRS.UpdateBatch adAffectAll

If mbAddNewFlag Then

adoPrimaryRS.MoveLast 'move to the new record

End If

Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = True

Next

[BOOK SHOP MANAGEMENT SYSTEM]


mbEditFlag = False

mbAddNewFlag = False

SetButtons True

mbdatachanged = False

Exit Sub

UpdateErr:

MsgBox err.Description

End Sub

176
Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdFirst_Click()

On Error GoTo GoFirstError

adoPrimaryRS.MoveFirst

mbdatachanged = False

Exit Sub

GoFirstError:

MsgBox err.Description

End Sub

Private Sub cmdLast_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


On Error GoTo GoLastError

adoPrimaryRS.MoveLast

mbdatachanged = False

Exit Sub

GoLastError:

MsgBox err.Description

End Sub

176
Private Sub cmdNext_Click()

On Error GoTo GoNextError

If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext

If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveLast

End If

'show the current record

mbdatachanged = False

Exit Sub

GoNextError:

MsgBox err.Description

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub cmdPrevious_Click()

On Error GoTo GoPrevError

If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious

If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveFirst

End If

176
'show the current record

mbdatachanged = False

Exit Sub

GoPrevError:

MsgBox err.Description

End Sub

Private Sub SetButtons(bVal As Boolean)

cmdAdd.Enabled = bVal

cmdEdit.Enabled = bVal

cmdDelete.Enabled = bVal

cmdClose.Enabled = bVal

cmdRefresh.Enabled = bVal

cmdNext.Enabled = bVal

[BOOK SHOP MANAGEMENT SYSTEM]


cmdFirst.Enabled = bVal

cmdLast.Enabled = bVal

cmdPrevious.Enabled = bVal

cmbContactTitle.Visible = Not bVal

cmdViewAll.Enabled = bVal

End Sub

176
'Private Sub Form_KeyPress(KeyAscii As Integer)

' If KeyAscii = 22 Then KeyAscii = 0: Exit Sub

' KeyAscii = DataEntryValidation(KeyAscii, ActiveControl.Tag)

'End Sub

[BOOK SHOP MANAGEMENT SYSTEM]

176
frmPurchase

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Private Sub cmbPID_Click()

Dim rsProdName As Recordset

Set rsProdName = New ADODB.Recordset

rsProdName.Open "Select * from Books where Book_ID = " & cmbPID & "", Con, adOpenDynamic,
adLockReadOnly

If rsProdName.RecordCount > 1 Then

MsgBox " Database Error"

Exit Sub

Else

[BOOK SHOP MANAGEMENT SYSTEM]


txtPName = rsProdName(1)

txtunits = rsProdName(7)

txtRPU = rsProdName(6)

End If

rsProdName.Close

End Sub

176
Private Sub cmbSID_Click()

Dim rsSupplierName As Recordset

Set rsSupplierName = New ADODB.Recordset

rsSupplierName.Open "Select * from Suppliers where SupplierID = " & cmbSID & "", Con,
adOpenDynamic, adLockReadOnly

If rsSupplierName.RecordCount > 1 Then

MsgBox " Database Error"

Exit Sub

Else

txtSName = rsSupplierName(1)

txtSCName = rsSupplierName(2)

End If

rsSupplierName.Close

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub cmdAddList_Click()

'On Error Resume Next

Dim rsMed As Recordset

Dim i As Integer

Dim rsProdName As New ADODB.Recordset

Dim tot As Long

Dim Row As Integer

If MFG.Rows > 2 Then

176
For i = 1 To MFG.Rows - 2 Step 1

If MFG.TextMatrix(i, 2) = cmbPID Then

MsgBox "Medicine Already Exist In The List Cannot Add Same Medicine Again.....", vbCritical
+ vbOKOnly

Exit Sub

End If

Next i

End If

If txtAmount = "" Or txtNet = "" Or txtunits = "" Or txtRPU = "" Then

MsgBox "Please Enter the relevant Fields"

Exit Sub

End If

If Val(txtUPurchased) = 0 Then

MsgBox "Quantity Cannot be Zero", vbCritical

Exit Sub

[BOOK SHOP MANAGEMENT SYSTEM]


End If

'Remove quantity

rsProdName.Open "Select * from Books where Book_ID = " & cmbPID & "", Con, adOpenStatic,
adLockOptimistic

tot = Val(txtunits.Text) - Val(txtUPurchased.Text)

rsProdName(7) = tot

176
txtunits.Text = rsProdName(7)

rsProdName.UpdateBatch adAffectCurrent

rsProdName.Close

Row = MFG.Rows - 1

With MFG

.Rows = .Rows + 1

MFG.TextMatrix(Row, 1) = txtBillID

MFG.TextMatrix(Row, 2) = cmbPID

MFG.TextMatrix(Row, 3) = txtPName

MFG.TextMatrix(Row, 4) = txtUPurchased

MFG.TextMatrix(Row, 5) = txtRPU

MFG.TextMatrix(Row, 6) = txtdis

[BOOK SHOP MANAGEMENT SYSTEM]


MFG.TextMatrix(Row, 7) = txtNet

.FixedRows = 1

.RowHeight(0) = .RowHeight(1) * 1.5

SizeColumns MFG, Me

MFGVALUES

Row = Row + 1

End With

176
'cmbSID.Enabled = False

Call CalcFinal

Call TextClear

End Sub

Public Sub CalcFinal()

Dim amount As Double

Dim Discount As Double

Dim Total As Double

Dim i As Integer

If MFG.Rows > 2 Then

For i = 1 To MFG.Rows - 2 Step 1

amount = amount + (Val(MFG.TextMatrix(i, 5)) * Val(MFG.TextMatrix(i, 4)))

Discount = Discount + MFG.TextMatrix(i, 6)

Total = Total + MFG.TextMatrix(i, 7)

[BOOK SHOP MANAGEMENT SYSTEM]


Next i

End If

txtgrndtot = amount

txtdisgvn = Discount

txtpayable = Total

Debug.Print Val(amount) - Val(Discount)

End Sub

176
Public Sub TextClear()

txtunits = ""

txtUPurchased = ""

txtdis = "0"

txtAmount = ""

txtNet = ""

cmbPID_Click

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdDelete_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


Dim selectedRow As Integer

Dim rsProdName As New ADODB.Recordset

Dim tot As Long

selectedRow = MFG.Row

'Add quatity back

If MFG.Rows > 2 Then

For i = 1 To MFG.Rows - 2 Step 1

176
rsProdName.Open "Select * from Books where Book_ID = " & Val(MFG.TextMatrix(i, 2)) & "",
Con, adOpenStatic, adLockOptimistic

tot = Val(rsProdName(7)) + Val(MFG.TextMatrix(i, 4))

rsProdName(7) = tot

'txtunits.Text = rsProdName(7)

rsProdName.UpdateBatch adAffectCurrent

rsProdName.Close

Next i

End If

If selectedRow = MFG.Rows - 1 Then

MsgBox "Invalid Selection.", vbCritical

Exit Sub

End If

If Not MFG.TextMatrix(1, 1) = "" Then

MFG.RemoveItem (selectedRow)

[BOOK SHOP MANAGEMENT SYSTEM]


Call CalcFinal

End If

End Sub

Private Sub cmdsave_click()

If MFG.Rows = 2 Then

MsgBox "Please Add Items to list before you save", vbCritical, "Error Occured"

Exit Sub

End If

176
Dim flag, flag1, flag2 As Boolean

flag = False

flag1 = False

flag2 = False

Dim rsOrderID As Recordset

Dim OID As String

Set rsOrderID = New ADODB.Recordset

rsOrderID.Open " Select * from Purchase_Orders", Con, adOpenDynamic, adLockPessimistic

rsOrderID.AddNew

rsOrderID(0) = txtBillID

rsOrderID(1) = cmbSID

rsOrderID(2) = DTPDate

rsOrderID.Update

[BOOK SHOP MANAGEMENT SYSTEM]


flag = True

rsOrderID.Close

Dim rsMed As Recordset

Set rsMed = New ADODB.Recordset

Dim MID As Long

Dim RQuantity As Integer

Dim rsAddPatient As Recordset

Set rsAddPatient = New ADODB.Recordset

176
Dim rsStock As Recordset

Set rsStock = New ADODB.Recordset

rsMed.Open "SELECT * FROM Purchase_Orde_Details", Con, adOpenDynamic, adLockPessimistic

For i = 1 To MFG.Rows - 2 Step 1

' Generating Purchase Order Details ID

'MID = Functions.UID(6, "PODRDTL_")

rsAddPatient.Open " Select * from Purchase_Orde_Details", Con, adOpenDynamic, adLockReadOnly

If rsAddPatient.EOF = False Then

While rsAddPatient.EOF = False

' If rsAddPatient(0) = MID Then

' MID = Functions.UID(6, "PODRDTL_")

' rsAddPatient.MoveFirst

' End If

MID = rsAddPatient(0) + 1

[BOOK SHOP MANAGEMENT SYSTEM]


rsAddPatient.MoveNext

Wend

End If

rsAddPatient.Close

With rsMed

.AddNew

!PurchaseOrderDetailID = MID

!PurchaseOrderID = txtBillID

176
!PurchaseProductID = MFG.TextMatrix(i, 2)

!PurchaseQUANTITY = Val(MFG.TextMatrix(i, 4))

!PurchaseUnitPrice = Val(MFG.TextMatrix(i, 5))

!PurchaseDiscount = Val(MFG.TextMatrix(i, 6))

!NetValue = txtpayable

.Update

flag1 = True

End With

rsStock.Open "select * from books where Book_ID= " & MFG.TextMatrix(i, 2) & "", Con,
adOpenDynamic, adLockPessimistic

If rsStock.EOF = False Then

rsStock(4) = rsStock(4) + Val(MFG.TextMatrix(i, 4))

rsStock.Update

flag2 = True

End If

[BOOK SHOP MANAGEMENT SYSTEM]


rsStock.Close

Next

rsMed.Close

If flag = True And flag2 = True And flag1 = True Then

MsgBox "Record Saved Succesfully !!", vbInformation, "Record Added"

cmdSave.Enabled = False

Else

MsgBox "An Error Occured while saving to the database", vbCritical

176
Exit Sub

End If

Command1.Enabled = True

cmdSave.Enabled = False

End Sub

Private Sub cmdVProducts_Click()

FrmVProducts.Show

End Sub

Private Sub cndew_Click()

Dim ctl As Control

For Each ctl In Controls

If TypeOf ctl Is TextBox Then

ctl.Text = ""

[BOOK SHOP MANAGEMENT SYSTEM]


End If

Next

cmbSID.Enabled = True

cmdSave.Enabled = True

MFG.Clear

MFG.Refresh

MFG.Rows = 2

Call SetData

Call BillID

176
Call ProdDetails

Call MFGVALUES

End Sub

Private Sub Form_Load()

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

DoResize = False ' Flag for Resize Event

' Set up the screen values

Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

[BOOK SHOP MANAGEMENT SYSTEM]


Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

'Exit Sub ' uncomment to see how Form1 looks without resizing

Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

176
MyForm.Height = Me.Height ' Remember the current size

MyForm.Width = Me.Width

Call SetData

Call BillID

Call ProdDetails

Call MFGVALUES

End Sub

Public Sub SetData()

Dim rsSuppliers As Recordset

Dim mbdatachanged As Boolean

Set rsSuppliers = New ADODB.Recordset

mbdatachanged = False

rsSuppliers.Open "select * from Suppliers", Con, adOpenDynamic, adLockOptimistic

[BOOK SHOP MANAGEMENT SYSTEM]


rsSuppliers.MoveFirst

cmbSID.Clear

While rsSuppliers.EOF = False

cmbSID.AddItem rsSuppliers(0)

rsSuppliers.MoveNext

Wend

rsSuppliers.Close

End Sub

176
Public Sub BillID()

Dim BID As Long

Dim rsOrderID As Recordset

Set rsOrderID = New ADODB.Recordset

' Generatin Order Details ID

'BID = UID(6, "MODRID_")

rsOrderID.Open " Select * from Purchase_Orders", Con, adOpenDynamic, adLockPessimistic

If rsOrderID.EOF = False Then

While rsOrderID.EOF = False

' If rsOrderID(0) = BID Then

' BID = Functions.UID(6, "MODRID_")

' rsOrderID.MoveFirst

' End If

[BOOK SHOP MANAGEMENT SYSTEM]


BID = rsOrderID(0) + 1

rsOrderID.MoveNext

Wend

End If

txtBillID = BID

rsOrderID.Close

End Sub

176
Public Sub MFGVALUES()

MFG.TextMatrix(0, 1) = "ORDER ID"

MFG.TextMatrix(0, 2) = "PRODUCT ID"

MFG.TextMatrix(0, 3) = "PRODUCT NAME"

MFG.TextMatrix(0, 4) = "QUANTITY"

MFG.TextMatrix(0, 5) = "UNIT PRICE"

MFG.TextMatrix(0, 6) = "DISCOUNT"

MFG.TextMatrix(0, 7) = "TOTAL AMOUNT"

SizeColumnHeaders MFG, Me

End Sub

Public Sub ProdDetails()

Dim rsAddProd As Recordset

Set rsAddProd = New ADODB.Recordset

rsAddProd.Open "Select * from Books", Con, adOpenDynamic, adLockReadOnly

[BOOK SHOP MANAGEMENT SYSTEM]


cmbPID.Clear

If rsAddProd.EOF = False Then

rsAddProd.MoveFirst

While rsAddProd.EOF = False

cmbPID.AddItem rsAddProd(0)

'cmbPID.Text = rsAddProd(0)

rsAddProd.MoveNext

Wend

176
End If

rsAddProd.Close

End Sub

Private Sub txtdis_Change()

Dim dis As Long

txtAmount = Val(txtRPU) * Val(txtUPurchased)

dis = (Val(txtAmount) * Val(txtdis)) / 100

txtNet = Val(txtAmount) - dis

End Sub

Private Sub txtUPurchased_Change()

txtAmount = Val(txtRPU) * Val(txtUPurchased)

txtNet = Val(txtAmount) - Val(txtdis)

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = 22 Then KeyAscii = 0: Exit Sub

KeyAscii = DataEntryValidation(KeyAscii, ActiveControl.Tag)

End Sub

176
FrmSupplier

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Dim WithEvents adoPrimaryRS As Recordset

Dim mbChangedByCode As Boolean

Dim mvBookMark As Variant

Dim mbEditFlag As Boolean

Dim mbAddNewFlag As Boolean

Dim mbdatachanged As Boolean

Private Sub cmdViewAll_Click()

FrmVSuppliers.Show

[BOOK SHOP MANAGEMENT SYSTEM]


End Sub

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

176
DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

DoResize = False ' Flag for Resize Event

' Set up the screen values

Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

'Exit Sub ' uncomment to see how Form1 looks without resizing

[BOOK SHOP MANAGEMENT SYSTEM]


Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

MyForm.Height = Me.Height ' Remember the current size

MyForm.Width = Me.Width

Set adoPrimaryRS = New Recordset

adoPrimaryRS.Open "select * from Suppliers", Con, adOpenStatic, adLockOptimistic

Dim oText As TextBox

' Bind the text boxes to the data provider

176
For Each oText In Me.txtFields

Set oText.DataSource = adoPrimaryRS

oText.Enabled = True

oText.Locked = True

Next

mbdatachanged = False

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If mbEditFlag Or mbAddNewFlag Then Exit Sub

Select Case KeyCode

Case vbKeyEscape

cmdClose_Click

[BOOK SHOP MANAGEMENT SYSTEM]


Case vbKeyEnd

cmdLast_Click

Case vbKeyHome

cmdFirst_Click

Case vbKeyUp, vbKeyPageUp

If Shift = vbCtrlMask Then

cmdFirst_Click

Else

cmdPrevious_Click

176
End If

Case vbKeyDown, vbKeyPageDown

If Shift = vbCtrlMask Then

cmdLast_Click

Else

cmdNext_Click

End If

End Select

End Sub

Private Sub Form_Unload(Cancel As Integer)

Screen.MousePointer = vbDefault

End Sub

Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal


pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As

[BOOK SHOP MANAGEMENT SYSTEM]


ADODB.Recordset)

'This will display the current record position for this recordset

lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition)

End Sub

Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As ADODB.EventReasonEnum, ByVal


cRecords As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

'This is where you put validation code

'This event gets called when the following actions occur

176
Dim bCancel As Boolean

Select Case adReason

Case adRsnAddNew

Case adRsnClose

Case adRsnDelete

Case adRsnFirstChange

Case adRsnMove

Case adRsnRequery

Case adRsnResynch

Case adRsnUndoAddNew

Case adRsnUndoDelete

Case adRsnUndoUpdate

Case adRsnUpdate

End Select

If bCancel Then adStatus = adStatusCancel

[BOOK SHOP MANAGEMENT SYSTEM]


End Sub

Private Sub cmdAdd_Click()

'On Error GoTo AddErr

Dim rsAddSupplier As New Recordset

Dim SID As Long

Set rsAddSupplier = New ADODB.Recordset

'SID = Functions.UID(6, "MedSup_")

176
rsAddSupplier.Open " Select max(SupplierID) from Suppliers", Con, adOpenKeyset,
adLockPessimistic

While rsAddSupplier.EOF = False

' If rsAddSupplier(0) = SID Then

' SID = Functions.UID(6, "MedSup_")

' rsAddSupplier.MoveFirst

' Else

'

' End If

SID = rsAddSupplier(0) + 1

rsAddSupplier.MoveNext

Wend

rsAddSupplier.Close

cmdUpdate.Enabled = True

cmdCancel.Enabled = True

[BOOK SHOP MANAGEMENT SYSTEM]


Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = False

Next

txtFields(2).SetFocus

txtFields(0).Locked = True

176
On Error GoTo AddErr

With adoPrimaryRS

If Not (.BOF And .EOF) Then

mvBookMark = .Bookmark

End If

.AddNew

txtFields(0).Text = SID

lblStatus.Caption = "Add record"

mbAddNewFlag = True

SetButtons False

End With

Exit Sub

AddErr:

MsgBox err.Description

[BOOK SHOP MANAGEMENT SYSTEM]


End Sub

Private Sub cmdDelete_Click()

On Error GoTo DeleteErr

If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "Confirm Delete")
= vbNo Then

Exit Sub

End If

176
With adoPrimaryRS

.Delete

.MoveNext

If .EOF Then .MoveLast

End With

Exit Sub

DeleteErr:

MsgBox err.Description

End Sub

Private Sub cmdRefresh_Click()

'This is only needed for multi user apps

On Error GoTo RefreshErr

adoPrimaryRS.Requery

[BOOK SHOP MANAGEMENT SYSTEM]


Exit Sub

RefreshErr:

MsgBox err.Description

End Sub

Private Sub cmdEdit_Click()

On Error GoTo EditErr

cmdUpdate.Enabled = True

cmdCancel.Enabled = True

176
Dim oText As TextBox

'Bind the text boxes to the data provider

For Each oText In Me.txtFields

oText.Locked = False

Next

txtFields(2).SetFocus

lblStatus.Caption = "Edit record"

mbEditFlag = True

SetButtons False

Exit Sub

EditErr:

[BOOK SHOP MANAGEMENT SYSTEM]


MsgBox err.Description

End Sub

Private Sub cmdCancel_Click()

On Error Resume Next

SetButtons True

mbEditFlag = False

mbAddNewFlag = False

adoPrimaryRS.CancelUpdate

176
If mvBookMark > 0 Then

adoPrimaryRS.Bookmark = mvBookMark

Else

adoPrimaryRS.MoveFirst

End If

mbdatachanged = False

cmdUpdate.Enabled = False

cmdCancel.Enabled = False

End Sub

Private Sub cmdUpdate_Click()

On Error GoTo UpdateErr

adoPrimaryRS.UpdateBatch adAffectAll

If mbAddNewFlag Then

[BOOK SHOP MANAGEMENT SYSTEM]


adoPrimaryRS.MoveLast 'move to the new record

End If

mbEditFlag = False

mbAddNewFlag = False

SetButtons True

mbdatachanged = False

cmdUpdate.Enabled = False

cmdCancel.Enabled = False

176
Exit Sub

UpdateErr:

MsgBox err.Description

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdFirst_Click()

On Error GoTo GoFirstError

adoPrimaryRS.MoveFirst

mbdatachanged = False

Exit Sub

[BOOK SHOP MANAGEMENT SYSTEM]


GoFirstError:

MsgBox err.Description

End Sub

Private Sub cmdLast_Click()

On Error GoTo GoLastError

adoPrimaryRS.MoveLast

mbdatachanged = False

176
Exit Sub

GoLastError:

MsgBox err.Description

End Sub

Private Sub cmdNext_Click()

On Error GoTo GoNextError

If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext

If adoPrimaryRS.EOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveLast

[BOOK SHOP MANAGEMENT SYSTEM]


End If

'show the current record

mbdatachanged = False

Exit Sub

GoNextError:

MsgBox err.Description

End Sub

176
Private Sub cmdPrevious_Click()

On Error GoTo GoPrevError

If Not adoPrimaryRS.BOF Then adoPrimaryRS.MovePrevious

If adoPrimaryRS.BOF And adoPrimaryRS.RecordCount > 0 Then

Beep

'moved off the end so go back

adoPrimaryRS.MoveFirst

End If

'show the current record

mbdatachanged = False

Exit Sub

GoPrevError:

MsgBox err.Description

[BOOK SHOP MANAGEMENT SYSTEM]


End Sub

Private Sub SetButtons(bVal As Boolean)

cmdAdd.Enabled = bVal

cmdEdit.Enabled = bVal

cmdDelete.Enabled = bVal

cmdClose.Enabled = bVal

cmdRefresh.Enabled = bVal

cmdNext.Enabled = bVal

176
cmdFirst.Enabled = bVal

cmdLast.Enabled = bVal

cmdPrevious.Enabled = bVal

cmdViewAll.Enabled = bVal

End Sub

'Private Sub Form_KeyPress(KeyAscii As Integer)

' If KeyAscii = 22 Then KeyAscii = 0: Exit Sub

' KeyAscii = DataEntryValidation(KeyAscii, ActiveControl.Tag)

'End Sub

[BOOK SHOP MANAGEMENT SYSTEM]

176
frmSalesInvoice

Dim DesignX As Integer

Dim DesignY As Integer

Dim stock As Integer

Dim OID As String

Dim rsProductName As New ADODB.Recordset

Private Sub cmbCID_Click()

Dim rsProducts As Recordset

Set rsProducts = New ADODB.Recordset

cmbPID.Clear

rsProducts.Open "Select * from books where Category_name = '" & cmbCID & "' ", Con,
adOpenDynamic, adLockOptimistic

If rsProducts.EOF = False Then

[BOOK SHOP MANAGEMENT SYSTEM]


rsProducts.MoveFirst

While rsProducts.EOF = False

cmbPID.AddItem rsProducts(0)

cmbPID.Text = rsProducts(0)

rsProducts.MoveNext

Wend

End If

176
If cmbPID.ListCount = 0 Then

txtmedname = ""

txtRPU = "0"

End If

rsProducts.Close

End Sub

Private Sub cmbPID_Click()

rsProductName.Open "Select * from Books where Book_ID = " & cmbPID & "", Con, adOpenStatic,
adLockBatchOptimistic

If rsProductName.RecordCount > 1 Then

MsgBox " Database Error"

stock = 0

txtStock = stock

[BOOK SHOP MANAGEMENT SYSTEM]


Exit Sub

ElseIf rsProductName.RecordCount = 0 Then

txtmedname = ""

txtRPU = "0.00"

stock = 0

Else

txtmedname = rsProductName(1)

176
txtRPU = rsProductName(6)

stock = rsProductName(7)

End If

txtStock = stock

rsProductName.Close

End Sub

Private Sub cmbPtID_Click()

Dim rs3 As New ADODB.Recordset

rs3.Open "Select ContactFirstName,ContactLastName from customers where CustomerID = " & cmbPtID
& "", Con, adOpenStatic, adLockBatchOptimistic

If rs3.RecordCount > 1 Then

MsgBox " Database Error"

Exit Sub

[BOOK SHOP MANAGEMENT SYSTEM]


ElseIf rs3.RecordCount = 0 Then

Text1 = ""

Else

Text1.Text = rs3.Fields(0) & " " & rs3.Fields(1)

End If

176
rs3.Close

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdDelete_Click()

Dim selectedRow As Integer

Dim tot As Long

Dim rsProdName As New ADODB.Recordset

Dim i As Integer

selectedRow = MFG.Row

'Add quatity back

[BOOK SHOP MANAGEMENT SYSTEM]


If MFG.Rows > 2 Then

For i = 1 To MFG.Rows - 2 Step 1

rsProdName.Open "Select * from Books where Book_ID = " & Val(MFG.TextMatrix(i, 2)) & "",
Con, adOpenStatic, adLockOptimistic

tot = Val(rsProdName(7)) + Val(MFG.TextMatrix(i, 4))

'tot = Val(txtStock.Text) + Val(MFG.TextMatrix(i, 4))

176
rsProdName(7) = tot

'txtStock.Text = rsProdName(7)

rsProdName.UpdateBatch adAffectCurrent

rsProdName.Close

Next i

End If

If selectedRow = MFG.Rows - 1 Then

MsgBox "Invalid Selection.", vbCritical

Exit Sub

End If

If Not MFG.TextMatrix(1, 1) = "" Then

MFG.RemoveItem (selectedRow)

[BOOK SHOP MANAGEMENT SYSTEM]


Call CalFinal

End If

End Sub

Private Sub cmdVProducts_Click()

FrmVProducts.Show

End Sub

176
Private Sub cndew_Click()

Dim ctl As Control

For Each ctl In Controls

If TypeOf ctl Is TextBox Then

ctl.Text = ""

End If

Next

cmbPtID.Enabled = True

cmdSave.Enabled = True

MFG.Clear

MFG.Refresh

MFG.Rows = 2

Call SetData

Call BillID

[BOOK SHOP MANAGEMENT SYSTEM]


Call CustDetails

Call MFGVALUES

Command1.Enabled = False

'DTPDate.Value = Date

'DTPIssue.Value = Date

End Sub

176
Private Sub Command1_Click()

'On Error Resume Next

Dim strReport As String

Dim strTXT As Integer

strTXT = Val(txtBillID.Text)

'PInvoice.DataFiles(0) = App.Path & "\BookShop.mdb"

'strReport = App.Path & "\invoice.rpt"

PInvoice.ReportFileName = App.Path & "\Sale Invoice.rpt"

PInvoice.DiscardSavedData = True

PInvoice.SelectionFormula = "{qryInvoice.OrderID} = " & strTXT

PInvoice.WindowState = crptMaximized

PInvoice.Action = 1

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub Command2_Click()

MsgBox MFG.Row

MsgBox MFG.Rows

End Sub

176
Private Sub Form_Load()

Call SetData

Call BillID

Call CustDetails

Call MFGVALUES

Command1.Enabled = False

'DTPDate.Value = Date

'DTPIssue.Value = Date

End Sub

Public Sub SetData()

Dim rsCategories As Recordset

Set rsCategories = New ADODB.Recordset

[BOOK SHOP MANAGEMENT SYSTEM]


rsCategories.Open "select * from Categories", Con, adOpenDynamic, adLockOptimistic

cmbCID.Clear

While rsCategories.EOF = False

cmbCID.AddItem rsCategories(1)

rsCategories.MoveNext

Wend

rsCategories.Close

176
End Sub

Public Sub BillID()

Dim BID As Double

Dim rsOrderID As Recordset

Set rsOrderID = New ADODB.Recordset

' Generatin Order Details ID

'BID = Functions.UID(6, "MODRID_")

rsOrderID.Open "Select max(orderID) from Orders", Con, adOpenKeyset, adLockOptimistic

If rsOrderID.EOF = False Then

If IsNull(rsOrderID(0)) Then

[BOOK SHOP MANAGEMENT SYSTEM]


BID = 1

'rsOrderID.MoveFirst

Else

While rsOrderID.EOF = False

BID = rsOrderID(0) + 1

rsOrderID.MoveNext

Wend

End If

End If

176
txtBillID = BID

End Sub

Public Sub MFGVALUES()

MFG.TextMatrix(0, 1) = "ORDER ID"

MFG.TextMatrix(0, 2) = "PRODUCT ID"

MFG.TextMatrix(0, 3) = "PRODUCT NAME"

MFG.TextMatrix(0, 4) = "QUANTITY"

MFG.TextMatrix(0, 5) = "UNIT PRICE"

MFG.TextMatrix(0, 6) = "DISCOUNT"

MFG.TextMatrix(0, 7) = "TOTAL AMOUNT"

'SizeColumnHeaders MFG, Me

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Public Sub CustDetails()

Dim rsAddCust As Recordset

Set rsAddCust = New ADODB.Recordset

rsAddCust.Open "Select * from Customers", Con, adOpenDynamic, adLockReadOnly

cmbPtID.Clear

If rsAddCust.EOF = False Then

rsAddCust.MoveFirst

176
'cmbPtID.Text = "0"

While rsAddCust.EOF = False

cmbPtID.AddItem rsAddCust(0)

cmbPtID.ListIndex = 0

rsAddCust.MoveNext

Wend

End If

'cmbPID.Text = Str(rsAddCust(0)) & " "

rsAddCust.Close

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Private Sub MFG_Click()

rsProductName.Open "Select * from Books where Book_ID = " & cmbPID & "", Con, adOpenStatic,
adLockBatchOptimistic

txtStock = stock

rsProductName.Close

End Sub

176
Private Sub txtdis_Change()

Dim dis As Long

txtAmount = Val(txtRPU) * Val(txtqty)

dis = (Val(txtAmount) * Val(txtdis)) / 100

txttotamt = Val(txtAmount) - dis

End Sub

Private Sub txtqty_Change()

txtAmount = Val(txtRPU) * Val(txtqty)

txttotamt = Val(txtAmount) - Val(txtdis)

End Sub

Private Sub cmdAddList_Click()

'On Error Resume Next

[BOOK SHOP MANAGEMENT SYSTEM]


Dim rsMed As Recordset

Dim i As Integer

Dim tot As Double

Dim rsProdName As New ADODB.Recordset

Dim Row As Integer

If MFG.Rows > 2 Then

For i = 1 To MFG.Rows - 2 Step 1

If MFG.TextMatrix(i, 2) = cmbPID Then

176
MsgBox "Medicine Already Exist In The List Cannot Add Same Medicine Again.....", vbCritical
+ vbOKOnly

Exit Sub

End If

Next i

End If

If txtAmount = "" Or txttotamt = "" Or txtqty = "" Or txtRPU = "" Then

MsgBox "Please Enter the relevant Fields"

Exit Sub

End If

If Val(txtqty) = 0 Then

MsgBox "Quantity Cannot be Zero", vbCritical

Exit Sub

End If

If Val(txtqty) > stock Then

[BOOK SHOP MANAGEMENT SYSTEM]


MsgBox "The Quantity Cannot be greater than Stock", vbCritical

Exit Sub

End If

If cmbPtID = "" Then

'cmbPtID = ""

Exit Sub

End If

176
'Remove quantity

rsProdName.Open "Select * from Books where Book_ID = " & cmbPID & "", Con, adOpenStatic,
adLockOptimistic

tot = Val(txtStock.Text) - Val(txtqty.Text)

rsProdName(7) = tot

txtStock.Text = rsProdName(7)

rsProdName.UpdateBatch adAffectCurrent

rsProdName.Close

'

Row = MFG.Rows - 1

With MFG

.Rows = .Rows + 1

MFG.TextMatrix(Row, 1) = txtBillID

[BOOK SHOP MANAGEMENT SYSTEM]


MFG.TextMatrix(Row, 2) = cmbPID

MFG.TextMatrix(Row, 3) = txtmedname

MFG.TextMatrix(Row, 4) = txtqty

MFG.TextMatrix(Row, 5) = txtRPU

MFG.TextMatrix(Row, 6) = txtdis

MFG.TextMatrix(Row, 7) = txttotamt

176
.FixedRows = 1

.RowHeight(0) = .RowHeight(1) * 1.5

'SizeColumns MFG, Me

MFGVALUES

Row = Row + 1

End With

cmbPtID.Enabled = False

Call CalFinal

Call TextClear

End Sub

Public Sub CalFinal()

[BOOK SHOP MANAGEMENT SYSTEM]


Dim amount As Double

Dim Discount As Double

Dim Total As Double

Dim i As Integer

If MFG.Rows > 2 Then

For i = 1 To MFG.Rows - 2 Step 1

amount = amount + (Val(MFG.TextMatrix(i, 5)) * Val(MFG.TextMatrix(i, 4)))

Discount = Discount + Val(MFG.TextMatrix(i, 6))

Total = Total + Val(MFG.TextMatrix(i, 7))

176
Next i

End If

txtgrndtot = amount

txtdisgvn = Discount

txtpayable = Total

Debug.Print Val(amount) - Val(Discount)

End Sub

Public Sub TextClear()

txtqty = ""

txtdis = ""

txtAmount = ""

txttotamt = ""

cmbPID_Click

[BOOK SHOP MANAGEMENT SYSTEM]


End Sub

Private Sub cmdsave_click()

Dim rsOrderID As Recordset

If MFG.Rows = 2 Then

MsgBox "Please Add Items to list before you save", vbCritical, "Error Occured"

Exit Sub

End If

176
Dim flag, flag1, flag2 As Boolean

flag = False

flag1 = False

flag2 = False

Set rsOrderID = New ADODB.Recordset

rsOrderID.Open " Select * from Orders", Con, adOpenDynamic, adLockPessimistic

rsOrderID.AddNew

rsOrderID(0) = txtBillID

rsOrderID(1) = cmbPtID

rsOrderID(2) = DTPDate

rsOrderID(3) = Text1.Text

rsOrderID(4) = txtdisgvn

[BOOK SHOP MANAGEMENT SYSTEM]


rsOrderID(5) = txtpayable

rsOrderID.Update

flag2 = True

rsOrderID.Close

Dim rsMed As Recordset

Set rsMed = New ADODB.Recordset

Dim MID As Long

Dim RQuantity As Integer

176
Dim rsAddPatient As Recordset

Set rsAddPatient = New ADODB.Recordset

Dim rsStock As Recordset

Set rsStock = New ADODB.Recordset

Dim i As Integer

rsMed.Open "SELECT * FROM OrderDetails", Con, adOpenDynamic, adLockPessimistic

For i = 1 To MFG.Rows - 2 Step 1

' Generatin Order Details ID

'MID = Functions.UID(6, "ODRDTL_")

rsAddPatient.Open " Select * from OrderDetails", Con, adOpenDynamic, adLockReadOnly

[BOOK SHOP MANAGEMENT SYSTEM]


If rsAddPatient.EOF = False Then

While rsAddPatient.EOF = False

' If rsAddPatient(0) = MID Then

' MID = Functions.UID(6, "ODRDTL_")

' rsAddPatient.MoveFirst

' End If

MID = rsAddPatient(0) + 1

rsAddPatient.MoveNext

Wend

176
End If

rsAddPatient.Close

With rsMed

.AddNew

!OrderDetailID = MID

!OrderID = txtBillID

!ProductID = MFG.TextMatrix(i, 2)

!QUANTITY = MFG.TextMatrix(i, 4)

!UNITPRICE = MFG.TextMatrix(i, 5)

!amount = Val(MFG.TextMatrix(i, 4)) * Val(MFG.TextMatrix(i, 5))

.Update

flag = True

End With

[BOOK SHOP MANAGEMENT SYSTEM]


' Substract the stock from the products

rsStock.Open "select * from Books where book_ID= " & MFG.TextMatrix(i, 2) & "", Con,
adOpenDynamic, adLockPessimistic

If rsStock.EOF = False Then

rsStock(4) = rsStock(4) - Val(MFG.TextMatrix(i, 4))

rsStock.Update

flag1 = True

End If

rsStock.Close

176
Next

rsMed.Close

If flag = True And flag1 = True And flag2 = True Then

MsgBox "Record Saved Succesfully !!"

Else

MsgBox "Error Updating Record", vbCritical

End If

Command1.Enabled = True

cmdSave.Enabled = False

End Sub

Private Sub txtqty_LostFocus()

[BOOK SHOP MANAGEMENT SYSTEM]


If Val(txtqty) > stock Then

MsgBox "The Quantity Cannot be greater than Stock", vbCritical

End If

End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)

' If KeyAscii = 22 Then KeyAscii = 0: Exit Sub

' KeyAscii = DataEntryValidation(KeyAscii, ActiveControl.Tag)

End Sub

176
FrmViewCustomer

Dim MyForm As FRMSIZE

Dim DesignX As Integer

Dim DesignY As Integer

Dim strCol As Variant

Private Sub cmbSearch_Click()

cmdFind_Click

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdFind_Click()

[BOOK SHOP MANAGEMENT SYSTEM]


Dim rsFind As Recordset

Dim strSQl As String

Dim SQL As String

Dim LItem As ListItem

'if there is nothing to search for then exit

If txtSearchText = "" Then

Exit Sub

176
End If

ListView1.ListItems.Clear

Set rsFind = New ADODB.Recordset

SQL = "SELECT * FROM Customers"

SQL = SQL & " WHERE CustomerID LIKE '*" & txtSearchText & "*'"

'make the search

strSQl = "SELECT * FROM Customers WHERE "

strSQl = strSQl & cmbSearch & " Like " & "'%" & txtSearchText & "%'"

'SQL = strSQl & " WHERE language LIKE '*" & Text1.Text & "*'"

'strSQl = strSQl & SQL

Debug.Print strSQl

[BOOK SHOP MANAGEMENT SYSTEM]


Debug.Print SQL

'show the found records

rsFind.Open strSQl, Con, adOpenDynamic, adLockPessimistic

Debug.Print rsFind.RecordCount

Debug.Print rsFind.Fields.Count

If Not (rsFind.BOF And rsFind.EOF) Then

While rsFind.EOF = False

176
Set LItem = ListView1.ListItems.Add(, , rsFind(0))

If rsFind(1) <> "" Then

LItem.SubItems(1) = rsFind(1)

End If

If rsFind(2) <> "" Then

LItem.SubItems(2) = rsFind(2)

End If

If rsFind(3) <> "" Then

LItem.SubItems(3) = rsFind(3)

End If

If rsFind(4) <> "" Then

[BOOK SHOP MANAGEMENT SYSTEM]


LItem.SubItems(4) = rsFind(4)

End If

If rsFind(5) <> "" Then

LItem.SubItems(5) = rsFind(5)

End If

If rsFind(6) <> "" Then

LItem.SubItems(6) = rsFind(6)

End If

176
If rsFind(7) <> "" Then

LItem.SubItems(7) = rsFind(7)

End If

If rsFind(8) <> "" Then

LItem.SubItems(8) = rsFind(8)

End If

If rsFind(9) <> "" Then

LItem.SubItems(9) = rsFind(9)

End If

rsFind.MoveNext

Wend

End If

[BOOK SHOP MANAGEMENT SYSTEM]


'show number of records found

Me.Caption = CStr(rsFind.RecordCount) & " records found"

'close the recordset

rsFind.Close

End Sub

176
Private Sub cmdSearch_Click()

Dim LItem As ListItem

FindItem = InputBox("Enter Customers ID", "Find Customers Details")

If Not FindItem = "" Then

Set LItem = ListView1.FindItem(FindItem, lvwText, lvwSubItem)

If LItem Is Nothing Then

NotFound = True

End If

If NotFound Then

MsgBox "Item not found", vbInformation, "Search Result"

Else

LItem.EnsureVisible

LItem.Selected = True

End If

End If

[BOOK SHOP MANAGEMENT SYSTEM]


End Sub

Private Sub Command1_Click()

txtSearchText = ""

Form_Load

End Sub

176
Private Sub Form_Activate()

Me.WindowState = vbMaximized

txtSearchText.SetFocus

End Sub

Private Sub Form_Load()

Dim LItem As ListItem

Dim i As Integer

Dim rsPatientID As Recordset

Set rsPatientID = New ADODB.Recordset

Dim rsPatient As Recordset

Set rsPatient = New ADODB.Recordset

Dim ScaleFactorX As Single, ScaleFactorY As Single ' Scaling factors

' Size of Form in Pixels at design resolution

[BOOK SHOP MANAGEMENT SYSTEM]


DesignX = 800

DesignY = 600

RePosForm = True ' Flag for positioning Form

DoResize = False ' Flag for Resize Event

' Set up the screen values

Xtwips = Screen.TwipsPerPixelX

Ytwips = Screen.TwipsPerPixelY

Ypixels = Screen.Height / Ytwips ' Y Pixel Resolution

Xpixels = Screen.Width / Xtwips ' X Pixel Resolution

176
' Determine scaling factors

ScaleFactorX = (Xpixels / DesignX)

ScaleFactorY = (Ypixels / DesignY)

ScaleMode = 1 ' twips

'Exit Sub ' uncomment to see how Form1 looks without resizing

Resize_For_Resolution ScaleFactorX, ScaleFactorY, Me

MyForm.Height = Me.Height ' Remember the current size

MyForm.Width = Me.Width

cmbSearch.Clear

rsPatientID.Open "select * from Customers", Con, adOpenDynamic, adLockPessimistic

rsPatient.Open "select * from Customers", Con, adOpenDynamic, adLockPessimistic

For i = 0 To rsPatientID.Fields.Count - 1 Step 1

[BOOK SHOP MANAGEMENT SYSTEM]


cmbSearch.AddItem rsPatientID(i).Name, i

Next i

rsPatientID.Close

ListView1.ListItems.Clear

If Not (rsPatient.BOF And rsPatient.EOF) Then

While rsPatient.EOF = False

Set LItem = ListView1.ListItems.Add(, , rsPatient(0))

176
If rsPatient(1) <> "" Then

LItem.SubItems(1) = rsPatient(1)

End If

If rsPatient(2) <> "" Then

LItem.SubItems(2) = rsPatient(2)

End If

If rsPatient(3) <> "" Then

LItem.SubItems(3) = rsPatient(3)

End If

If rsPatient(4) <> "" Then

LItem.SubItems(4) = rsPatient(4)

End If

[BOOK SHOP MANAGEMENT SYSTEM]


If rsPatient(5) <> "" Then

LItem.SubItems(5) = rsPatient(5)

End If

If rsPatient(6) <> "" Then

LItem.SubItems(6) = rsPatient(6)

End If

176
If rsPatient(7) <> "" Then

LItem.SubItems(7) = rsPatient(7)

End If

If rsPatient(8) <> "" Then

LItem.SubItems(8) = rsPatient(8)

End If

If rsPatient(9) <> "" Then

LItem.SubItems(9) = rsPatient(9)

End If

rsPatient.MoveNext

Wend

[BOOK SHOP MANAGEMENT SYSTEM]


End If

rsPatient.Close

cmbSearch.Text = cmbSearch.List(0)

End Sub

Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)

If strCol <> ColumnHeader Then

ListView1.SortOrder = lvwAscending

ListView1.SortKey = ColumnHeader.Index - 1

176
strCol = ColumnHeader

Else

ListView1.SortOrder = lvwDescending

ListView1.SortKey = ColumnHeader.Index - 1

strCol = ""

End If

End Sub

Private Sub txtSearchText_Change()

cmdFind_Click

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]

176
ModuleMain

Public Con As ADODB.Connection

Public mySQL As String

Public ReportChoice As Integer

Public Xtwips As Integer, Ytwips As Integer

Public Xpixels As Integer, Ypixels As Integer

Type FRMSIZE

Height As Long

Width As Long

End Type

Public RePosForm As Boolean

Public DoResize As Boolean

[BOOK SHOP MANAGEMENT SYSTEM]


'The Project is start from here

Public Sub Main()

' If Date = "2/28/2007" Then

' MsgBox "Your License time limit is expired.", vbCritical

' End

' End If

176
Set Con = New ADODB.Connection

' Con.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; " & _

' "Persist Security Info = False; " & _

' "Data Source=" & App.Path & "\BookStore.mdb"

'

Con.CursorLocation = adUseClient

Con.ConnectionString=”Dsn=Book_Dsn”

Con.Open()

'frmSplashScreen.Show

frmMain.Show

'

'frmLogin.Show

'frmCurrency.Show

End Sub

[BOOK SHOP MANAGEMENT SYSTEM]


Sub Resize_For_Resolution(ByVal SFX As Single, _

ByVal SFY As Single, MyForm As Form)

Dim i As Integer

Dim SFFont As Single

SFFont = (SFX + SFY) / 2 ' average scale

' Size the Controls for the new resolution

On Error Resume Next ' for read-only or nonexistent properties

With MyForm

176
For i = 0 To .Count - 1

If TypeOf .Controls(i) Is ComboBox Then ' cannot change Height

.Controls(i).Left = .Controls(i).Left * SFX

.Controls(i).Top = .Controls(i).Top * SFY

.Controls(i).Width = .Controls(i).Width * SFX

Else

.Controls(i).Move .Controls(i).Left * SFX, _

.Controls(i).Top * SFY, _

.Controls(i).Width * SFX, _

.Controls(i).Height * SFY

End If

' Be sure to resize and reposition before changing the FontSize

.Controls(i).FontSize = .Controls(i).FontSize * SFFont

Next i

If RePosForm Then

[BOOK SHOP MANAGEMENT SYSTEM]


' Now size the Form

.Move .Left * SFX, .Top * SFY, .Width * SFX, .Height * SFY

End If

End With

End Sub

176
output

176
[BOOK SHOP MANAGEMENT SYSTEM]
CUSTOMERREPORT

176
[BOOK SHOP MANAGEMENT SYSTEM]
Purchase Report

176
[BOOK SHOP MANAGEMENT SYSTEM]
Sales Report

176
[BOOK SHOP MANAGEMENT SYSTEM]
Statistics Report Sales/Purchase

[BOOK SHOP MANAGEMENT SYSTEM]

176
TESTING

In the ideal circumstances a software engineer design an computer , a system, or a product with
“Testability” in mind. This enables the individuals charged with testing to design effective test cases more
easily. But what is “Testability”? James Bach describes testability in the following manner:-

Software testability is simply how easily a computer program can be tested. Since testing is so profoundly
difficult, it pays to know what can be done to it.

Sometimes programmers are willing to do things that will help the testing process and a checklist of
possible design points, features etc. can be useful in negotiation with them. There are certainly metrices
that could be used to measures testability in most of its aspects. Sometimes, testability is used to measure
testability in most of aspects. Sometimes, testability is used to mean how adequately a particular set of
tests will cover the product. Its also used by the military to mean how easily a tool xan be checked and
repaired in the field. These two meanings are not the same as software testability. The checklist that
follows provides a set of characteristics that lead to testable software.

[BOOK SHOP MANAGEMENT SYSTEM]


1. BLACK BOX TESTING

Black box testing, also called behavioral testing, focuses on the functional requirements of the software.
That is, black box testing enables the software engineer to derive sets of inputs conditions that fully
exercise all functional requirements for the program. Black box testing is not an alternative to white box
techniques. Rather, it is a complementry approach that is likely to uncover a different class of errors then
white box methods.

Black box testing attempts to find errors in the following categories:

a) Incorrect or missing function

176
b) Interface errors
c) Errors in data structures or external database access
d) Behavior or performance errors, and
e) Initialization or terminaton errors

When computer software is considered, black box testing alludes


to tests that are conducted at the software interface. Although they are designed to uncover errors, black
box tests are used to demonstrate that software functions are operational, that input is properly accepted
and output is correctly produced, and that the integrity of external information is maintained. A black box
test examines some fundamental aspect of a system with regard for the internal logical structure of the
software.

We have tested each and every function in the project and come to the
conclusion that they all have executed correctly. At the time when the project was in progress a number if
functions where deleted and then added due to which errors where generated. This errors where removed
time to time in the testing phase where I had to go in the depth study of the project. Its each and every
parts where executed at least 100 times to see wheter the working was anticipating the expected results or
not.

[BOOK SHOP MANAGEMENT SYSTEM]


Tests where Designed to answer the following questions?

 How is functional validity tested?


 How is system behavior and performance tested?
 What classes of inputs will make good test cases?
 Is the system particularly sensitive to certain input values?
 How are the boundaries of a data volume can the system tolerate?
 What effects will specific combinations of data have on system operations?

176
By applying Black Box technique, we derive a set of answers for the questions:

 The functional validity is checked by the execution of the functions one by one and fulfilling
the requirements of the functions as per the demand of the software. The functional validity
is checked by using suitable technique which lies on the code optimization, efficiency in
executions.

 System behavior is tested by certain tools and performance tests lies on the dumping of
large bulk of data into the application software database. The application database consists
of data’s with their appropriate width. The validation of the data’s linking of one data’s with
the other’s everything are tested before inputting them into the application software
database.

 Interactive classes of input are generally better for the good test classes .

 The system is sensitive for the system data because the whole application software is a time
domain software. Any error on the time parameter may crash the whole application. Time is
taken as an important parameter for all the calculations. This is why this application
software is sensitive to system time.

[BOOK SHOP MANAGEMENT SYSTEM]


 Boundary of data classs are isolated by giving the range of the arrays. Its totally a static
memory allocated. Hence, any error on the static array may crash the whole applications.

 The specific can tolerate 50MB of the memory of the data without any problem.

 The specific combinations of the data of center id and time. The application program has no
control over time and id. Both are generated automatically.

176
ALPHA AND BETA TESTING

It is virtually impossible for a software developer to foresee how the user will really use a program.
Instructions for use may be misinteperated, strange combinations of data may be regularly used; output
that seemed clear to the tester may be unintelligible to the user in the filed.

When software is built for one person, a series of acceptance tests are conducted to enable
the user to validate all requirements. Conducted by the end-user rather than software engineers, an
acceptance test can range from an informal “test-drive” to a planned and systematically executed series of
tests. In fact, acceptance testing can be conducted over a period of time thereby uncovering errors that
might degrade the system overtime.

If software is developed as a product to be used by many peoples, it is


impractical to perform acceptance tests with one another. Most software builders use a process called
alpha and beta testing to uncover error that only the end user seems able to find. The alpha test is
conducted at the developer site by a patients. The software is used in a natural setting with a developer
“looking over the shoulder” of the users and recording errors and usage problems. Alpha tests are
conducted in an controlled environment. The beta test is conducted at one or more patients site by the end
user of software. Unlike alpha testing, the developer is generally not present. Therefore the beta test is a
“live” application of the software in an environment that cannot encountered in beta testing a reports

[BOOK SHOP MANAGEMENT SYSTEM]


these to the developer at regular interval. As a result of problems reported during beta tests. Software
engineers make modifications and then prepare for the release of the software product to the entire
employee base. I this stage alpha and beta testing where also done to determine the working of the
software i.e.to check the validation of the software, whether the results which it is generating is valid or
not.

Alpha Testing

When user software is build for one employee a serial of dependent tests ate conducted to enable the users
to validate the requirement conducted by an user rather than software engineers. And acceptance test can
from an informal to applied systematically. This test is conducted at developer site by a user the software

176
is used in a natural setting with the developers as we can say-“lookin over the soldier” of the user and
recording errors alpha test are conducted then a control.

Beta Testing

The beta testing is conducted at one or more users’ side by the user of the software. Unlike alpha testing
the developer generally is not present therefore Beta testing is live application of the software that
controlled by the developer at the result the software engineerings may modify and then prepare for
release of the software.

[BOOK SHOP MANAGEMENT SYSTEM]

176
SECURITY MECHANISMS

Any user, who is authorized by the administrator to operate the software, receives a unique user ID and a
password with the help of which he can log into the system. To login the user goes through the system
menu. He is then presented with the login box where he has to enter the username and password to login.

In this software, the login Id and password which is created for


the login for the operation is strictly maintained in the database by the automatic automation. This way,
we can easily find out at what time which user login to handle the process which is done by the specified
work. If there will be any problem by the handling of the money and the transaction, we can check is
there any user is doing anything wrong or not. The database maintained when the user login for the
transaction or for any other purpose, it shows time and date in which period he/she was working at that
time. Same user can log on many times after taking logout from the software.

In this security features user may belongs to any of the two categories:-

1. Authorized User 2. Administration

First when the software is installed in the organisation the software developer provide the user Id and

[BOOK SHOP MANAGEMENT SYSTEM]


password for the different work for different people. Like we provide the user Id and password to staff of
the hospital to process some work but not all, same way the administrator get all the features for the
processes. He can do anything as he wants to do. Administrator provides the work for the staff of the
hospital as per their requirement.

The user loggin in may access only certain features within the software. A user will only be allowed to
view the records and opening different types of features and maintaining the database, providing the
requirement of the user as they demanded. Every user get the unique and password. Every new user will
be assigned a unique name along with a password by the administrator. The list of all users is maintained
by the administrator of the software.

176
Once the administrator logs into the system, he has access to all the features within the
system other than all essential details, the administrator has a separate responsibility which includes
managing users and their details. So if a new user has to be added, this can be done by the administrator.
Therefore we have seen that a person who is logging in as a user who does not exists in the user logging
in is not a valid user that is the user is not available in the table.

When sometimes the user logging in gives a incorrect password then


message box is displayed which informs the user that the password enterd is not correct and may try
again. Any user, who is authorized by the administrator to operate the software, receives a unique user Id
and a password with the help of which he can log into the system. To login the user goes through the
SYSTEM menu. He’s then presented with the login box where he has to enter the username and password
to login.

[BOOK SHOP MANAGEMENT SYSTEM]

176
COST ESTIMATION OF THE PROJECT

 Predicting the resources required for a software development process

Topics covered

 Feasibility Analysis
 Productivity measures
 Estimation techniques
 Algorithmic cost modelling
 Project duration

Feasibility Analysis

Feasibility: – the measure of how beneficial or practical an information system will be to an


organization.

Feasibility analysis: – the process by which feasibility is measured.

Three Tests for Feasibility

[BOOK SHOP MANAGEMENT SYSTEM]


Technical feasibility: – a measure of the practicality of a technical solution and the availability of
technical resources and expertise.

Economic feasibility: - a measure of the cost-effectiveness of a project or solution.

Operational feasibility – a measure of how well a solution will work or be accepted in an organization.

Economic Feasibility = Cost-Benefit Analysis

176
Costs:

 Development costs are one time costs that will not recur after the project has been completed.
 Operating costs are costs that tend to recur throughout the lifetime of the system. Such costs
can be classified as:
 Fixed costs — occur at regular intervals but at relatively fixed rates.

 Variable costs — occur in proportion to some usage factor.

Benefits:

 Tangible benefits are those that can be easily quantified.


 Intangible benefits are those benefits believed to be difficult or impossible to quantify.

Three Popular Techniques to Assess Economic Feasibility

 Payback Analysis
 Return On Investment
 Net Present Value

The Time Value of Money is a concept that should be applied to each technique. The time value of
money recognizes that a dollar today is worth more than a dollar one year from now.

[BOOK SHOP MANAGEMENT SYSTEM]


Software cost components

 Hardware and software costs


 Travel and training costs
 Personnel costs (the dominant factor in most projects)
 salaries of engineers involved in the project
 Social and insurance costs
 Must also take project overhead into account
 costs of building, heating, lighting
 costs of networking and communications
 Costs of shared facilities (e.g. library, staff restaurant, etc.)

176
Fundamental estimation questions

 How much effort is required to complete an activity?


 How much calendar time is needed to complete an activity?
 What is the total cost of an activity?
 Project estimation and scheduling are interleaved management activities

Costing and pricing

 Estimates are made to discover the cost, to the developer, of producing a software system
 There is not a simple relationship between the development cost and the price charged
 Broader organisational, economic, political and business considerations influence the price
charged

Productivity measures

 Size related measures based on some output from the software process. This may be lines of
delivered source code, object code instructions, etc.
 Function-related measures based on an estimate of the functionality of the delivered software.
Function-points are the best known of this type of measure

Measurement problems

[BOOK SHOP MANAGEMENT SYSTEM]


 Estimating the size of the measure
 Estimating the total number of programmer months which have elapsed
 Estimating contractor productivity (e.g. documentation team) and incorporating this
estimate in overall estimate

Lines of code

 What is a line of code?


 Productivity measures will vary from language to language – consider difference between lines of
code in assembler versus Java
 Relationship to functionality must be based on past efforts in the same language

176
Productivity estimates

System Category LOC/person-month

Real-time embedded systems 40-160

Systems programs 150-400

Commercial applications 200-800

Function points

 Based on a combination of program characteristics


 external inputs and outputs
 user interactions
 external interfaces
 files used by the system
 A weight is associated with each of these
 The function point count is computed by multiplying each raw count by the weight and
summing all values

[BOOK SHOP MANAGEMENT SYSTEM]


Function points

 Function point count modified by complexity of the project


 FPs can be used to estimate LOC depending on the average number of LOC per FP for a given
language
 LOC = AVC * number of function points
 AVC is a language-dependent factor varying from 200-300 for assemble language to 2-40 for a
4GL
 FPs are very subjective. They depend on the estimator.
 Automatic function-point counting is impossible

176
4GL Object points

 Object points are an alternative function-related measure to function points when 4Gls or similar
languages are used for development
 Object points are NOT the same as object classes
 The number of object points in a program is a weighted estimate of
a)The number of separate screens that are displayed

b)The number of reports that are produced by the system

c)The number of 3GL modules that must be developed to supplement the 4GL code

Object Point Estimation

 Object points are easier to estimate from a specification than function points as they are simply
concerned with screens, reports and 3GL modules
 They can therefore be estimated at an early point in the development process. At this stage, it is
very difficult to estimate the number of lines of code in a system

Quality and productivity

 All metrics based on volume/unit time are flawed because they do not take quality into
account

[BOOK SHOP MANAGEMENT SYSTEM]


 Productivity may generally be increased at the cost of quality
 It is not clear how productivity/quality metrics are related
 If change is constant then an approach based on counting lines of code is not as meaningful

Estimation techniques

 There is no simple way to make an accurate estimate of the effort required to develop a software
system
 Initial estimates are based on inadequate information in a user requirements definition
 The software may run on unfamiliar computers or use new technology
 The skills of people working on the project may be unknown
 Project cost estimates may be self-fulfilling
 The estimate defines the budget and the product is adjusted to meet the budget

176
 Expert judgement
 Estimation by analogy
 Parkinson's Law
 Pricing to win
 Algorithmic cost modelling

Expert judgement

 One or more experts in both software development and the application domain use their
experience to predict software costs. Process iterates until some consensus is reached.
 Advantages: Relatively cheap estimation method. Can be accurate if experts have direct
experience of similar systems
 Disadvantages: Very inaccurate if there are no experts!

Estimation by analogy

 The cost of a project is computed by comparing the project to a similar project in the same
application domain
 Advantages: Accurate if project data available
 Disadvantages: Impossible if no comparable project has been tackled. Needs systematically
maintained cost database

[BOOK SHOP MANAGEMENT SYSTEM]


Parkinson's Law

 The project costs whatever resources are available (typically used within an organization)
 Advantages: No overspend
 Disadvantages: System is usually left unfinished

Pricing to win

 The project costs whatever the organisation has to spend on it


 Advantages: You get the contract
 Disadvantages: Costs do not accurately reflect the work required. Either: (1) the management
does not get the desired system or (2) the management overpays.
 This approach may seem unethical and unbusiness-like

176
 However, when detailed information is lacking it may be the only appropriate strategy
 The most ethical approach:
 The project cost is agreed on the basis of an outline proposal and the development is
constrained by that cost
 A detailed specification may be negotiated or an evolutionary approach used for system
development

Top-down and bottom-up estimation

 Any of these approaches may be used top-down or bottom-up


 Top-down
 Start at the system level and assess the overall system functionality and how this is delivered
through sub-systems
 Bottom-up
 Start at the component level and estimate the effort required for each component. Add these
efforts to reach a final estimate
 Usable without knowledge of the system architecture and the components that might be part of
the system
 Takes into account costs such as integration, configuration management and documentation
 Can underestimate the cost of solving difficult low-level technical problems

[BOOK SHOP MANAGEMENT SYSTEM]


Bottom-up estimation

 Usable when the architecture of the system is known and components identified
 Accurate method if the system has been designed in detail
 May underestimate costs of system level activities such as integration and documentation

Estimation methods

176
 Each method has strengths and weaknesses
 Estimation should be based on several methods
 If these do not return approximately the same result and the differences cannot be reconciled,
there is insufficient information available
 Some action should be taken to find out more in order to make more accurate estimates

Experience-based estimates

 Estimating is primarily experience-based


 However, new methods and technologies may make estimating based on experience inaccurate
 Object-oriented rather than function-oriented development
 Client-server systems rather than mainframe systems
 Many off the shelf components
 Component-based software engineering
 Use of new CASE tools and program generators

Algorithmic cost modelling

 A formulaic approach based on historical cost information and which is generally based on the
size of the software
 Cost is estimated as a mathematical function of product, project and process attributes whose
values are estimated by project managers

[BOOK SHOP MANAGEMENT SYSTEM]


Algorithmic cost modelling

 Effort in PM = A ´ SizeB ´ M
 A is depends in on the type of software that is being developed (simple, moderate, embedded)
[will vary 2.4-3.5]
 Size is an estimate of the code size or other functional assessmemt [thousands of lines of code, ie.
5,400 LOCà 5.4]
 B reflects the disproportionate effort for large projects over small projects [typically 1.0-1.5]
 M is a multiplier reflecting a combination of product, process and people attributes (e.g. desired
reliability, reuse required, personnel capability and expereince, support facilities) [will vary up
from 1.0]

176
Estimation accuracy

 The size of a software system can only be known accurately when it is finished
 Several factors influence the final size
 Use of “off the shelf” components
 Programming language
 Distribution of system
 As the development process progresses then the size estimate becomes more accurate

Estimate uncertainty

4x
Estimate uncertainty:
As the project progresses
the probablilty of a difference in
actual to estimate decreases
2x

x Code
Feasibility Requirements Design Delivery

[BOOK SHOP MANAGEMENT SYSTEM]


Actual
0.5x
Person-

months

0.25x
x = estimated person-months

COCOMO

 Constructive Cost Model

176
 An empirical model based on project experience
 Well-documented, ‘independent’ model which is not tied to a specific software vendor
 Long history from initial version published in 1981 (COCOMO-81) through various
instantiations to COCOMO 2
 COCOMO 2 takes into account different approaches to software development, reuse, etc.
 Can be used as a sanity check

Estimate Cost and Duration Very Early in Project

1. Use the function point method to estimate lines of code

2. Use Boehm’s formulas to estimate labor required

3. Use the labor estimate and Boehm’s formula to estimate duration

Basic COCOMO Formulae (Boehm)

Effort in Person-months = aKLOC b

Duration in Months = c Effort d

Where c = labour estimate, d = complexity of project type

These values are selected from a table such as the one below.

[BOOK SHOP MANAGEMENT SYSTEM]


Software Project a b c d

Organic 2.4 1.05 2.5 0.38

Semidetached 3.0 1.12 2.5 0.35

Embedded 3.6 1.20 2.5 0.32

176
PERT CHART

PERT CHART stand for Program Evaluation Review Techniques, unlike bar chart PERT can be both a
cost and a time management system. PERT is organized by events and activity or task. One advantage of
the PERT chart is that it is a schedule device that also shows graphically which task must be completed
before others are begun.

Advantage of the pert chart is as follows:

 It force the manager to the plan


 It shows the interrelationship among the tasks in the project and in particularly it identified the
critical path of the project, thus helping to focus on it.
 It exposes all the particularly all-possible parallelism in the activities and thus help in allocating
the resources.
 It allows scheduling and simulation of alternative schedules.
 It enables the manager to monitor and control the project.

[BOOK SHOP MANAGEMENT SYSTEM]

176
Program Evaluation Review Techniques (P.E.R.T) Chart
Project
Initiation

Preliminary

Investigation

s.start s.finish

Actual actual
Preliminary
Start Finish
Investigation

Preliminary

Investigation

s.start s.finish

Problem R.A Decision


Actual actual
Analysis
StartAnalysis
Finish
Preliminary

Preliminary Investigation Preliminary

Investigation Investigation

[BOOK SHOP MANAGEMENT SYSTEM]


s.start s.finish

s.start s.finish s.start s.finish

Actual actual Actual actual Actual Design


actual Computation

Start Finish Start Finish Start Finish

Preliminary Preliminary

Investigation Investigation

s.start s.finish s.start s.finish

Actual actual Implementation


Actual actual

Start Finish StartPreliminary


Finish
Investigation

s.start s.finish 176

Actual actual
LIMITATION OF THE PROJECT

This is the demo project so, it can’t be use in real world. Because, when the project is
running it may produce some errors. And the database is restricted because the shopkeepers can’t
add the records more than hundred records. This project can use more memory and more cpu.
Finally, we can say the this project is made for the shopkeepers but they can’t use in real.

[BOOK SHOP MANAGEMENT SYSTEM]

176
SCOPE OF THE FUTURE APPLICATION

As this is the demo project for submitting in BCA 6th sem. But It can be used in a real world after

some modification like employee details, Accounts etc. This project in developed for the small book

shops like suboth granth mala etc.

[BOOK SHOP MANAGEMENT SYSTEM]

176
BIBLIOGRAPHY

 MSDN Library

 Mastering Visual Basic 6


(PETROUTSOS, BPB PUBLICAIONS)

 Complete reference to visual basic 6


(BPB Publications)

 Beginner To Pro Murach’s Visual Basic 6


(Joel Murach, Anne Prince, BPB Publications)

 Teach Yourself visual Bsic 6


(Scott Warner, TATA McGraw HILL publications)

 Database System Concepts


(H.F.KORTH, McGraw HILL Publications)

 SQL, PL/SQL The Programming Language of SQL Server

[BOOK SHOP MANAGEMENT SYSTEM]

176
176
[BOOK SHOP MANAGEMENT SYSTEM]

You might also like