Professional Documents
Culture Documents
PROJECT REPORT
ON
Submitted By-
Submitted to
S.K. College of science and commerce
Plot no.31, sector 25, Nerul(e),Navi Mumbai
2010-2011
1
Book Store Management
Project Report On
Book Store Management
2
Book Store Management
EXTERNAL EXAMINER:
DATE:
PREFACE
This software provide help in effective management of Purchase & Sales with
additional features of security and increase & Decrease date inconsistency.
This report depicts the information use for the system development. For detail
information scope of the project along with table design and Screen Layouts
are provided.
Although this report is prepared with utmost care, there may be errors for the
project and is subjected to further enhancements.
AMRITA SINGH.
3
Book Store Management
ACKNOWLEDGEMENT
I take this opportunity to thank all those who have been directly or
indirectly related to my project.
I would like to thank to our project guide Mrs. NEHA SAMUEL for his
constant source of inspiration. I am grateful to our coordinator Mrs. DHATARI
VINJAMURI for her encouragement and suggestions on my project. I
sincerely thank to our entire professor from (Computer Department) of our
COLLEGE for their continued support.
4
Book Store Management
INDEX:
SR. NO. CONTENTS PAGE NO.
PRELIMINARY INVESTIGATION
01
• ORGANIZATIONAL OVERVIEW
• DESCRIPTION OF THE SYSTEM 7-16
• LIMITATION OF PRESENT SYSTEM
• PROPOSED SYSTEM
• FEASIBILITY STUDY
• GANTT CHART
SYSTEM ANALYSIS
02 • STACK HOLDER
• FACT FINDING TECHNIQUES
• EVENT TABLE
• USE CASE DIAGRAM 17-29
• ERD DIAGRAM
• ACTIVITY DIAGRAM
• CLASS DIAGRAM
• SEQUENCE DIAGRAM
• COLLABORATION DIAGRAM
03 SYSTEM DESIGN
SYSTEM CODING
04 • Menu Tree
• List of tables with attributes and constraints 37-123
• Validations
• Test Cases, Test Data and Test Results
• Screen Layouts & Report Layouts
05 SYSTEM IMPLEMENTATION 124-125
06 FUTURE ENHANCEMENTS 126-127
07 CONCLUSION
5
Book Store Management
1
Preliminary Investigation
6
Book Store Management
This system was created with a lot of anticipation towards mastering the
basics of system creation .It was designed in such a way so as to help us make
use of basic technologies like Visual Studio and MS SQL .It has used the
concepts of maintaining a uniform system structure and during the process of
creating this system an honest effort has been made towards creating a
professional system in the future.
7
Book Store Management
The searching of record has been made quite simple as all the details of
the Book can be obtained by simply keying in the identification of those
Books.
8
Book Store Management
9
Book Store Management
Proposed System:
This system computerized all the requirements of the owner. It will give the
owner the feature of maintaining all the profiles of its customer, Suppliers, the
Product in which the owner deals in, the companies of whose product the
owner sells. It gives the user the functionality of searching stock without
manually checking it as stock entries are updated throughout the sales and
purchase transaction. It also keeps track of the enquiries made in the owner by
various people.
OBJECTIVES
1) Data management.
3) Data modification.
10
Book Store Management
This system uses MS SQL as data base which is strong and secure
database for proposed system.
The proposed system empowers the user with a new computer based
system by reducing the efforts of data maintenance.
If the customer has not paid the full payment then there is a facility to
check the balance amount that has to be paid by the customer.
11
Book Store Management
This system is semi-functional. This means that the system covers the
manipulation related to the record only.
System requirements
Hardware and software requirements:
The least hardware requirements are:
1) Minimum 2 GB HDD space
2) Pentium or Celeron based processor
12
Book Store Management
3) 128 MB RAM
FEASIBILITY STUDY
13
Book Store Management
Gantt chart:
2
15
Book Store Management
System Analysis
STAKE HOLDERS
16
Book Store Management
Non market(or secondary) stake holders are those who although they do
not engaged in direct economic exchange with the business are
affected by or can affect its actions.
Owner
17
Book Store Management
The system referred is the “Inventory system” that deals with the bills
of the customer & supplier. The following are the fact-finding techniques,
which were followed:
I went through all the files and registers in which the supplier’s
details were kept. I also referred the handmade bills and receipts. From
this I traced out the history, which was required for the existing system
to be implemented.
I visited the shop several times, which was very important for gathering the
details about the items stored in the shop and the how the bill is generated.
3) Observation:
By visiting the shop I observed how the manual process is been taking place.
Through observation I was able to see what exactly is to be done.
4) Questionnaires:
5) Interviews:
Event Table
18
Book Store Management
List of events gathered during analysis are entered in event table. An event table includes
rows and columns representing events and their details respectively.
TRIGGER:
Trigger an occurrence that tells the system that has occurred, either the arrival of data
needing or of a point in time
SOURCE:
SOURCE An external agent or actor that supplies data to the system.
ACTIVITY:
ACTIVITY Behavior that the system performs when an event occurs
RESPONSE:
RESPONSE An output produced by the system that goes to a destination.
DESTINATION:
DESTINATION An external agent or actor that receives data from the system
19
Book Store Management
Save Bill Save Bill Bill Save Bill Information Bill Master
saved
Print Bill Generate and Bill Print bill Take print of Bill master
print Bill
20
Book Store Management
The use case diagram is used to identify the primary elements and processes that
form the system. The primary elements are termed as "actors" and the processes are called
"use cases." The use case diagram shows which actors interact with each use case.
Books Details
Delete Books
Administrator
Detail
Employee Details
21
Book Store Management
Invoice Detail
22
Book Store Management
Represent connection.
ER-Diagram
23
Book Store Management
Activity Diagram:
24
Book Store Management
The process flows in the system are captured in the activity diagram. Similar to a
state diagram, an activity diagram also consists of activities, actions, transitions, initial and
final states, and guard conditions.
Admin
25
Book Store Management
Employee
26
Book Store Management
Class Diagram
The class diagram is used to refine the use case diagram and define a detailed
design of the system. The class diagram classifies the actors defined in the use case
diagram into a set of interrelated classes. The relationship or association between the
classes can be either an "is-a" or "has-a" relationship. Each class in the class diagram may
be capable of providing certain functionalities.
27
Book Store Management
Sequence Diagram
A sequence diagram represents the interaction between different objects in the
system. The important aspect of a sequence diagram is that it is time-ordered. This means
that the exact sequence of the interactions between the objects is represented step by step.
Different objects in the sequence diagram interact with each other by passing "messages".
28
Book Store Management
COLLABORATION DIAGRAM
A collaboration diagram, also called a communication diagram or interaction
diagram, is an illustration of the relationships and interactions among software objects in the
Unified Modeling Language.
29
Book Store Management
3
System design
30
Book Store Management
31
Book Store Management
Component Diagram
The component diagram represents the high-level parts that make up the system.
This diagram depicts, at a high level, what components form part of the system and how
they are interrelated. A component diagram depicts the components culled after the
system has undergone the development or construction phase.
32
Book Store Management
Package Diagram
A package diagram in the Unified Modeling Language depicts
the dependencies between the packages that make up a model. Package diagrams can use
packages containing use cases to illustrate the functionality of a software system
33
Book Store Management
Deployment Diagram
The deployment diagram captures the configuration of the runtime elements of the
application. This diagram is by far most useful when a system is built and ready to be
deployed.
34
Book Store Management
MAINTAIN BOOK
BOOK
BOOK DETAILS
REPORT
DATABASE
MAINTAIN INVENTORYREP
INVENTORY ORT
INVENTORY
DATABASE DETAILS
BOOK
BILL CREATION BILL
SHOP
PROGRAM
MANAGEMENT BILL REPORT
SYSTEM DATABASE
MAINTAIN
EMPLOYEE
EMPLOYEE EMPLOYEE
REPORT
DATABASE DETAILS
35
Book Store Management
STRUCTURE CHART
A Structure Chart (SC) in software engineering and organizational theory, is a chart which
shows the breakdown of a system to its lowest manageable levels. They are used
in structured programming to arrange program modules into a tree. Each module is
represented by a box, which contains the module's name.
36
Book Store Management
4.
System Coding
37
Book Store Management
Menu Tree
BOOK SHOP MANAGEMENT SYSTEM
Add
Update
Change Book Calculator
Inventory
Password
Update
Book Show Inventory
status
Exit
Delete
Book
Show all
Book
Search
Book
Generate Book
Search
Bill Info
Employee
Inventory
Print Add
PrintBill
Bill Info
Employee
Employee Update
Employee
Daily
DailySales
Sales
ssSSsSales Delete
Monthly Sales Employee
SsLASales
SalesSales
ssSSsSales
38
Book Store Management
Database Tables:
39
Book Store Management
40
Book Store Management
Validation
41
Book Store Management
White box testing is when the tester has access to the internal data structures and
algorithms including the code that implement these.
Test coverage
White box testing methods can also be used to evaluate the completeness of a test suite that
was created with black box testing methods. This allows the software team to examine parts
42
Book Store Management
of a system that are rarely tested and ensures that the most important function points have
been tested.
43
Book Store Management
Table Validations
Add Book All Field are Compulsory Empty Fields in animal name, or field are not
selected
Add Employee All Field are Compulsory Empty Fields, numbers in employee name number
or alphabets in salary.
Generate bill All Field are Compulsory Empty Fields, or fields are not selected
44
Book Store Management
45
Book Store Management
Test Case
The forms were tested for their functionality and error messages are displayed
wherever the input does not meet the required requirements
If any invalid user want to take entry into the system then this form restrict him from
entering into the system. By entering invalid username or password it gives an error
message
Add Book form gives an error message if valid data entry is not done. For example, Price
should be numeric.
Update Book form gives an error message if valid data entry is not done. For example, if no
book is selected then it gives an error message ‘Please select Book’.
46
Book Store Management
Splash Screen:
login Screen:
47
Book Store Management
48
Book Store Management
49
Book Store Management
50
Book Store Management
51
Book Store Management
52
Book Store Management
53
Book Store Management
54
Book Store Management
55
Book Store Management
56
Book Store Management
57
Book Store Management
Book Status:
Available book:
58
Book Store Management
Project profile:
59
Book Store Management
End Sub
Timer1.Enabled = False
End If
End Sub
End Sub
End Class
60
Book Store Management
End Sub
Private Sub login()
Try
Dim myConnection As New SqlConnection(constr)
Dim encPassword As String = PasswordTextBox.Text.Trim()
myConnection.Open()
Dim command As New SqlCommand("select roleID from UserMaster where username='" +
UsernameTextBox.Text.Trim() + "' and password='" + encPassword + "'", myConnection)
Dim objrdr As SqlDataReader = command.ExecuteReader()
'MsgBox(i)
If objrdr.Read Then
' System.Windows.Forms.MessageBox.Show("Welcome!")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
61
Book Store Management
Me.UsernameTextBox.Text = "admin"
Me.PasswordTextBox.Focus()
'If ConfigurationManager.ConnectionStrings.Count > 0 Then
constr = ConfigurationManager.ConnectionStrings("Book ").ConnectionString
' End If
End Sub
End Sub
End Class
62
Book Store Management
End Sub
End Sub
Private Sub AddBook()
Dim myConnectionn As SqlConnection = Nothing
Dim command As SqlCommand = Nothing
Try
myConnectionn = New SqlConnection(ConfigurationManager.ConnectionStrings("Book
").ConnectionString)
myConnectionn.Open()
command = New SqlCommand("insert into bookMaster")
Catch ex As Exception
End Try
End Sub
63
Book Store Management
End Sub
End Sub
End Sub
64
Book Store Management
'obj.MdiParent = Me
'obj.StartPosition = FormStartPosition.CenterScreen
'obj.Show()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
Application.Exit()
End Sub
End Sub
End Sub
65
Book Store Management
End Sub
Private Sub closeAll()
For Each frm As Form In Me.MdiChildren
frm.Close()
Next
End Sub
Private Sub AddToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles AddToolStripMenuItem.Click
End Sub
closeAll()
Dim obj As SearchEmployeeDialog = New SearchEmployeeDialog(1)
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
End Sub
closeAll()
Dim obj As SearchEmployeeDialog = New SearchEmployeeDialog(2)
obj.StartPosition = FormStartPosition.CenterScreen
obj.MdiParent = Me
obj.Show()
End Sub
End Sub
66
Book Store Management
End Sub
End Sub
End Sub
67
Book Store Management
End Sub
End Sub
End Sub
68
Book Store Management
End Class
Try
myConnection = New SqlConnection(constr)
myConnection.Open()
command = New SqlCommand("select username from usermaster", myConnection)
dbreader = command.ExecuteReader
While dbreader.Read
UserComboBox.Items.Add(dbreader(0))
End While
UserComboBox.SelectedIndex = 0
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
InitializeComponent()
End Sub
Public Sub New(ByVal pwd As String)
End Sub
Public Sub New(ByRef user As String, ByVal pwd As String)
70
Book Store Management
If validateFields() Then
Try
Dim myConnection As New SqlConnection(constr)
Dim encPassword As String = PasswordTextBox.Text.Trim()
myConnection.Open()
Dim command As SqlCommand = New SqlCommand("update usermaster set password='" &
encPassword & "'", myConnection)
Dim i As Integer = command.ExecuteNonQuery
If i > 0 Then
MsgBox("Updated!")
command.Dispose()
myConnection.Close()
Me.Close()
Else
MsgBox("Failed!")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
Private Function validateFields() As Boolean
If UserTextBox.Text.Trim.Length = 0 Then
MsgBox("User name can not be empty!")
Return False
End If
If TextBox1.Text.Trim.Length = 0 Then
MsgBox("old Password should not be empty!")
Return False
End If
If PasswordTextBox.Text.Trim.Length = 0 Then
MsgBox("Password and confirm password doesnot match!")
Return False
End If
If ConfirmPasswordTextBox.Text.Trim.Length = 0 Then
MsgBox("Password and confirm password doesnot match!")
Return False
End If
If Not PasswordTextBox.Text.Trim = ConfirmPasswordTextBox.Text.Trim Then
MsgBox("Password and confirm password doesnot match!")
Return False
End If
If Not obj = TextBox1.Text.Trim Then
MsgBox("You are not correct user to change password!")
Return False
End If
Return True
End Function
End Class
71
Book Store Management
Imports System.Configuration
Imports System.Data.SqlClient
Me.DateTimePicker1.Format = DateTimePickerFormat.Custom
Me.DateTimePicker1.CustomFormat = "MM/dd/yyyy"
Me.DateTimePicker2.Format = DateTimePickerFormat.Custom
Me.DateTimePicker2.CustomFormat = "MM/dd/yyyy"
Me.DateTimePicker2.MinDate = Date.Now
End Sub
Private Function validateFields() As Boolean
If Not IsNumeric(TextBox4.Text.Trim) Then
MsgBox("Price must be a number")
Return False
End If
Return True
End Function
Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
SaveButton.Click
saveBook()
End Sub
Private Sub saveBook()
'MsgBox(DateTimePicker1.Value)
'MsgBox(DateTimePicker2.Value)
If validatFields() Then
Dim myConnection As SqlConnection = Nothing
Dim command As SqlCommand = Nothing
Dim trans As SqlTransaction = Nothing
Try
myConnection = New SqlConnection(constr)
myConnection.Open()
trans = myConnection.BeginTransaction
72
Book Store Management
End Sub
73
Book Store Management
End If
End Sub
If TextBox2.Text.Trim.Length = 0 Then
MsgBox("book Name is Required!")
Return False
End If
If TextBox3.Text.Trim.Length = 0 Then
MsgBox("Batch no is Required!")
Return False
End If
If TextBox4.Text.Trim.Length = 0 Then
MsgBox("price is Required!")
Return False
End If
If DateTimePicker1.Value.ToString("MM/dd/yyyy") =
DateTimePicker2.Value.ToString("MM/dd/yyyy") Then
MsgBox("Manufacturing and Expiry date can not be same!")
Return False
End If
Return True
End Function
End Class
74
Book Store Management
If validateFields() Then
Dim myConnection As SqlConnection = Nothing
Dim command As SqlCommand = Nothing
Dim command2 As SqlCommand = Nothing
Dim quantity As Integer = 0
If CType(ComboBox1.SelectedItem, BookClass).ExpiryDate > Date.Now Then
quantity = getQuantity(CType(ComboBox1.SelectedItem, BookClass).BookID)
End If
Dim query2 As String = "update inventoryMaster set quantity=" & quantity & " where bookID=" &
CType(ComboBox1.SelectedItem, BookClass).BookID
Dim d1 As Date = Date.Parse(DateTimePicker1.Value)
Try
myConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("Book
").ConnectionString)
myConnection.Open()
command = New SqlCommand("update bookmaster set batchno='" & TextBox3.Text.Trim &
"',price=" & Val(TextBox4.Text.Trim) & ",manudate='" & d1.ToString("MM/dd/yyyy") & "',expirydate='" &
DateTimePicker2.Value.ToString("MM/dd/yyyy") & "' where bookid=" & CType(ComboBox1.SelectedItem,
BookClass).BookID, myConnection)
command2 = New SqlCommand(query2, myConnection)
Dim i As Integer = command.ExecuteNonQuery
Dim j As Integer = command2.ExecuteNonQuery
If i + j > 1 Then
MsgBox("Book Updated successfully!")
Me.Close()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
75
Book Store Management
End Sub
Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
SaveButton.Click
UpdateBook()
End Sub
Private Function getQuantity(ByVal id As Integer) As Integer
76
Book Store Management
Me.DateTimePicker2.MinDate = Date.Now
End Sub
End Sub
77
Book Store Management
e.Handled = False
End If
End Sub
If Asc(e.KeyChar) = 13 Then
UpdateBook()
End If
End Sub
End Class
Imports System.Globalization
Imports System.Data.SqlClient
Imports System.Configuration
InitializeComponent()
End Sub
Public Sub New(ByRef obj As BookClass, ByRef del As SearchBookDialog)
InitializeComponent()
TextBox1.Text = obj.BookID
TextBox2.Text = obj.BookName
TextBox3.Text = obj.BatchNo
TextBox4.Text = obj.Price
78
Book Store Management
DateTimePicker1.Value = dt
DateTimePicker2.Value = dt2
Me.del = del
End Sub
command.Dispose()
myConnection.Close()
del.action(True)
Me.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End sub
End Class
79
Book Store Management
End Sub
80
Book Store Management
obj.TextBox3.Text = objbook.Quantity
Me.Close()
End If
End Sub
81
Book Store Management
End Sub
getCurrentItemFromTable()
End Sub
InitializeComponent()
End Sub
Public Sub New(ByVal whoiscalling As Integer)
InitializeComponent()
Me.whoiscalling = whoiscalling
End Sub
Public Sub New(ByRef obj As UpdateInventoryForm, ByVal whoiscalling As Integer)
InitializeComponent()
Me.obj = obj
Me.whoiscalling = whoiscalling
End Class
82
Book Store Management
InitializeComponent()
End Sub
InitializeComponent()
TextBox1.Text = obj.BookID
TextBox2.Text = obj.BookName
End Sub
83
Book Store Management
obj.MdiParent = Me.MdiParent
obj.StartPosition = FormStartPosition.CenterScreen
obj.Show()
End Sub
command.Dispose()
myConnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MsgBox("Quantity must be numeric!")
End If
End Sub
Private Sub clearFields()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
Button1.Focus()
End Sub
Private Function CheckBookExist() As Boolean
Dim myConnection As SqlConnection = Nothing
Dim command As SqlCommand = Nothing
Try
myConnection = New SqlConnection(constr)
myConnection.Open()
command = New SqlCommand("select count(*) from inventorymaster where bookid=" &
Val(TextBox1.Text.Trim), myConnection)
Dim i As Integer = CType(command.ExecuteScalar, Integer)
If i > 0 Then
command.Dispose()
myConnection.Close()
Return True
Else
command.Dispose()
84
Book Store Management
myConnection.Close()
Return False
End If
Catch ex As Exception
Try
command.Dispose()
End Try
Try
myConnection.Close()
Catch exc As Exception
End Try
MsgBox(ex.Message)
Return False
End Try
End Function
85
Book Store Management
86
Book Store Management
87
Book Store Management
myConnection.Open()
command = New SqlCommand("select * from employeedesignation", myConnection)
Dim dbreader As SqlDataReader = command.ExecuteReader()
While dbreader.Read()
' MsgBox("Hello" & dbreader.Item(1).ToString)
Dim objlist As New DesignationClass()
objlist.DesignationID = dbreader.GetValue(0)
objlist.Designation = dbreader.GetString(1)
DesignationComboBox.Items.Add(objlist)
End While
command.Dispose()
myConnection.Close()
DesignationComboBox.SelectedIndex = 0
Catch ex As Exception
command.Dispose()
myConnection.Close()
MsgBox(ex.Message)
End Try
End Sub
Private Function validateFields() As Boolean
If ENameTextBox.Text.Trim.Length = 0 Then
MsgBox("Employee Name is Required!")
Return False
End If
If String.IsNullOrEmpty(SalaryTextBox.Text.Trim) Or Not IsNumeric(SalaryTextBox.Text.Trim) Then
MsgBox("Valid salary is Required!")
Return False
End If
If AddressTextBox.Text.Trim.Length = 0 Then
MsgBox("Address is Required!")
Return False
End If
Return True
If Not IsNumeric(SalaryTextBox.Text.Trim) Then
MsgBox("Price must be a number")
Return False
End If
Return True
End Function
Private Sub upadteEmployee()
If validateFields() Then
Dim d As Date = DateTimePicker1.Value
Try
Dim myConnection As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("Book ").ConnectionString)
myConnection.Open()
Dim command As SqlCommand = New SqlCommand("update Employee set EmployeeName='" &
ENameTextBox.Text.Trim() & "',DesignationID=" & CType(DesignationComboBox.SelectedItem,
DesignationClass).DesignationID & ",Salary=" & Val(SalaryTextBox.Text) & "DateOfBirth='" & d &
"',Address='" & AddressTextBox.Text.Trim() & "' where EmployeeID=" & Val(EIDTextBox.Text),
myConnection)
Dim i As Integer = command.ExecuteNonQuery
If i > 0 Then
88
Book Store Management
End Sub
Private Sub saveEmployee()
'MsgBox(PNameTextBox.Text.Trim() & "," & PBatchNoTextBox.Text.Trim() & "," &
MDateTextBox.Text & "," & DescriptionTextBox.Text.Trim() & "," & Val(RateTextBox.Text.Trim()) & ","
& Val(QuantityTextBox.Text.Trim()) & "," & Val(TotalTextBox.Text.Trim()))
If validateFields() Then
Dim d As Date = DateTimePicker1.Value
Try
Dim myConnection As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("Book ").ConnectionString)
myConnection.Open()
89
Book Store Management
command.Parameters.Add(param5)
End Sub
Public Sub New()
InitializeComponent()
End Sub
Public Sub New(ByRef obj As EmployeeClass)
InitializeComponent()
End Sub
End Sub
90
Book Store Management
End Class
91
Book Store Management
92
Book Store Management
Catch ex As Exception
Try
objcmd.Dispose()
Catch exc1 As Exception
End Try
Try
objcon.Close()
Catch exc As Exception
End Try
MsgBox(ex.Message)
MsgBox(Err.Source)
End Try
End Sub
Public Sub Action(ByVal check As Boolean)
Dim objcon As SqlConnection = Nothing
Dim objcmd As SqlCommand = Nothing
Dim query As String = ""
Try
objcon = New SqlConnection(ConfigurationManager.ConnectionStrings("Book ").ConnectionString)
93
Book Store Management
Catch ex As Exception
Try
objcmd.Dispose()
Catch exc1 As Exception
End Try
Try
objcon.Close()
Catch exc As Exception
End Try
MsgBox(ex.Message)
End Try
End Sub
94
Book Store Management
InitializeComponent()
Me.flag = flag
End Sub
End Sub
End Class
End Sub
Private Sub fillStatus()
95
Book Store Management
StatusComboBox.Items.Clear()
StatusComboBox.Items.Add("Active")
StatusComboBox.Items.Add("InActive")
StatusComboBox.SelectedIndex = 0
End Sub
Private Sub setEmployeeValues(ByRef obj As EmployeeClass)
FillCombo()
fillStatus()
Me.EIDTextBox.Text = obj.EmployeeID
Me.ENameTextBox.Text = obj.EmployeeName
Dim i As Integer
For i = 0 To DesignationComboBox.Items.Count - 1
If DesignationComboBox.Items.Item(i).ToString = obj.DesignationType Then
Me.DesignationComboBox.SelectedItem = DesignationComboBox.Items.Item(i)
End If
Next
If Me.StatusComboBox.Items.Contains(obj.Status) Then
Me.StatusComboBox.SelectedItem = obj.Status
End If
Me.DOBTextBox.Text = obj.DateofBirth
Dim dateobj As DateTimeFormatInfo = New DateTimeFormatInfo()
dateobj.ShortDatePattern = "dd/MM/yyyy"
Dim date1 As Date = Date.Parse(obj.DateofBirth, dateobj)
Me.DateTimePicker1.Value = date1
Me.SalaryTextBox.Text = obj.Salary
Me.AddressTextBox.Text = obj.Address
End Sub
Private Sub FillCombo()
Me.DesignationComboBox.Items.Clear()
Dim myConnection As SqlConnection = Nothing
Dim command As SqlCommand = Nothing
Try
myConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("Book
").ConnectionString)
'myConnection = New SqlConnection("Data Source=COM4\SQLEXPRESS;Initial
Catalog=MyData;Integrated Security=True;Pooling=False")
myConnection.Open()
command = New SqlCommand("select * from employeedesignation", myConnection)
Dim dbreader As SqlDataReader = command.ExecuteReader()
While dbreader.Read()
' MsgBox("Hello" & dbreader.Item(1).ToString)
Dim objlist As New DesignationClass()
objlist.DesignationID = dbreader.GetValue(0)
objlist.Designation = dbreader.GetString(1)
DesignationComboBox.Items.Add(objlist)
End While
command.Dispose()
myConnection.Close()
DesignationComboBox.SelectedIndex = 0
Catch ex As Exception
command.Dispose()
myConnection.Close()
MsgBox(ex.Message)
End Try
End Sub
Private Function validateFields() As Boolean
If ENameTextBox.Text.Trim.Length = 0 Then
MsgBox("Employee Name is Required!")
96
Book Store Management
Return False
End If
If String.IsNullOrEmpty(SalaryTextBox.Text.Trim) Or Not IsNumeric(SalaryTextBox.Text.Trim) Then
MsgBox("Valid salary is Required!")
Return False
End If
If AddressTextBox.Text.Trim.Length = 0 Then
MsgBox("Address is Required!")
Return False
End If
Return True
If Not IsNumeric(SalaryTextBox.Text.Trim) Then
MsgBox("Price must be a number")
Return False
End If
Return True
End Function
If validateFields() Then
Dim d As Date = DateTimePicker1.Value
Try
Dim myConnection As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("Book ").ConnectionString)
myConnection.Open()
Dim query As String
query = "update Employee set EmployeeName='" & ENameTextBox.Text.Trim() &
"',DesignationID=" & CType(DesignationComboBox.SelectedItem, DesignationClass).DesignationID &
",Salary=" & Val(SalaryTextBox.Text) & ",DateOfBirth='" & d & "',Address='" &
AddressTextBox.Text.Trim() & "',status='" & StatusComboBox.SelectedItem.ToString & "' where
EmployeeID=" & Val(EIDTextBox.Text)
' MsgBox(query)
Dim command As SqlCommand = New SqlCommand(query, myConnection)
Dim i As Integer = command.ExecuteNonQuery
If i > 0 Then
If MsgBox("Employees has been Updated!Do you want to continue?",
MsgBoxStyle.YesNo).Equals(MsgBoxResult.Yes) Then
ClearFields()
objsearch.Action(True)
Me.Close()
Else
command.Dispose()
myConnection.Close()
Me.Dispose()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
97
Book Store Management
DesignationComboBox.SelectedIndex = 0
SalaryTextBox.Text = ""
DOBTextBox.Text = ""
AddressTextBox.Text = ""
ENameTextBox.Focus()
End Sub
End Sub
98
Book Store Management
99
Book Store Management
100
Book Store Management
End Sub
Public Sub New(ByRef obj As EmployeeClass, ByRef objsearch As SearchEmployeeDialog)
InitializeComponent()
Me.objsearch = objsearch
setEmployeeValues(obj)
End Sub
End Class
101
Book Store Management
dbreader.Close()
command.Dispose()
myConnection.Close()
ListView1.Items.Clear()
ComboBox1.SelectedIndex = 0
Dim id As Integer = MiscUtilityClass.getID("BillMaster", "BillID")
TextBox1.Text = id
totalAmt = 0
AddColumn()
ListView1.Columns(5).Width = 0
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub StartUp()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
ListView1.Items.Clear()
ComboBox1.SelectedIndex = 0
Dim id As Integer = MiscUtilityClass.getID("BillMaster", "BillID")
TextBox1.Text = id
totalAmt = 0
AddColumn()
getBook()
End Sub
Private Sub AddColumn()
ListView1.Columns.Clear()
ListView1.Columns.Add("Book ID")
ListView1.Columns.Add("Book Name")
ListView1.Columns.Add("Quantity")
ListView1.Columns.Add("Price")
ListView1.Columns.Add("Amount")
102
Book Store Management
ListView1.Columns.Add("QStock")
ListView1.Columns(5).Width = 0
ListView1.View = View.Details
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button4.Click
If ComboBox1.SelectedIndex > 0 Then
Dim str1 As String = CType(ComboBox1.SelectedItem, BookClass).BookID.ToString
Dim str2 As String = CType(ComboBox1.SelectedItem, BookClass).BookName
Dim str3 As String = CType(ComboBox1.SelectedItem, BookClass).Price.ToString
Dim q As String = CType(ComboBox1.SelectedItem, BookClass).Quantity.ToString
Dim listobj As ListViewItem = New ListViewItem(str1)
listobj.SubItems.Add(str2)
listobj.SubItems.Add(TextBox2.Text.Trim)
listobj.SubItems.Add(str3)
totalAmt = totalAmt + CType(ComboBox1.SelectedItem, BookClass).Price *
Val(TextBox2.Text.Trim)
listobj.SubItems.Add((CType(ComboBox1.SelectedItem, BookClass).Price *
Val(TextBox2.Text.Trim)).ToString)
listobj.SubItems.Add(q)
ListView1.Items.Add(listobj)
TextBox4.Text = totalAmt
End If
End Sub
Try
myConnection = New SqlConnection(constr)
myConnection.Open()
'trans = myConnection.BeginTransaction
103
Book Store Management
'MsgBox(stockQ)
command3 = New SqlCommand("Update inventorymaster set quantity=" & stockQ & " where
bookid=" & Val(id), myConnection) ', trans)
command3.ExecuteNonQuery()
Next
'trans.Commit()
command.Dispose()
command2.Dispose()
command3.Dispose()
myConnection2.Close()
myConnection.Close()
MsgBox("Bill Saved!")
Catch ex As Exception
Try
' trans.Rollback()
Catch exc As Exception
End Try
MsgBox(ex.Message)
End Try
End Sub
End Sub
104
Book Store Management
End Sub
End Class
105
Book Store Management
getCustomer()
cboEmpId.SelectedIndex = 0
End Sub
Private Sub getCustomer()
cboEmpId.Items.Add("Select Employee")
Dim objcon As SqlConnection = Nothing
Dim objcmd As SqlCommand = Nothing
Dim objrdr As SqlDataReader = Nothing
Dim query As String = "select * from Employee"
Try
objcon = New SqlConnection(ConfigurationManager.ConnectionStrings("Grocery").ConnectionString)
objcon.Open()
objcmd = New SqlCommand(query, objcon)
objrdr = objcmd.ExecuteReader()
While objrdr.Read
Dim obj As CustomerClass = New CustomerClass
' obj.EmployeeName = objrdr(0)
obj.EmployeeName = objrdr(1)
'obj.address = objrdr(2)
'obj.status = objrdr(3)
cboEmpId.Items.Add(obj)
End While
objcmd.Dispose()
objcon.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Sub
End Sub
106
Book Store Management
107
Book Store Management
End Sub
Private Sub ClearFields()
txtDDailywages.Text = ""
txtDDays.Text = ""
txtDSalary.Text = ""
txtMBasic.Text = ""
txtMDaily.Text = ""
txtMDays.Text = ""
txtMSalary.Text = ""
End Sub
108
Book Store Management
objcmd.Dispose()
objcon.Close()
Me.Dispose()
End If
' End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
'End If
End Sub
End Sub
End Sub
End Sub
End Sub
End Class
109
Book Store Management
End Sub
If CriteriaKey.SelectedIndex = 1 Then
Dim df As DateTimeFormatInfo = New DateTimeFormatInfo
df.ShortDatePattern = "dd/MM/yyyy"
Dim d As Date = Date.Parse(CriteriaValue.Text.Trim, df)
query = query & " where BillDate='" & d.ToString("MM/dd/yyyy") & "'"
End If
If CriteriaKey.SelectedIndex = 2 Then
query = query & " where convert(varchar(20),BillID) like '" & CriteriaValue.Text.Trim & "%'"
End If
' MsgBox(query)
myConnection = New SqlConnection(constr)
Dim databaseadapter As SqlDataAdapter = New SqlDataAdapter(query, myConnection)
Dim table As New DataTable
databaseadapter.Fill(table)
DataGridView1.DataSource = table
Catch ex As Exception
110
Book Store Management
MsgBox("Invalid Date")
End Try
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
111
Book Store Management
Try
myDA.Fill(myDS, "datatable1")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
112
Book Store Management
Try
myDA.Fill(myDS, "datatable2")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
113
Book Store Management
Try
myDA.Fill(myDS, "datatable5")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
End Class
114
Book Store Management
Try
CrystalReportViewer1.ReportSource = rpt
End Class
115
Book Store Management
Try
Dim query As String = "SELECT PurchasedItem.SrNo, BookMaster.BookName,
PurchasedItem.Quantity, PurchasedItem.Price, BillMaster.BillDate, BillMaster.Total FROM BookMaster
INNER JOIN PurchasedItem ON BookMaster.BookID = PurchasedItem.BookID INNER JOIN BillMaster ON
PurchasedItem.BillID = BillMaster.BillID where BillMaster.BillDate between '" &
d1.ToString("MM/dd/yyyy") & "' and '" & d2.ToString("MM/dd/yyyy") & "'"
'MsgBox(query)
myConnection = New SqlConnection(connectionString)
MyCommand.Connection = myConnection
MyCommand.CommandText = query
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "DataTable1")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
End Class
116
Book Store Management
Try
myDA.Fill(myDS, "DataTable3")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Me.id = id
End Sub
End Class
117
Book Store Management
End Sub
End Class
118
Book Store Management
7.
CONCLUSION
119
Book Store Management
CONCLUSION
An attempt is made in all its earnest towards the successful completion of the project.
This system was verified with valid as well as with invalid data.
This system is user friendly since it has been developed in visual studio 8 a successful
GUI environment. Since the connection can be extended to any database. The control
will be more powerful.
Upgrading the system if may can be done without affecting the proper functioning of
system.
120
Book Store Management
5.
System implementation
121
Book Store Management
System implementation
Execute project.
122
Book Store Management
6.
FUTURE ENHANCEMENTS
123
Book Store Management
FUTURE ENHANCEMENTS
Due to time constraints on the part of the developer, supplier details form could not be
prepared.
Hence this project would be updated in the near future to include supplier details form
and other similar reports.
Details of book transaction between the owner and the supplier also has to be added
Any changes made in the system in future, will Affect the other functioning of the
System .
124
Book Store Management
7.
References and Bibliography
125
Book Store Management
BIBLIOGRAPHY
REFERENCES BOOKS:
Websites:
www.wrox.com
www.webmonkey.com
www.w3schools.com
www.google.com
Thank you.
126