Library Automated System Visual Basic Ne
Library Automated System Visual Basic Ne
Library Automated System Visual Basic Ne
In collaboration with
Abstract
This report is an attempt to delineate and discuss a technology that is used within Microsoft’s .Net
framework called Visual Basic.Net. A thorough quantitative investigation is conducted via a project that
focuses on a vision of replacing a traditional manual library system, with a simplified and efficient
automated process with the client-side handled by Visual Basic.Net and a server-side database
requirements achieved through Microsoft Access.
1
Acknowledgement
I am incredibly grateful to Mr Niloy Kanti Pandit (VB.Net lecturer and project supervisor) not only for
his invaluable guidance but also for his unending encouragement that he has given to me throughout the
VB.Net course and project. I would candidly mention, that without Mr Pandit, this project simply could
not have been possible is not an overstatement, given the time frame that was given for such a project to
be conducted.
I hope that this project is a reflection of his teaching and expertise in the subject that he has passed on to
me. This course and project has been an interesting, challenging and most enthralling experience. Mr
Pandit has been a great mentor affirmed by him being a constant source of inspiration, motivation for
hard work and his constant constructive criticism.
I humbly thank him for his patience, humour and knowledge, and I hope to continue forward with this
momentum to better and more exciting days with my career.
Signature of student
____________________
____________________
2
Table of contents
Chapter 1: Introduction.
4.2 File.
4.3 Customer.
4.3.1 Add/Delete/Update Customer.
4.4 View.
4.5 Setting.
3
4.6 Help
4.6.1 Licence.
4.6.2 About.
Chapter 6: References.
Chapter 1: Introduction.
This project of the “Library Automation System” (LAS) gives us complete information about a library
management system with the purpose of being designed and developed for the receipt and insurance of
books registered within the library along with respective clients’ details.
We can enter records of new books through a ‘Books Entry Form’ and retrieve the details of the books
available in the library and the ones that have been checked-out on loan. The purpose of issuing books is
to address the needs for the ‘target client audience’ of this project, students say, whose respective details
are first entered via a ‘Student Entry Form’. These students will be able to check the availability of books
that are registered within the system and with their designated IDs that have been generated in order to
access/take-out the books that are available via the ‘Books Issue Form’, students will be able to view their
records, check the number of books that they have issued and the available stock of literature that is
available in the library. Moreover, to make the experience for a user of the LAS even more compelling,
we have included a process that also penalises, say the students, who fail to return the books issued after
the allotted due date, through a fine.
This documentation attempts to delineate the vision of this project: to present the information and
comments about the various technologies implemented, in an easy and intuitive manner for those firms in
industry that would want to convert a manual library system to an efficient and simplified automated
version.
We would like to now highlight the key motivations for such a project:
! Time efficiency optimization: Using computers can save a lot of time. This is possible, as computers are
fast, efficient and more accurate as compared to human beings.
! Quick report generation: A computerized system can help on generating different types of reports. This
can be done easily by merely pressing few keys. Reports can be easily obtained at the spur of the moment
unlike a manual system.
! Cornucopia of details available: A large amount of details can be obtained easily in a computerized
system which otherwise may not be available in a manual system, if not, would most assuredly take a
significantly longer time to process and organise.
! Efficient and accurate management: Computerization will increase the efficiency and accuracy of the
‘manual’ library management system.
4
! Faster and easier data retrieval: By using a computerized system data can be retrieved at a much faster
pace. Old records can be located immediately and easily. Relationships between books, users, penalties etc.
have already been established and are available for the admin/users requirements.
! Economical: Due to computerization, more accurate functioning implies a cheaper long-term maintenance
can be obtained as compared to manual systems.
! Decreased number of people: Computerization will decrease the dependence on wasted resources. It will
decrease the number of people required for maintaining records of the books and all the client-information
that uses the Library’s facilities.
It is only appropriate to now explore the primary technology that is being implemented for the client-
side requirements for this project: Visual Basic.Net (VB.Net).
! Provide the clients of the LAS to spend more time on mastering the application and enjoy a
simplified process as opposed to worrying about the design and code that was used for the
implementation of the LAS, for instance: which keystrokes to what within menu and dialog boxes.
! To provide the programmer to have a long, deep connection with the LAS: to constantly think of
ways of improving the user experience with using shorter lines of code, to anticipate and cover as
many possibilities of the users’ decision making process, that the developer can perceive.
! To minimise the frustrations of the programmer when developing. For instance, the functionality
of the mouse, where the user was inside a menu, and whether he or she was clicking or double
clicking at a given place.
! Allows for the creation of a robust and creative application that uses minimal loading time to
provide the integration of graphics programming: establishing an impressive outlook with
powerful functionality.
Economic analysis is the most frequently method for evaluating the effectiveness of a potential
system. This is also known as cost/benefit analysis. The procedure is to determine the benefits and
savings that are expected from a potential system and assessed by the costs.
Student information, account information etc. are very costly and without proper handling there
is a probability of mishandling them. This project is focuses on being easy to understand and user
friendly. From this analysis we have come to the conclusion that the total benefits exceeds the
total cost invested in the project.
This type of study is focused on replacing the exiting computer system and explores to what
extent it can support the proposed ‘new system’. This involves financial considerations to
accommodate technical enhancement, where should the budget be a serious constraint, then the
project is judged not feasible. However, with regard to this project, it is classified as feasible on
6
the basis of a low-level technical requirement as this system handles large amount of data in an
efficient manner.
In this analysis, an estimate is made of how strong a reaction the user is likely to have towards
the development of a computerized, automated system. This advanced system will provide the
necessary support for the client side as it increases the handling of large amounts of data within
the database.
The Data Flow Diagram (DFD) was first designed by Larry Constantine as a way of expressing system
requirements of a problem in a graphical form; this led to a modular design. A DFD, also known as
“bubble chart,” has the purpose of clarifying system requirements and identifying major transformations
that will become programs in a system design. So, it is the starting point of the design phase that
functionally decomposes the requirement specifications down to the lowest level of detail.
A DFD consists of series of bubbles joined by lines represent data flows in the system. Essentially boils
down to:
2) An arrow identifies data flow- data in motion. It is a pipeline through which information flows.
3) A circle or a “bubble” (some people use an oval bubble) represents a process that transforms
incoming data flows(s) into outgoing data flow(s).
As a graphical tool, a DFD is essentially used to describe and analyse the movement of data through a
system that is either manual or computerized. Focused on the data flow within the system, between ‘in-
coming’ processes and ‘out-going’ of the data stores. A DFD comprises of two primary levels:
It represents a model of the current system and is used to ensure that the system has been clearly
understood. Physical DFDs show actual devices, departments, people etc. involved in the current,
proposed system.
During the design phase of the proposed system, this DFD is taken as the basis for drawing the
system. Logical DFDs represent models of the proposed system and clearly show the requirements
upon which it should be built.
7
Finally, we should also mention that both physical and logical DFDs support a top-down approach to
system analysis. For this purpose, analysts began by developing a general understanding of the system
and gradually components exploded in greater detail. This achieved through the context diagram: first-
level DFDs and second-level DFDs.
MEANING COMMENT
= Source destination May be one customer or number transaction of
= Process that transfer data flow May be a clerk computing discount or a procedure
= Data store May be a card file, a filing cabinet on disk etc.
8
3.2 O-level DFD: To verify user application
VALIDATION
LOGIN
VALIDATE
USER
SUCCEEDED
USER MAIN MENU
NAME AND
VALIDATION FAILED
INVALID USER/ PASSWORD
MAIN MENU
USER
DETAIL
Input
data
of
the
allotted
applicant
only
9
3.4 2-Level DFD of the whole project:
save new save new
delete
USER
User
INFORMATION REGISTRATION
first
first
next
next last
last previous previous delete
save
save new delete
ACCOUNTS
STORE IN FILE Pusrchasing
DETAILS information
first previous
new first
previous
next last
delete
next last
10
3.5 Entity Relationship Diagram
P.No.
Library CONTENTS Acc.No.
.
Management
Primary
Has
add
to
College‘s
primary
User Acc. No.
record
NAME User Details
Count
User
verify
or
App.
details
Work
pair
Purchasing
Password Other item
Information
Capacity is
Check
details
Application feasible
Ok
User Acc. User feasible
No.
Incorrect
User feasible 1
a) Books table
BookID Text
GroupID Text
11
BookName Text
Publisher Text
Author Text
PublishingYear Text
Edition Text
Price Number
Status Text
b) Customer table
CID Text
CName Text
CAddress Text
CContact Text
CSecurity Number
CActiveDate Date/Time
CValid Date/Time
c) GroupID table
GroupID Text
GroupName Text
d) Issue table
BookID Text
GroupID Text
BookName Text
IssueTo Text
12
Issuename Text
IssueDate Text
DueDate Text
e) Returns table
BookID Text
GroupID Text
BookName Text
IssueTo Text
Issuename Text
IssueDate Text
DueDate Text
ReturnDate Text
Status Text
13
MainForm.vb code:
Public
Class
MainForm
Private
Sub
MainForm_FormClosing(ByVal
sender
As
Object,
ByVal
e
As
System.Windows.Forms.FormClosingEventArgs)
Handles
Me.FormClosing
My.Settings.MainSize
=
Me.Size
My.Settings.MainLocation
=
Me.Location
My.Settings.Save()
End
End
Sub
Private
Sub
MainForm_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Try
Me.Size
=
My.Settings.MainSize
Me.Text
=
My.Settings.CompanyName
&
"
Management
System"
Me.Location
=
My.Settings.MainLocation
Me.BackgroundImage
=
Image.FromFile(My.Settings.MainImage)
Catch
ex
As
Exception
'Finally
'
If
My.Settings.LicenseKey
=
""
Then
'
My.Settings.NoUse
=
My.Settings.NoUse
-‐
1
'
My.Settings.Save()
'
Me.Text
=
Me.Text
&
"
:
You
can
still
use
"
&
My.Settings.NoUse
&
"
times."
'
End
If
'
If
My.Settings.NoUse
<
0
Then
'
MsgBox("Trial
usages
finished!",
MsgBoxStyle.Exclamation,
"")
'
Me.Close()
'
End
If
End
Try
End
Sub
Private
Sub
ExitToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ExitToolStripMenuItem.Click
Me.Close()
End
Sub
Private
Sub
AddBooksToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
AddBooksToolStripMenuItem.Click
AddBooks.MdiParent
=
Me
AddBooks.Show()
End
Sub
Private
Sub
IssueBookToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
IssueBookToolStripMenuItem.Click
IssueBook.MdiParent
=
Me
IssueBook.Show()
End
Sub
Private
Sub
ReturnBookToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ReturnBookToolStripMenuItem.Click
ReturnBook.MdiParent
=
Me
ReturnBook.Show()
End
Sub
Private
Sub
BookReportToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
BookReportToolStripMenuItem.Click
BookDetail.MdiParent
=
Me
BookDetail.Show()
End
Sub
Private
Sub
CloseAllToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
CloseAllToolStripMenuItem.Click
Dim
child
As
Form
For
Each
child
In
MdiChildren
child.Close()
14
Next
End
Sub
Private
Sub
AddGroupToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
AddGroupToolStripMenuItem.Click
GroupID.MdiParent
=
Me
GroupID.Show()
End
Sub
Private
Sub
PictureToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
PictureToolStripMenuItem.Click
With
OpenFileDialog1
.FileName
=
""
.Filter
=
".jpg|*.jpg|.png|*.png|.gif|*.gif|.bmp|*.bmp"
End
With
If
OpenFileDialog1.ShowDialog
=
Windows.Forms.DialogResult.OK
Then
PictureToolStripMenuItem.Checked
=
True
Dim
BackFile
As
String
BackFile
=
OpenFileDialog1.FileName
Me.BackgroundImage
=
Image.FromFile(BackFile)
My.Settings.MainImage
=
BackFile
My.Settings.Save()
End
If
End
Sub
Private
Sub
AddCustomerToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
AddCustomerToolStripMenuItem.Click
AddCustomer.MdiParent
=
Me
AddCustomer.Show()
End
Sub
Private
Sub
ViewCustomerToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ViewCustomerToolStripMenuItem.Click
CustomerDetail.MdiParent
=
Me
CustomerDetail.Show()
End
Sub
Private
Sub
HelpToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
HelpToolStripMenuItem.Click
End
Sub
Private
Sub
BackgroundToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
BackgroundToolStripMenuItem.Click
End
Sub
Private
Sub
AllRentedToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
AllRentedToolStripMenuItem.Click
AllRented.MdiParent
=
Me
AllRented.Show()
End
Sub
Private
Sub
AboutToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
AboutToolStripMenuItem.Click
About.MdiParent
=
Me
About.Show()
End
Sub
Private
Sub
LicenseToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
LicenseToolStripMenuItem.Click
LicenseForm.MdiParent
=
Me
LicenseForm.Show()
End
Sub
Private
Sub
ChangeNameToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ChangeNameToolStripMenuItem.Click
15
ChangeName.MdiParent
=
Me
ChangeName.Show()
End
Sub
Private
Sub
ViewToolStripMenuItem_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ViewToolStripMenuItem.Click
End
Sub
End
Class
4.2 File.
4.2.1 - 3 Add Books + Add Group + Issue Book
AddBooks.vb code:
Public
Class
AddBooks
Public
NameFrm,
NameTo
As
String
Public
NoBook
As
Integer
Private
Sub
Button9_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button9.Click
Me.Close()
End
Sub
Private
Sub
AddBooks_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
NoBook
=
0
Call
generateyear()
Call
disablethem()
Call
readData()
Call
GroupID_Combo()
End
Sub
Sub
GroupID_Combo()
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("Select
GroupID
from
GroupD",
objcon)
dr
=
com.ExecuteReader
While
dr.Read
ComboBox1.Items.Add(dr.Item(0))
16
End
While
dr.Close()
objcon.Close()
Catch
ex
As
Exception
End
Try
End
Sub
Sub
generateyear()
Dim
YearNow
As
Integer
YearNow
=
Int(My.Computer.Clock.LocalTime.Year.ToString)
Dim
a,
b,
c
As
Integer
a
=
YearNow
-‐
5
b
=
YearNow
For
c
=
a
To
b
ComboBox2.Items.Add(c)
Next
End
Sub
Private
Sub
ComboBox1_LostFocus(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
ComboBox1.LostFocus
ComboBox1.Text
=
ComboBox1.Text.ToUpper()
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
ComboBox3.Text
=
"Available"
Call
enablethem()
End
Sub
Private
Sub
TextBox2_LostFocus(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox2.LostFocus
NameFrm
=
TextBox2.Text
Call
Sentence()
TextBox2.Text
=
NameTo
End
Sub
Sub
disablethem()
'TextBox1.Enabled
=
False
TextBox2.Enabled
=
False
TextBox3.Enabled
=
False
ComboBox1.Enabled
=
False
TextBox4.Enabled
=
False
TextBox5.Enabled
=
False
TextBox6.Enabled
=
False
ComboBox2.Enabled
=
False
ComboBox3.Enabled
=
False
End
Sub
Sub
enablethem()
TextBox1.Enabled
=
True
TextBox2.Enabled
=
True
TextBox3.Enabled
=
True
ComboBox1.Enabled
=
True
TextBox4.Enabled
=
True
TextBox5.Enabled
=
True
TextBox6.Enabled
=
True
ComboBox2.Enabled
=
True
ComboBox3.Enabled
=
True
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
ComboBox1.Text
=
""
ComboBox2.Text
=
""
ComboBox3.Text
=
""
End
Sub
17
Sub
Sentence()
Dim
a,
b
As
Integer
a
=
NameFrm.Length
NameTo
=
""
For
b
=
0
To
a
-‐
1
If
b
=
0
Then
If
Char.IsLower(NameFrm(0))
Then
NameTo
=
Char.ToUpper(NameFrm(0))
Else
NameTo
=
NameFrm(0)
End
If
Else
If
NameFrm(b
-‐
1)
=
"
"
Then
NameTo
=
NameTo
+
Char.ToUpper(NameFrm(b))
Else
NameTo
=
NameTo
+
NameFrm(b)
End
If
End
If
Next
End
Sub
Private
Sub
TextBox3_LostFocus(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox3.LostFocus
NameFrm
=
TextBox3.Text
Call
Sentence()
TextBox3.Text
=
NameTo
End
Sub
Private
Sub
TextBox3_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox3.TextChanged
End
Sub
Private
Sub
TextBox4_LostFocus(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox4.LostFocus
NameFrm
=
TextBox4.Text
Call
Sentence()
TextBox4.Text
=
NameTo
End
Sub
Private
Sub
TextBox4_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox4.TextChanged
End
Sub
Private
Sub
TextBox5_LostFocus(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox5.LostFocus
NameFrm
=
TextBox5.Text
Call
Sentence()
TextBox5.Text
=
NameTo
End
Sub
Private
Sub
TextBox5_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox5.TextChanged
End
Sub
Private
Sub
Button2_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
If
TextBox1.Text
=
""
Then
MsgBox("Please
enter
the
Book
ID!",
0,
"")
Else
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("INSERT
INTO
Books
VALUES('"
&
TextBox1.Text
&
"','"
&
ComboBox1.Text
&
"','"
&
TextBox2.Text
&
"','"
&
TextBox3.Text
&
"','"
&
TextBox4.Text
&
"','"
18
&
ComboBox2.Text
&
"','"
&
TextBox5.Text
&
"','"
&
TextBox6.Text
&
"','"
&
ComboBox3.Text
&
"')",
objcon)
com.ExecuteNonQuery()
Call
readData()
MsgBox("Saved
successfully",
0,
"SUCCESS")
objcon.Close()
Catch
ex
As
Exception
End
Try
End
If
End
Sub
Sub
readData()
ListView1.Clear()
NoBook
=
0
ListView1.Columns.Add("BOOK
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("GROUP
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("BOOK
NAME",
310,
HorizontalAlignment.Center)
ListView1.Columns.Add("PUBLISHER",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("AUTHOR",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("PUBLISHING
YEAR",
130,
HorizontalAlignment.Center)
ListView1.Columns.Add("EDITION",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("PRICE",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("STATUS",
90,
HorizontalAlignment.Center)
ListView1.View
=
View.Details
Try
If
(objcon.State
=
ConnectionState.Closed)
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
Books
",
objcon)
dr
=
com.ExecuteReader
While
dr.Read()
Call
adddatatolistview(ListView1,
dr(0),
dr(1),
dr(2),
dr(3),
dr(4),
dr(5),
dr(6),
dr(7),
dr(8))
NoBook
=
NoBook
+
1
End
While
dr.Close()
objcon.Close()
If
NoBook
=
1
Or
NoBook
=
0
Then
Label11.Text
=
"There
is
"
&
NoBook
&
"
Book
in
the
Library."
Else
Label11.Text
=
"There
are
"
&
NoBook
&
"
Books
in
the
Library."
End
If
Catch
'MsgBox("Please
Refresh",
MsgBoxStyle.Information,
"")
End
Try
End
Sub
Public
Sub
adddatatolistview(ByVal
lvw
As
ListView,
ByVal
BookID
As
String,
ByVal
GroupID
As
String,
ByVal
BookName
As
String,
ByVal
Publisher
As
String,
ByVal
Author
As
String,
ByVal
PubYear
As
String,
ByVal
edi
As
String,
ByVal
pric
As
String,
ByVal
st
As
String)
Dim
lv
As
New
ListViewItem
lvw.Items.Add(lv)
lv.Text
=
BookID
lv.SubItems.Add(GroupID)
lv.SubItems.Add(BookName)
lv.SubItems.Add(Publisher)
lv.SubItems.Add(Author)
lv.SubItems.Add(PubYear)
lv.SubItems.Add(edi)
lv.SubItems.Add(pric)
lv.SubItems.Add(st)
End
Sub
Private
Sub
Button8_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button8.Click
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
19
If
MessageBox.Show("Do
you
really
want
to
delete?",
"ARE
YOU
SURE",
MessageBoxButtons.YesNo)
=
Windows.Forms.DialogResult.Yes
Then
com
=
New
OleDb.OleDbCommand("DELETE
FROM
Books
WHERE
BookID='"
&
TextBox1.Text
&
"'",
objcon)
com.ExecuteNonQuery()
objcon.Close()
MsgBox("Deleted
successfully",
0,
"SUCCESS")
Call
readData()
End
If
Catch
ex
As
Exception
End
Try
End
Sub
Sub
fill_list()
com
=
New
OleDb.OleDbCommand("Select
*
from
Books",
objcon)
Dim
dr
As
OleDb.OleDbDataReader
dr
=
com.ExecuteReader
dr.Read()
While
(dr.NextResult)
End
While
End
Sub
Private
Sub
GroupBox1_Enter(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
GroupBox1.Enter
End
Sub
Private
Sub
TextBox1_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox1.TextChanged
Dim
i
As
Integer
ListView1.SelectedItems.Clear()
TextBox1.Focus()
Try
If
Me.TextBox1.Text
=
""
Then
TextBox2.Text
=
""
Else
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
TextBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Then
ComboBox1.Text
=
ListView1.Items(i).SubItems(1).Text
TextBox2.Text
=
ListView1.Items(i).SubItems(2).Text
TextBox3.Text
=
ListView1.Items(i).SubItems(3).Text
TextBox4.Text
=
ListView1.Items(i).SubItems(4).Text
ComboBox2.Text
=
ListView1.Items(i).SubItems(5).Text
TextBox5.Text
=
ListView1.Items(i).SubItems(6).Text
TextBox6.Text
=
ListView1.Items(i).SubItems(7).Text
ComboBox3.Text
=
ListView1.Items(i).SubItems(8).Text
ListView1.Items(i).Selected
=
True
Exit
For
End
If
Next
End
If
Catch
End
Try
End
Sub
Private
Sub
ListView1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ListView1.SelectedIndexChanged
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i).SubItems(0).Text
TextBox7.Clear()
Exit
For
End
If
Next
20
ListView1.Focus()
ListView1.FullRowSelect
=
True
End
Sub
Private
Sub
Button6_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button6.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
+
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
ComboBox1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ComboBox1.SelectedIndexChanged
Call
GroupNameCom()
End
Sub
Sub
GroupNameCom()
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("Select
*
from
GroupD",
objcon)
dr
=
com.ExecuteReader
While
dr.Read
If
dr.Item(0)
=
ComboBox1.Text
Then
TextBox7.Text
=
dr.Item(1)
End
If
End
While
dr.Close()
objcon.Close()
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
ComboBox1_TextUpdate(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
ComboBox1.TextUpdate
Call
GroupNameCom()
End
Sub
Private
Sub
Button5_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button5.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
-‐
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
End
Class
21
Add Group snapshot = GroupID.vb code:
Public
Class
GroupID
Public
NameFrm,
NameTo
As
String
Private
Sub
Button3_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button3.Click
Me.Close()
End
Sub
Private
Sub
Button2_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
TextBox1.Clear()
TextBox2.Clear()
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
If
TextBox1.Text
=
""
Then
MsgBox("Please
enter
a
Group
ID!",
0,
"")
Else
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("INSERT
INTO
GroupD
VALUES('"
&
TextBox1.Text
&
"','"
&
TextBox2.Text
&
"')",
objcon)
com.ExecuteNonQuery()
ListView1.Clear()
Call
readData()
MsgBox("Successfully
Saved",
0,
"")
objcon.Close()
Catch
ex
As
Exception
MsgBox("Group
ID
number
already
in
use!",
0,
"")
End
Try
End
If
End
Sub
Private
Sub
GroupID_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Call
readData()
End
Sub
Sub
readData()
ListView1.Columns.Add("GROUP
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("GROUP
NAME",
310,
HorizontalAlignment.Center)
Try
If
(objcon.State
=
ConnectionState.Closed)
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
GroupD",
objcon)
dr
=
com.ExecuteReader
While
dr.Read()
Call
adddatatolistview(ListView1,
dr(0),
dr(1))
End
While
dr.Close()
objcon.Close()
Catch
'MsgBox("Please
Refresh",
MsgBoxStyle.Information,
"")
End
Try
End
Sub
Public
Sub
adddatatolistview(ByVal
lvw
As
ListView,
ByVal
GroupID
As
String,
ByVal
GroupName
As
String)
Dim
lv
As
New
ListViewItem
lvw.Items.Add(lv)
lv.Text
=
GroupID
lv.SubItems.Add(GroupName)
End
Sub
Sub
Sentence()
Dim
a,
b
As
Integer
a
=
NameFrm.Length
NameTo
=
""
For
b
=
0
To
a
-‐
1
22
If
b
=
0
Then
If
Char.IsLower(NameFrm(0))
Then
NameTo
=
Char.ToUpper(NameFrm(0))
Else
NameTo
=
NameFrm(0)
End
If
Else
If
NameFrm(b
-‐
1)
=
"
"
Then
NameTo
=
NameTo
+
Char.ToUpper(NameFrm(b))
Else
NameTo
=
NameTo
+
NameFrm(b)
End
If
End
If
Next
End
Sub
Private
Sub
TextBox2_LostFocus(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox2.LostFocus
NameFrm
=
TextBox2.Text
Call
Sentence()
TextBox2.Text
=
NameTo
End
Sub
Private
Sub
TextBox2_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox2.TextChanged
End
Sub
Private
Sub
TextBox1_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox1.TextChanged
Dim
i
As
Integer
ListView1.SelectedItems.Clear()
TextBox1.Focus()
Try
If
Me.TextBox1.Text
=
""
Then
TextBox2.Text
=
""
Else
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
TextBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Then
TextBox2.Text
=
ListView1.Items(i).SubItems(1).Text
ListView1.Items(i).Selected
=
True
Exit
For
End
If
Next
End
If
Catch
End
Try
End
Sub
Private
Sub
Button4_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button4.Click
If
TextBox1.Text
=
""
Then
MsgBox("Please
enter
Group
ID!",
0,
"")
Else
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("DELETE
FROM
GroupD
WHERE
GroupID='"
&
TextBox1.Text
&
"'",
objcon)
com.ExecuteNonQuery()
ListView1.Clear()
Call
readData()
MsgBox("Deleted",
0,
"")
objcon.Close()
Catch
ex
As
Exception
MsgBox("Group
ID
number
not
found!",
0,
"")
End
Try
23
End
If
End
Sub
Private
Sub
Button5_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button5.Click
If
TextBox1.Text
=
""
Then
MsgBox("Please
enter
a
Group
ID!",
0,
"")
Else
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("UPDATE
GroupD
SET
GroupName='"
&
TextBox2.Text
&
"'
WHERE
GroupID='"
&
TextBox1.Text
&
"'",
objcon)
com.ExecuteNonQuery()
ListView1.Clear()
Call
readData()
MsgBox("Update
successfully",
0,
"")
objcon.Close()
Catch
ex
As
Exception
MsgBox("Cannot
Update",
0,
"")
End
Try
End
If
End
Sub
Private
Sub
ListView1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ListView1.SelectedIndexChanged
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
End
Sub
End
Class
IssueBook.vb code:
Public
Class
IssueBook
Private
Sub
Button9_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button9.Click
Me.Close()
End
Sub
Private
Sub
PictureBox1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
End
Sub
Private
Sub
IssueBook_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Call
Retrive_C()
Call
BookID_Combo()
Call
readData()
End
Sub
Sub
Retrive_C()
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("Select
CID
from
Customer",
objcon)
dr
=
com.ExecuteReader
While
dr.Read
ComboBox5.Items.Add(dr.Item(0))
End
While
dr.Close()
objcon.Close()
Catch
ex
As
Exception
24
End
Try
End
Sub
Sub
BookID_Combo()
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("Select
BookID
from
Books
WHERE
status='Available'",
objcon)
dr
=
com.ExecuteReader
While
dr.Read
ComboBox1.Items.Add(dr.Item(0))
End
While
dr.Close()
objcon.Close()
Catch
ex
As
Exception
End
Try
End
Sub
Sub
readData()
ListView1.Clear()
ListView1.Columns.Add("BOOK
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("GROUP
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("BOOK
NAME",
310,
HorizontalAlignment.Center)
ListView1.Columns.Add("PUBLISHER",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("AUTHOR",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("PUBLISHING
YEAR",
130,
HorizontalAlignment.Center)
ListView1.Columns.Add("EDITION",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("PRICE",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("STATUS",
90,
HorizontalAlignment.Center)
ListView1.GridLines
=
True
ListView1.View
=
View.Details
Try
If
(objcon.State
=
ConnectionState.Closed)
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
Books
WHERE
status='Available'",
objcon)
dr
=
com.ExecuteReader
While
dr.Read()
Call
adddatatolistview(ListView1,
dr(0),
dr(1),
dr(2),
dr(3),
dr(4),
dr(5),
dr(6),
dr(7),
dr(8))
End
While
dr.Close()
objcon.Close()
Catch
'MsgBox("Please
Refresh",
MsgBoxStyle.Information,
"")
End
Try
End
Sub
Public
Sub
adddatatolistview(ByVal
lvw
As
ListView,
ByVal
BookID
As
String,
ByVal
GroupID
As
String,
ByVal
BookName
As
String,
ByVal
Publisher
As
String,
ByVal
Author
As
String,
ByVal
PubYear
As
String,
ByVal
edi
As
String,
ByVal
pric
As
String,
ByVal
st
As
String)
Dim
lv
As
New
ListViewItem
lvw.Items.Add(lv)
lv.Text
=
BookID
lv.SubItems.Add(GroupID)
lv.SubItems.Add(BookName)
lv.SubItems.Add(Publisher)
lv.SubItems.Add(Author)
lv.SubItems.Add(PubYear)
lv.SubItems.Add(edi)
lv.SubItems.Add(pric)
lv.SubItems.Add(st)
End
Sub
Sub
Retrive()
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
Books",
objcon)
com.ExecuteNonQuery()
dr
=
com.ExecuteReader
dr.Read()
While
(dr.NextResult)
25
ComboBox1.Items.Add(dr(1))
End
While
objcon.Close()
End
Sub
Private
Sub
Button2_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("UPDATE
Books
SET
status='Rented'
WHERE
BookID='"
&
ComboBox1.Text
&
"'",
objcon)
com.ExecuteNonQuery()
objcon.Close()
Call
readData()
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("INSERT
INTO
Issue
VALUES('"
&
ComboBox1.Text
&
"','"
&
ComboBox2.Text
&
"','"
&
TextBox2.Text
&
"','"
&
ComboBox5.Text
&
"','"
&
TextBox1.Text
&
"','"
&
DateTimePicker1.Text
&
"','"
&
DateTimePicker2.Text
&
"')",
objcon)
com.ExecuteNonQuery()
MsgBox("Book
has
been
Issued!",
0,
"")
Call
readData()
objcon.Close()
Catch
ex
As
Exception
MsgBox(ex.ToString,
0,
"")
End
Try
End
Sub
Private
Sub
ComboBox1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ComboBox1.SelectedIndexChanged
Dim
i
As
Integer
ListView1.SelectedItems.Clear()
TextBox1.Focus()
Try
If
Me.ComboBox1.Text
=
""
Then
TextBox2.Text
=
""
Else
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ComboBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Then
ComboBox2.Text
=
ListView1.Items(i).SubItems(1).Text
TextBox2.Text
=
ListView1.Items(i).SubItems(2).Text
TextBox3.Text
=
ListView1.Items(i).SubItems(3).Text
TextBox4.Text
=
ListView1.Items(i).SubItems(4).Text
ComboBox3.Text
=
ListView1.Items(i).SubItems(5).Text
TextBox5.Text
=
ListView1.Items(i).SubItems(6).Text
TextBox6.Text
=
ListView1.Items(i).SubItems(7).Text
ComboBox4.Text
=
ListView1.Items(i).SubItems(8).Text
ListView1.Items(i).Selected
=
True
Exit
For
End
If
Next
End
If
Catch
End
Try
End
Sub
Private
Sub
Button8_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button8.Click
Try
If
ComboBox1.Text
=
""
Then
MsgBox("Please
mention
the
BookID",
0,
"")
Else
If
objcon.State
=
ConnectionState.Closed
Then
com
=
New
OleDb.OleDbCommand("delete
from
Issue
where
BookID='"
&
ComboBox1.Text
&
"'",
objcon)
If
MsgBox("Do
you
really
want
to
delete?",
MsgBoxStyle.YesNo,
"Are
you
sure?")
=
Windows.Forms.DialogResult.Yes
Then
26
com.ExecuteNonQuery()
End
If
objcon.Close()
End
If
End
If
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
ListView1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ListView1.SelectedIndexChanged
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
ComboBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
End
Sub
Private
Sub
ComboBox5_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ComboBox5.SelectedIndexChanged
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("Select
CID,CName
from
Customer",
objcon)
dr
=
com.ExecuteReader
While
dr.Read
If
dr.Item(0)
=
ComboBox5.Text
Then
TextBox1.Text
=
dr.Item(1)
End
If
End
While
dr.Close()
objcon.Close()
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
Button6_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button6.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
+
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
Button5_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button5.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
-‐
1).SubItems(0).Text
Exit
For
End
If
27
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
End
Class
4.2.4 - 5 Return Book + Book Report
ReturnBook.vb code:
Public
Class
ReturnBook
Private
Sub
Button9_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button9.Click
Me.Close()
End
Sub
Private
Sub
Button2_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
If
ComboBox1.Text
=
""
Then
MsgBox("Please
mention
the
Book
ID",
0,
"")
Else
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("UPDATE
Books
SET
status='Available'
WHERE
BookID='"
&
ComboBox1.Text
&
"'",
objcon)
com.ExecuteNonQuery()
objcon.Close()
Call
readData()
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("INSERT
INTO
Returns
VALUES('"
&
ComboBox1.Text
&
"','"
&
ComboBox2.Text
&
"','"
&
TextBox2.Text
&
"','"
&
ComboBox5.Text
&
"','"
&
TextBox1.Text
&
"','"
&
TextBox3.Text
&
"','"
&
TextBox7.Text
&
"','"
&
DateTimePicker2.Text
&
"','"
&
TextBox6.Text
&
"')",
objcon)
com.ExecuteNonQuery()
MsgBox("Book
has
been
returned!",
0,
"")
objcon.Close()
Catch
ex
As
Exception
28
End
Try
End
If
End
Sub
Private
Sub
Button8_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button8.Click
If
ComboBox1.Text
=
""
Then
MsgBox("Please
mention
a
Book
ID",
0,
"")
Else
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("DELETE
FROM
Returns
WHERE
BookID='"
&
ComboBox1.Text
&
"'",
objcon)
com.ExecuteNonQuery()
MsgBox("Deleted
Success!",
0,
"")
Call
ClearThem()
objcon.Close()
Catch
ex
As
Exception
End
Try
End
If
End
Sub
Sub
ClearThem()
ComboBox1.TabIndex
=
""
ComboBox2.Text
=
""
TextBox2.Text
=
""
TextBox3.Text
=
""
TextBox6.Text
=
""
ComboBox5.Text
=
""
TextBox1.Text
=
""
TextBox7.Text
=
""
DateTimePicker2.Refresh()
End
Sub
Private
Sub
ReturnBook_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Call
BookID_Combo()
Call
readData()
End
Sub
Sub
BookID_Combo()
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("Select
BookID
from
Books
WHERE
status='Rented'",
objcon)
dr
=
com.ExecuteReader
While
dr.Read
ComboBox1.Items.Add(dr.Item(0))
End
While
dr.Close()
objcon.Close()
Catch
ex
As
Exception
End
Try
End
Sub
Sub
readData()
ListView1.Clear()
ListView1.Columns.Add("BOOK
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("GROUP
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("BOOK
NAME",
310,
HorizontalAlignment.Center)
ListView1.Columns.Add("PUBLISHER",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("AUTHOR",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("PUBLISHING
YEAR",
130,
HorizontalAlignment.Center)
ListView1.Columns.Add("EDITION",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("PRICE",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("STATUS",
90,
HorizontalAlignment.Center)
29
ListView1.View
=
View.Details
Try
If
(objcon.State
=
ConnectionState.Closed)
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
Books
WHERE
status='Rented'",
objcon)
dr
=
com.ExecuteReader
While
dr.Read()
Call
adddatatolistview(ListView1,
dr(0),
dr(1),
dr(2),
dr(3),
dr(4),
dr(5),
dr(6),
dr(7),
dr(8))
End
While
dr.Close()
objcon.Close()
Catch
'MsgBox("Please
Refresh",
MsgBoxStyle.Information,
"")
End
Try
End
Sub
Public
Sub
adddatatolistview(ByVal
lvw
As
ListView,
ByVal
BookID
As
String,
ByVal
GroupID
As
String,
ByVal
BookName
As
String,
ByVal
Publisher
As
String,
ByVal
Author
As
String,
ByVal
PubYear
As
String,
ByVal
edi
As
String,
ByVal
pric
As
String,
ByVal
st
As
String)
Dim
lv
As
New
ListViewItem
lvw.Items.Add(lv)
lv.Text
=
BookID
lv.SubItems.Add(GroupID)
lv.SubItems.Add(BookName)
lv.SubItems.Add(Publisher)
lv.SubItems.Add(Author)
lv.SubItems.Add(PubYear)
lv.SubItems.Add(edi)
lv.SubItems.Add(pric)
lv.SubItems.Add(st)
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
Me.Refresh()
End
Sub
Private
Sub
ListView1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ListView1.SelectedIndexChanged
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
ComboBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
End
Sub
Private
Sub
ComboBox1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ComboBox1.SelectedIndexChanged
Dim
i
As
Integer
ListView1.SelectedItems.Clear()
TextBox1.Focus()
Try
If
Me.ComboBox1.Text
=
""
Then
TextBox2.Text
=
""
Else
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ComboBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Then
ComboBox2.Text
=
ListView1.Items(i).SubItems(1).Text
TextBox2.Text
=
ListView1.Items(i).SubItems(2).Text
ListView1.Items(i).Selected
=
True
Exit
For
End
If
Next
End
If
30
Catch
End
Try
Call
IssueDetail()
End
Sub
Sub
IssueDetail()
'
Try
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("Select
IssueDate,
IssueName,
IssueTo,
DueDate
from
Issue
WHERE
BookID='"
&
ComboBox1.Text
&
"'",
objcon)
dr
=
com.ExecuteReader
While
dr.Read
ComboBox5.Text
=
dr.Item(2)
TextBox1.Text
=
dr.Item(1)
TextBox3.Text
=
dr.Item(0)
TextBox7.Text
=
dr.Item(3)
End
While
dr.Close()
objcon.Close()
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
Button6_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button6.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
+
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
Button5_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button5.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
+
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
End
Class
32
lvw.Items.Add(lv)
lv.Text
=
BookID
lv.SubItems.Add(GroupID)
lv.SubItems.Add(BookName)
lv.SubItems.Add(publisher)
lv.SubItems.Add(author)
lv.SubItems.Add(pubyear)
lv.SubItems.Add(edi)
lv.SubItems.Add(pric)
lv.SubItems.Add(status)
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
On
Error
Resume
Next
If
objcon.State
=
ConnectionState.Closed
Then
objcon.Open()
Select
Case
(sel)
Case
1
com
=
New
OleDb.OleDbCommand("select
*
from
Books
where
BookID='"
&
TextBox1.Text
&
"'",
objcon)
dr
=
com.ExecuteReader
Case
2
com
=
New
OleDb.OleDbCommand("select
*
from
Books
where
BookName='"
&
TextBox1.Text
&
"'",
objcon)
dr
=
com.ExecuteReader
Case
3
com
=
New
OleDb.OleDbCommand("select
*
from
Books
where
Author='"
&
TextBox1.Text
&
"'",
objcon)
dr
=
com.ExecuteReader
Case
5
com
=
New
OleDb.OleDbCommand("select
*
from
Books",
objcon)
dr
=
com.ExecuteReader
Case
8
com
=
New
OleDb.OleDbCommand("select
*
from
Books
where
Status='"
&
ComboBox2.Text
&
"'",
objcon)
dr
=
com.ExecuteReader
End
Select
Call
readData()
Call
whenclick()
objcon.Close()
End
Sub
Private
Sub
ListView1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ListView1.SelectedIndexChanged
End
Sub
Private
Sub
Button6_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button6.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
+
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
Button5_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button5.Click
Try
Dim
i
As
Integer
33
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
-‐
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
End
Class
4.3 Customer.
35
If
TextBox1.Text
=
""
Then
MsgBox("Please
enter
the
ID
to
be
deleted!",
0,
"")
Else
Try
objcon.Open()
com
=
New
OleDb.OleDbCommand("delete
from
Customer
where
CID='"
&
TextBox1.Text
&
"'",
objcon)
If
com.ExecuteNonQuery()
Then
ListView1.Clear()
Call
readData()
MsgBox("Deleted
Success!",
0,
"")
Else
MsgBox("ID
Not
Found!",
0,
"")
End
If
objcon.Close()
Catch
ex
As
Exception
End
Try
End
If
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
Call
EnableThem()
Call
ClearField()
End
Sub
Sub
EnableThem()
TextBox1.Enabled
=
True
TextBox2.Enabled
=
True
TextBox3.Enabled
=
True
TextBox4.Enabled
=
True
TextBox5.Enabled
=
True
DateTimePicker1.Enabled
=
True
DateTimePicker2.Enabled
=
True
End
Sub
Sub
DisableThem()
'TextBox1.Enabled
=
False
TextBox2.Enabled
=
False
TextBox3.Enabled
=
False
TextBox4.Enabled
=
False
TextBox5.Enabled
=
False
DateTimePicker1.Enabled
=
False
DateTimePicker2.Enabled
=
False
End
Sub
Private
Sub
AddCustomer_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Call
DisableThem()
Call
readData()
End
Sub
Sub
readData()
ListView1.Columns.Add("CUSTOMER
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
NAME",
210,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
ADDRESS",
130,
HorizontalAlignment.Center)
ListView1.Columns.Add("CONTACT
#",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("SECURITY",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("ACTIVATION
DATE",
130,
HorizontalAlignment.Center)
ListView1.Columns.Add("VALID
TILL",
90,
HorizontalAlignment.Center)
Try
If
(objcon.State
=
ConnectionState.Closed)
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
Customer",
objcon)
dr
=
com.ExecuteReader
While
dr.Read()
Call
adddatatolistview(ListView1,
dr(0),
dr(1),
dr(2),
dr(3),
dr(4),
dr(5),
dr(6))
End
While
36
dr.Close()
objcon.Close()
Catch
'MsgBox("Please
Refresh",
MsgBoxStyle.Information,
"")
End
Try
End
Sub
Public
Sub
adddatatolistview(ByVal
lvw
As
ListView,
ByVal
CID
As
String,
ByVal
CName
As
String,
ByVal
CAddress
As
String,
ByVal
CCont
As
String,
ByVal
Sec
As
String,
ByVal
CAct
As
String,
ByVal
CVal
As
String)
Dim
lv
As
New
ListViewItem
lvw.Items.Add(lv)
lv.Text
=
CID
lv.SubItems.Add(CName)
lv.SubItems.Add(CAddress)
lv.SubItems.Add(CCont)
lv.SubItems.Add(curr
+
"
"
+
Sec)
lv.SubItems.Add(CAct)
lv.SubItems.Add(CVal)
End
Sub
Sub
ClearField()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
DateTimePicker1.Refresh()
DateTimePicker2.Refresh()
End
Sub
Sub
LoadInto()
End
Sub
Private
Sub
Button5_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button5.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
-‐
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
Button6_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button6.Click
Try
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i
+
1).SubItems(0).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
ListView1_SelectedIndexChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ListView1.SelectedIndexChanged
37
Dim
i
As
Integer
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
ListView1.Items(i).Selected
=
True
Then
TextBox1.Text
=
ListView1.Items(i).SubItems(0).Text
TextBox2.Text
=
ListView1.Items(i).SubItems(1).Text
TextBox3.Text
=
ListView1.Items(i).SubItems(2).Text
TextBox4.Text
=
ListView1.Items(i).SubItems(3).Text
TextBox5.Text
=
ListView1.Items(i).SubItems(4).Text
DateTimePicker1.Text
=
ListView1.Items(i).SubItems(5).Text
DateTimePicker2.Text
=
ListView1.Items(i).SubItems(6).Text
Exit
For
End
If
Next
ListView1.Focus()
ListView1.FullRowSelect
=
True
End
Sub
Private
Sub
TextBox1_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox1.TextChanged
Dim
i
As
Integer
ListView1.SelectedItems.Clear()
TextBox1.Focus()
Try
If
Me.TextBox1.Text
=
""
Then
TextBox2.Text
=
""
Else
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
TextBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Then
TextBox2.Text
=
ListView1.Items(i).SubItems(1).Text
ListView1.Items(i).Selected
=
True
Exit
For
End
If
Next
End
If
Catch
End
Try
End
Sub
End
Class
View Customer = CustomerDetail.vb code:
Public
Class
CustomerDetail
Public
curr
As
String
=
My.Settings.CurrencyS
Private
Sub
CustomerDetail_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Call
readDataW()
End
Sub
Sub
readDataW()
ListView1.Columns.Add("CUSTOMER
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
NAME",
140,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
ADDRESS",
140,
HorizontalAlignment.Center)
ListView1.Columns.Add("CONTACT
NUMBER",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("SECURITY
AMOUNT",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("ACTIVATION
DATE",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("VALID
TILL",
120,
HorizontalAlignment.Center)
ListView1.View
=
View.Details
End
Sub
Sub
readData()
ListView1.Clear()
ListView1.Columns.Add("CUSTOMER
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
NAME",
140,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
ADDRESS",
140,
HorizontalAlignment.Center)
ListView1.Columns.Add("CONTACT
NUMBER",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("SECURITY
AMOUNT",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("ACTIVATION
DATE",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("VALID
TILL",
120,
HorizontalAlignment.Center)
ListView1.View
=
View.Details
38
Try
If
(objcon.State
=
ConnectionState.Closed)
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
Customer",
objcon)
dr
=
com.ExecuteReader
While
dr.Read()
Call
adddatatolistview(ListView1,
dr(0),
dr(1),
dr(2),
dr(3),
dr(4),
dr(5),
dr(6))
End
While
dr.Close()
objcon.Close()
Catch
'MsgBox("Please
Refresh",
MsgBoxStyle.Information,
"")
End
Try
End
Sub
Public
Sub
adddatatolistview(ByVal
lvw
As
ListView,
ByVal
CID
As
String,
ByVal
CName
As
String,
ByVal
CAddress
As
String,
ByVal
CCont
As
String,
ByVal
Sec
As
String,
ByVal
CAct
As
String,
ByVal
CVal
As
String)
Dim
lv
As
New
ListViewItem
lvw.Items.Add(lv)
lv.Text
=
CID
lv.SubItems.Add(CName)
lv.SubItems.Add(CAddress)
lv.SubItems.Add(CCont)
lv.SubItems.Add(curr
+
"
"
+
Sec)
lv.SubItems.Add(CAct)
lv.SubItems.Add(CVal)
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
If
TextBox1.Text
=
""
Then
Call
readData()
Else
ListView1.Clear()
ListView1.Columns.Add("CUSTOMER
ID",
90,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
NAME",
140,
HorizontalAlignment.Center)
ListView1.Columns.Add("CUSTOMER
ADDRESS",
140,
HorizontalAlignment.Center)
ListView1.Columns.Add("CONTACT
NUMBER",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("SECURITY
AMOUNT",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("ACTIVATION
DATE",
120,
HorizontalAlignment.Center)
ListView1.Columns.Add("VALID
TILL",
120,
HorizontalAlignment.Center)
ListView1.View
=
View.Details
Try
If
(objcon.State
=
ConnectionState.Closed)
Then
objcon.Open()
com
=
New
OleDb.OleDbCommand("SELECT
*
FROM
Customer
WHERE
CID='"
&
TextBox1.Text
&
"'",
objcon)
dr
=
com.ExecuteReader
While
dr.Read()
Call
adddatatolistview(ListView1,
dr(0),
dr(1),
dr(2),
dr(3),
dr(4),
dr(5),
dr(6))
End
While
dr.Close()
objcon.Close()
Catch
'MsgBox("Please
Refresh",
MsgBoxStyle.Information,
"")
End
Try
End
If
End
Sub
Sub
displayThem()
End
Sub
Private
Sub
TextBox1_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox1.TextChanged
Dim
i
As
Integer
ListView1.SelectedItems.Clear()
39
TextBox1.Focus()
Try
If
Me.TextBox1.Text
=
""
Then
Else
For
i
=
0
To
ListView1.Items.Count
-‐
1
If
TextBox1.Text
=
ListView1.Items(i).SubItems(0).Text
Then
ListView1.Items(i).Selected
=
True
Exit
For
End
If
Next
End
If
Catch
End
Try
End
Sub
End
Class
ChangeName.vb code:
Public
Class
ChangeName
Private
Sub
Button2_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
Me.Close()
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
Try
My.Settings.CompanyName
=
Me.TextBox1.Text
My.Settings.Save()
MainForm.Text
=
My.Settings.CompanyName
&
"
Management
System"
Me.Close()
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
ChangeName_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
On
Error
Resume
Next
Me.TextBox1.Text
=
My.Settings.CompanyName
End
Sub
Private
Sub
TextBox1_Leave(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox1.Leave
Try
Dim
a,
b
As
Integer
Dim
NameTO,
NameFrm
As
String
a
=
TextBox1.Text.Length
NameFrm
=
TextBox1.Text
NameTO
=
""
For
b
=
0
To
a
-‐
1
41
If
b
=
0
Then
If
Char.IsLower(NameFrm(0))
Then
NameTO
=
Char.ToUpper(NameFrm(0))
Else
NameTO
=
NameFrm(0)
End
If
Else
If
NameFrm(b
-‐
1)
=
"
"
Then
NameTO
=
NameTO
+
Char.ToUpper(NameFrm(b))
Else
NameTO
=
NameTO
+
NameFrm(b)
End
If
End
If
Next
TextBox1.Text
=
NameTO
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
TextBox1_TextChanged(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
TextBox1.TextChanged
End
Sub
Private
Sub
TextBox1_Validating(ByVal
sender
As
Object,
ByVal
e
As
System.ComponentModel.CancelEventArgs)
Handles
TextBox1.Validating
Try
Dim
a,
b
As
Integer
Dim
NameTO,
NameFrm
As
String
a
=
TextBox1.Text.Length
NameFrm
=
TextBox1.Text
NameTo
=
""
For
b
=
0
To
a
-‐
1
If
b
=
0
Then
If
Char.IsLower(NameFrm(0))
Then
NameTo
=
Char.ToUpper(NameFrm(0))
Else
NameTo
=
NameFrm(0)
End
If
Else
If
NameFrm(b
-‐
1)
=
"
"
Then
NameTo
=
NameTo
+
Char.ToUpper(NameFrm(b))
Else
NameTo
=
NameTo
+
NameFrm(b)
End
If
End
If
Next
TextBox1.Text
=
NameTO
Catch
ex
As
Exception
End
Try
End
Sub
End
Class
42
4.6 Help.
4.6.1 - 2 Licence + About
Licence + About screenshot:
LicenceForm.vb code:
Public
Class
LicenseForm
Private
Sub
Button2_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
Me.Close()
End
Sub
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
Try
If
TextBox3.Text
<>
""
Then
If
TextBox3.Text
=
String.Concat("%"
&
TextBox1.Text
&
"%",
TextBox2.Text
&
"%")
Then
My.Settings.LicenseTo
=
TextBox1.Text
My.Settings.LicenseKey
=
TextBox3.Text
My.Settings.Save()
MsgBox("Register
Successfully!",
MsgBoxStyle.Information,
"")
Else
MsgBox("Invalid
License
Key!",
MsgBoxStyle.Exclamation,
"")
End
If
Else
MsgBox("Please
enter
the
License
Key!",
MsgBoxStyle.Exclamation,
"")
End
If
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
LicenseForm_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Try
TextBox2.Text
=
My.Settings.ThisMachineID
If
My.Settings.LicenseKey
=
""
Then
43
'Now
Verify
the
key
is
ok
or
not
'If
it
is
not
OK
then
Just
Change
the
Registration
Process
Else
TextBox1.Text
=
My.Settings.LicenseTo
TextBox1.Enabled
=
False
TextBox2.Enabled
=
False
TextBox3.Text
=
My.Settings.LicenseKey
TextBox3.Enabled
=
False
Button1.Visible
=
False
Button2.Visible
=
False
Label3.Visible
=
False
TextBox3.Visible
=
False
Me.Height
=
170
End
If
Catch
ex
As
Exception
End
Try
End
Sub
End
Class
AboutForm.vb code:
Public
Class
About
Private
Sub
Button1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
Me.Close()
End
Sub
Private
Sub
About_Load(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase.Load
Try
Label4.Text
=
My.Settings.LicenseTo
Label1.Text
=
My.Settings.CompanyName
Me.Height
=
200
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
Button2_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
Try
If
Me.Height
=
200
Then
Me.Height
=
327
Button2.Text
=
"^"
Else
Me.Height
=
200
Button2.Text
=
"V"
End
If
Catch
ex
As
Exception
End
Try
End
Sub
Private
Sub
PictureBox1_Click(ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
PictureBox1.Click
End
Sub
Private
Sub
PictureBox1_DoubleClick(ByVal
sender
As
Object,
ByVal
e
As
System.EventArgs)
Handles
PictureBox1.DoubleClick
Process.Start("mailto:rahuldass411@gmail.com?Subject=Library
Management
System&body=ISBN
Corporation,")
End
Sub
44
Private
Sub
LinkLabel1_LinkClicked(ByVal
sender
As
System.Object,
ByVal
e
As
System.Windows.Forms.LinkLabelLinkClickedEventArgs)
Handles
LinkLabel1.LinkClicked
Process.Start("mailto:rahuldass411@gmail.com?Subject=Library
Management
System&body=ISBN
Corporation,")
End
Sub
End
Class
Chapter 5: Future scope.
Further enhancement of the software can provide for many more facilities with different foci but
nonetheless related to the LAS. For instance, further development may include areas such as payroll,
human resources schema, and affiliation with academic and professional institutes.
Chapter 6: References.
[1] Kogent Learning Solutions Inc., (2011) Visual Basic 2010 Programming: Black Book – Platinum
Edition, Dreamtech Press.
45