Project Report
Project Report
Project Report
1
PREFACE
This project report has been developed especially for you computerization and
management required in “Optical shop Management System”. It is woven with the fiber
of “MICROSFT VISUAL STUDIO 2010”. Which is well known standard programming
language? All the activities in a program are triggered by one event or another. So, with
the help of this software you can do the better computerization of a “Optical shop
Management System”.
The aim of preparing this project is to signify the role of computer in smooth functioning
of “Optical shop Management System” and to explain that how computers help in
records of Customer Bill’s details and all information related to Opticalshop.
No, doubt I have tried my best effort to make the project in user friendly
environment and managing Optical shop Management System full placed, because this
is the most powerful feature of the project report. The approach adopted is very simple,
lucid and comprehensive. The latest term and data have been taken into account and using
facility of options and menus.
2
Coderbaba
TABLE OF CONTENTS
S.NO. CONTENTS
3
2. CERTIFICATE OF THE PROJECT GUIDE
This is to certify that this project report entitled “Optical shop Management System”
submitted ABC Institute of Technical Studies India is a bonafide record of work done
by “coderbaba” under my supervision.
5
SELF CERTIFICED
This is to certify that the dissertation /Project report entitled ” Optical shop
Management System” is done by me is an automatic work carried out for the partially
fulfillment of the requirements for the award of the degree of BCA under the guidance of
Mr. ABC MISHRA. The matter embodied in this project work has not been submitted
earlier for award of any degree or diploma to the best of my knowledge and belief.
6
3. Declaration:-
This is to declare that this report has been written by me/us. No part of the report is
plagiarized from other sources. All information included from other sources have been
duly acknowledged. I/We aver that if any part of the report is found to be plagiarized,
I/we are shall take full responsibility for it
7
4. INTRODUCTION
8
Objective:-
It’s provides one attractive environment where you can manipulate data and
information about Optical Shop Management System, Customer, Doctor, Eye Glasses
and Daily collection. So we can say the Core purpose of designing “Optical Shop
Management System” is to manage the task related to the Optical shop details and to
reduce time to searching of appropriate subscription in Agency View.
Optical Shop Management Software provides the backbone and organization for your
optical shop. It was designed specifically to allow opticians to order, check-in, and
dispense spectacles, contact lenses and other inventory. Our optical shop software
provides detailed reports and summaries of your inventory on hand and dispensed. It
reports how many and what types of remakes your shop has. It helps you track the status
of your jobs. We have the solution readymade for you at cost effective prices. We
continually add new features. Main feature of Optical Shop Management Software are
shown below
9
What is the Problem
REQUIREMENTS GATHERING :-
Proper excel sheet is maintained in some OSMS.
Customer list should be maintained
Mode of Payment.
Admin & Doctor details
Manager details.
Product’s details.
Sales details.
10
Report message.
Expenses.
Project Scope:-
This is a type of software, suitable to all Optical Shop. This software has all the modules
to manage Optical Shop Customer & distribution. Separate division is provided to
maintain customer & Product details etc.
This application is designed for small Optical Shop’s as well as small and large OSMS.
This will be one of the interesting applications that one can work on and implement in
real time world.
11
4.2 Definition of problem:-
In the current System. Admin/User faces several problems for check details. Problem like,
admin must be know the Customer and other details & type they entered submission of
form.
You can calculate how many items a particular customer take and also easily calculate
total price. Behind this problem is that, sometime its difficult to work on Computer so
people must know the knowledge of basic computer.
It increases the accuracy of the system. The software is made user friendly so that work
becomes easier.
The transaction reports of the system can be retried as and when required.
The software improves the working methods by replacing the existing manual system with
the computer based system.
Reports can also be generated.
12
4.3 System Analysis &Design vis-à-vis user requirements
13
Module wise description
• Master: Product Master used to enter Product details like name , type, price and
doctor recommendation .
• Sales report: This module will show sales report. Which customer purchase the product
.
•Bill generation: This module will generate the bill for the particular customer.
•Search module: This module can allow searching for particular product, customer with
the help of their id number.
• Admin Master: Admin master are used to maintain the Admin details like name,
address, contact no of the Trainer.
14
Forms
15
4.4 Methodology adopted:-
1. The new system requirements are defined in as much detail as possible. This
usually involves interviewing a number of users representing all the external or
internal users and other aspects of the existing system.
3. A first prototype of the new system is constructed from the preliminary design. I.e.
usually a scaled-down system, and represent an approximation of the characteristics
of the final products.
5. Evaluating the first prototype in terms of its strengths, weakness and risks
The team of the project follows a methodology as to which the project would be
initiated. The methodology adopted carries various approaches to be used in the project.
Data flow Diagram, charts, flow charts are used to show the concept of the project.
16
The various methodologies adopted are:-
I. Data flow diagram: Data flow diagram is used to depict the transaction of the
data, processing of the data and flow of data. It also shows the relationship
between entities.
II. Charts: Chart represents the picture of the project structure which includes
organization and system structure.
III. Flow chart: Flow chart is the pictorial representation of the complete flow of the
project. It shows the sequence and the direction of the project.
17
4.5 System Implementation:-
After getting our project coding complete we have to get the project
Implemented on system for use, therefore to implement our project following should be
done:
The protocol description is nothing more than a set of message and a corresponding
comment for each message.
For example, a portion of the protocol description for the object of Database.
18
5. Details of Hardware &Software requirements:-
System Requirement:
1. Hardware Specification:-
2. Software Specifications:-
This system was developed under window 8. It is complete with all 64-
bit versions of windows operating system. Windows is a popular and largest used
operating system in the world because it is easy to understand and provides an easy
interface to users.
19
Windows 7:
The main responsibility of an operating system is to manage
computer’s resources. All activities in the system scheduling application programs,
waiting files to disk, sending data across a network and so on should function as
seamlessly and transparently as possible. Windows8 makes your computer easier to
use, with new and enhanced feature.
Integration:
Multitasking Concepts:
20
function), essentially consist of saving the processor context (instruction pointer,
stack pointer, register contents) of one running program and loading that of another.
6 . DFD/Flow Charts:-
The Data flow Diagram shows the flow of data. It is generally made of symbols
given below:
The DFD can be up to several levels. The 0 level DFD states the flow of data in
the system as seen from the outward in each module.
The first level DFD show more detail, about the single process of the 0 level DFD
The second level DFD can show even more details and so on.
21
Construction a DFD:
0 - LEVEL DFD
Admin/User
22
OPTICAL SHOP
MANAGEMENT
SYSTEM
DATABASE
23
1 - LEVEL DFD
Login
DATABASE
24
Printing Receipt
Change passwrod
Reports
Add, Edit-Customer
Add
mer/Product/Equipme
nt/enqury
ADMINISTRATOR
Optical shop
MANAGEMENT SYSTEM
Login
25
7. Database Structure:-
Tables:-
Field Type
UserName varchar
password varchar
usertype varchar
Table 2: Customer
Field Type
CustomerID autonumber
customerName varchar
Address varchar
Phone datetime
EyePower varchar
ConsultantDocotor varchar
Table 3: Product
Field Type
ProuductID AutoNumber
ProductName Varchar
Eyepower Varchar
GlassType Varchar
Frametype Varchar
Price number
26
Table 4: Doctor
Field Type
DoctorID autonumber
DoctorName Varchar
Qualification Varchar
Hospitanname Nvarchar
Phone numeric
Email nvarchar
Table 5: tblSales
Field Type
Bill AutoNumber
customerID varhcar
CustomerName Varchar
CustAddress Varchar
Phone Numeric
Eyepower Varchar
consultantDoctor Varchar
productID Number
PEyePower Varchar
GlassType Varchar
Price Number
Quantity Number
TotalPrice Number
27
DoctorID Number
Qualification Varchar
HospitalName Varchar
Dphone Varchar
Email Varchar
Productname Varchar
Dateofsale Date
Frametype varchar
28
8.SCREEN DESIGN:-
HOME :-
29
LOGIN :-
30
Add Customer:-
31
Edit & Update Customer:-
32
Add Product:
33
Edit Product:
34
Add Doctor:
35
Edit Doctor:
36
Sales form:
37
Show Receipt Form:
38
Print Receipt form:
39
Show all Details:
40
Show Sales Report:
41
All Sales Report:
42
9. Coding:-
Login Form:
Imports System.Data
Imports System.Data.OleDb
My.Forms.MDIParent1.Show()
Me.Close()
Else
MsgBox("UserID & Password Not Matched", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
'str = "Select * from Login where UserName='" + UsernameTextBox.Text + "' and Password='"
+ PasswordTextBox.Text + "'"
'cmd = New OleDbCommand(str, con)
'con.Open()
'Dim dr As OleDbDataReader = cmd.ExecuteReader()
'If dr.HasRows Then
' con.Close()
' My.Forms.MDIParent1.Show()
43
' Me.Close()
'Else
' MsgBox("UserID & Password Not Matched", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
'End If
'con.Close()
End Sub
End If
End If
End Sub
End Class
44
Home Form:
Imports System.Windows.Forms
End Sub
End Sub
45
End Sub
End Sub
End Sub
46
Private Sub ADDProductToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ADDProductToolStripMenuItem.Click
AddProduct.Show()
End Sub
End Sub
End Sub
End Sub
End Sub
ALLDetails.Show()
End Sub
End Sub
End Sub
47
End Sub
End Class
Add Customer:
Imports System.Data
Imports System.Data.OleDb
Public Class Customer
Try
con.Open()
cmd = New OleDbCommand("Insert into
Customer(CustomerName,Address,Phone,EyePower,ConsultantDoctor) values( '" + TextBox1.Text + "','"
+ TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "')",
con)
Dim i As Integer = cmd.ExecuteNonQuery()
If (i > 0) Then
48
SearchID()
clr()
Else
MsgBox("Record NOT saved ", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
Catch ex As Exception
MsgBox("Error", ex.Message)
Finally
con.Close()
End Try
con.Close()
End Sub
Public Sub clr()
TextBox1.Clear()
TextBox2.Text = ""
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
End Sub
End While
Catch ex As Exception
MsgBox("Error", ex.Message)
Finally
con.Close()
End Try
End Sub
End Sub
End Class
49
Edit Customer:
Imports System.Data.OleDb
Public Class EditCustomer
CusID()
End Sub
con.Open()
str = "Select * From Customer"
cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "Customer")
Dim a As Integer = ds.Tables("Customer").Rows.Count - 1
For i As Integer = 0 To a
ComboBox1.Items.Add(ds.Tables("Customer").Rows(i)(0).ToString())
Next
End Sub
con.Open()
End If
50
Catch ex As Exception
MsgBox("", ex.Message)
dr.Close()
Finally
con.Close()
End Try
End If
End Sub
End If
Try
con.Close()
con.Open()
str = "UPDATE Customer set
CustomerName=@name,Address=@Address,Phone=@Phone,EyePower=@EP,ConsultantDoctor=@CD Where
CustomerID=@CID"
cmd = New OleDbCommand(str, con)
cmd.Parameters.AddWithValue("@name", TextBox1.Text)
cmd.Parameters.AddWithValue("@Address", TextBox2.Text)
cmd.Parameters.AddWithValue("@Phone", TextBox3.Text)
cmd.Parameters.AddWithValue("@EP", TextBox4.Text)
cmd.Parameters.AddWithValue("@CD", TextBox5.Text)
cmd.Parameters.AddWithValue("@CID", ComboBox1.Text)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox("", ex.Message)
Finally
con.Close()
End Try
con.Close()
End Sub
51
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = ""
Or TextBox5.Text = "" Or ComboBox1.Text = "" Then
MsgBox("Plz Fill all details")
Exit Sub
End If
Dim msg As Integer = MsgBox("Do You Really want to Delete Customer :-'" & TextBox1.Text &
"' ?", MsgBoxStyle.YesNoCancel, "Delete Customer Record")
Try
con.Open()
str = "Delete From Customer where CustomerID=@ID"
cmd = New OleDbCommand(str, con)
cmd.Parameters.AddWithValue("@ID", ComboBox1.Text)
cmd.ExecuteNonQuery()
MsgBox("Customer Record Deleted", MsgBoxStyle.Information, MsgBoxStyle.OkOnly)
clr()
Catch ex As Exception
MsgBox("Record Not Deleted")
Finally
con.Close()
End Try
End If
End Sub
Public Sub clr()
TextBox1.Text = ""
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
ComboBox1.Items.Clear()
52
End Sub
ComboBox1.Items.Clear()
Me.Hide()
End Sub
End Sub
End Class
Add Magazine:
Imports System.Data.OleDb
Imports System.Data
Public Class AddMagazins
End Sub
Public Sub clr()
TextBox1.Clear()
TextBox2.Text = ""
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
End Sub
Try
con.Open()
cmd = New OleDbCommand("insert into Magazine values('" & TextBox1.Text & "','" &
TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')",
con)
Dim i As Integer = cmd.ExecuteNonQuery()
If (i > 0) Then
53
MsgBox("Record saved successfully ", MsgBoxStyle.Information,
MsgBoxStyle.OkOnly)
clr()
Else
MsgBox("Record NOT saved ", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
Catch ex As Exception
MsgBox("", ex.Message)
Finally
con.Close()
End Try
End Sub
End Class
Add Doctor:
Imports System.Data.OleDb
Public Class AddDoctor
Try
con.Open()
cmd = New OleDbCommand("Insert into
Doctor(DoctorName,Qualification,HospitalName,Phone,Email) values( '" + TextBox1.Text + "','" +
TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "')",
con)
Dim i As Integer = cmd.ExecuteNonQuery()
If (i > 0) Then
clr()
Else
MsgBox("Record NOT saved ", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
Catch ex As Exception
MsgBox(ex.Message)
54
Finally
con.Close()
End Try
End Sub
Public Sub clr()
TextBox1.Clear()
TextBox2.Text = ""
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
End Sub
End Class
Edit Doctor:
Imports System.Data.OleDb
55
Public Sub CusID()
ComboBox1.Items.Clear()
ds.Clear()
con.Close()
con.Open()
str = "Select * From Doctor"
cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "Doctor")
Dim a As Integer = ds.Tables("Doctor").Rows.Count - 1
For i As Integer = 0 To a
ComboBox1.Items.Add(ds.Tables("Doctor").Rows(i)(0).ToString())
Next
End Sub
con.Open()
End If
Catch ex As Exception
MsgBox("", ex.Message)
dr.Close()
Finally
con.Close()
End Try
End If
End Sub
56
Exit Sub
End If
Try
con.Close()
con.Open()
str = "UPDATE Doctor set
DoctorName=@name,Qualification=@qul,HospitalName=@HN,Phone=@Phone,Email=@Email Where
DoctorID=@dID"
cmd = New OleDbCommand(str, con)
cmd.Parameters.AddWithValue("@name", TextBox1.Text)
cmd.Parameters.AddWithValue("@qul", TextBox2.Text)
cmd.Parameters.AddWithValue("@HN", TextBox3.Text)
cmd.Parameters.AddWithValue("@Phone", TextBox4.Text)
cmd.Parameters.AddWithValue("@Email", TextBox5.Text)
cmd.Parameters.AddWithValue("@dID", ComboBox1.Text)
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox("", ex.Message)
Finally
con.Close()
End Try
con.Close()
End Sub
End If
Dim msg As Integer = MsgBox("Do You Really want to Delete Doctor :-'" & TextBox1.Text &
"' ?", MsgBoxStyle.YesNoCancel, "Delete Customer Record")
Try
con.Open()
str = "Delete From Doctor where DoctorID=@ID"
cmd = New OleDbCommand(str, con)
cmd.Parameters.AddWithValue("@ID", ComboBox1.Text)
cmd.ExecuteNonQuery()
MsgBox("Customer Record Deleted", MsgBoxStyle.Information, MsgBoxStyle.OkOnly)
clr()
57
ComboBox1.Items.Clear()
ds.Clear()
str = "select * from Doctor"
cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "Doctor")
ctr = ds.Tables("Doctor").Rows.Count - 1
For i = 0 To ctr
ComboBox1.Items.Add(ds.Tables("Doctor").Rows(i)(0).ToString)
Next
Catch ex As Exception
MsgBox("Record Not Deleted")
Finally
con.Close()
End Try
End If
End Sub
Public Sub clr()
TextBox1.Text = ""
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
ComboBox1.Items.Clear()
End Sub
End Sub
End Class
Add Product:
Imports System.Data.OleDb
58
Try
con.Open()
cmd = New OleDbCommand("Insert into
Product(ProductID,ProductName,EyePower,GlassType,FrameType,Price) values('" & TextBox1.Text &
"','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text &
"','" & TextBox6.Text & "')", con)
Dim i As Integer = cmd.ExecuteNonQuery()
If (i > 0) Then
End If
End If
Else
MsgBox("Record NOT saved ", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
Catch ex As Exception
MsgBox("Error", ex.Message)
Finally
con.Close()
End Try
End Sub
con.Open()
str = "select * from Product"
cmd = New OleDbCommand(str, con)
59
da.SelectCommand = cmd
da.Fill(ds, "Product")
Lastno = ds.Tables("Product").Rows.Count + 1
TextBox1.Clear()
TextBox2.Text = ""
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
End Sub
End Class
60
Edit Product:
Imports System.Data.OleDb
End Sub
Public Sub getdata()
con.Close()
con.Open()
Using cmd As New OleDbCommand()
cmd.CommandText = "Select * from Product"
cmd.Connection = con
Dim dt As New DataTable()
Using da As New OleDbDataAdapter(cmd)
da.Fill(dt)
DataGridView1.DataSource = dt
End Using
End Using
End Sub
con.Open()
Using cmd As New OleDbCommand()
cmd.CommandText = "Select * from Product where ProductID LIKE @ID + '%' "
cmd.Connection = con
cmd.Parameters.AddWithValue("@ID", TextBox1.Text.Trim())
Dim dt As New DataTable()
Using da As New OleDbDataAdapter(cmd)
da.Fill(dt)
If (dt.Rows.Count > 0) Then
DataGridView1.DataSource = dt
TextBox2.Text = dt.Rows(0)(0).ToString()
TextBox3.Text = dt.Rows(0)(1).ToString()
TextBox4.Text = dt.Rows(0)(2).ToString()
TextBox5.Text = dt.Rows(0)(3).ToString()
TextBox6.Text = dt.Rows(0)(4).ToString()
TextBox7.Text = dt.Rows(0)(5).ToString()
Else
MsgBox("Record Not Found", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
61
End Using
End Using
End Sub
Public Sub clr()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
End Sub
Dim i As Integer
i = DataGridView1.CurrentRow.Index
Me.TextBox2.Text = DataGridView1.Item(0, i).Value
Me.TextBox3.Text = DataGridView1.Item(1, i).Value
Me.TextBox4.Text = DataGridView1.Item(2, i).Value
Me.TextBox5.Text = DataGridView1.Item(3, i).Value
Me.TextBox6.Text = DataGridView1.Item(4, i).Value
Me.TextBox7.Text = DataGridView1.Item(5, i).Value
End Sub
'FOR UPDATE
con.Close()
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = ""
Or TextBox5.Text = "" Or TextBox6.Text = "" Or TextBox7.Text = "" Then
MsgBox("PLZ FIll All details")
Exit Sub
End If
con.Open()
cmd = New OleDbCommand("Update [Product] Set [ProductName]='" & TextBox3.Text & "',
[EyePower]='" & TextBox4.Text & "',[GlassType]='" & TextBox5.Text & "',[FrameType]='" &
TextBox6.Text & "',[Price]='" & TextBox7.Text & "' Where [ProductID]='" & TextBox2.Text & "' ",
con)
Try
cmd.ExecuteNonQuery()
MsgBox("Record UPDATE SUccessfully..")
clr()
62
getdata()
Catch ex As Exception
MsgBox(ex.Message)
Finally
cmd.Dispose()
con.Close()
End Try
End Sub
cmd = New OleDbCommand("Delete from Product Where ProductID='" & TextBox2.Text & "'",
con)
Try
cmd.ExecuteNonQuery()
MsgBox("Record deleted successfully")
clr()
getdata()
Catch ex As Exception
MsgBox(ex.Message)
Finally
con.Close()
End Try
End If
End Sub
End Sub
63
End Sub
End Class
Magazine Sale:
Imports System.Data
Imports System.Data.OleDb
con.Open()
str = "Select * From Customer"
cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "Customer")
Dim a As Integer = ds.Tables("Customer").Rows.Count - 1
For i As Integer = 0 To a
ComboBox1.Items.Add(ds.Tables("Customer").Rows(i)(0).ToString())
Next
End Sub
Public Sub magazinename()
ComboBox2.Items.Clear()
ds.Clear()
con.Close()
con.Open()
str = "Select * From Magazine"
cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "Magazine")
Dim a As Integer = ds.Tables("Magazine").Rows.Count - 1
For i As Integer = 0 To a
ComboBox2.Items.Add(ds.Tables("Magazine").Rows(i)(0).ToString())
Next
End Sub
Public Sub clr()
TextBox1.Clear()
TextBox2.Clear()
64
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
ComboBox1.Items.Clear()
ComboBox2.Items.Clear()
ComboBox3.Items.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
con.Close()
Try
str = "Insert into [MagazineSale]([CName],[Mname],[Lang],[Price],[Desc],[Concept],
[NOD],[TotalPrice],[DOSale]) values('" + ComboBox1.Text + "','" + ComboBox2.Text + "','" +
TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" +
ComboBox3.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "')"
con.Open()
Me.Hide()
Receipt2.Show()
Else
MsgBox("Not save record")
clr()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
'clr()
con.Close()
'bill()
'
'NewsPaper()
End Sub
Public Sub bill()
65
con.Close()
TextBox1.Clear()
con.Open()
str = "select * from MagazineSale"
cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "MagazineSale")
Lastno = ds.Tables("MagazineSale").Rows.Count + 1
End Sub
CusID()
magazinename()
End Sub
con.Open()
dr.Close()
End If
Catch ex As Exception
MsgBox("", ex.Message)
66
dr.Close()
Finally
con.Close()
End Try
End If
End Sub
67
Sales Report:
Imports System.Data
Imports System.Data.OleDb
Public Class SaleReport
End Sub
End Sub
End Class
All Details:
Imports System.Data.OleDb
Imports System.Data
68
Label4.Visible = False
Label9.Visible = False
Label10.Visible = False
End Sub
Dgv()
End Sub
Public Sub Dgv()
ds.Clear()
con.Close()
con.Open()
str = "Select * From Customer"
Dim Adpt As New OleDbDataAdapter(str, con)
Adpt.Fill(ds, "Customer")
DataGridView1.DataSource = ds.Tables(0)
con.Close()
sum()
End Sub
Adpt.Fill(ds2, "Doctor")
DataGridView1.DataSource = ds2.Tables(0)
con.Close()
sum()
End Sub
69
ComboBox1.Visible = False
Button5.Visible = False
Label4.Visible = False
Label9.Visible = True
Label10.Visible = True
Dgv3()
End Sub
Public Sub Dgv3()
ds.Clear()
con.Close()
con.Open()
str = "Select * From Product"
Dim Adpt As New OleDbDataAdapter(str, con)
Dim ds3 As DataSet = New DataSet
Adpt.Fill(ds3, "Product")
DataGridView1.DataSource = ds3.Tables(0)
con.Close()
sum()
End Sub
Public Sub sum()
Label10.Text = DataGridView1.Rows.Count - 1
End Sub
End Sub
End Sub
End If
End Sub
Public Sub search()
con.Close()
con.Open()
Using cmd As New OleDbCommand()
cmd.CommandText = "Select * From Customer where CustomerID LIKE @ID + '%' "
70
cmd.Connection = con
cmd.Parameters.AddWithValue("@ID", TextBox1.Text.Trim())
Dim dt As New DataTable
Using da As New OleDbDataAdapter(cmd)
da.Fill(dt)
If (dt.Rows.Count > 0) Then
DataGridView1.DataSource = dt
Else
MsgBox("Record Not Found", MsgBoxStyle.Exclamation)
End If
End Using
End Using
End Sub
Public Sub search2()
con.Close()
con.Open()
Using cmd As New OleDbCommand()
cmd.CommandText = "Select * From Doctor where DOctorID LIKE @ID + '%' "
cmd.Connection = con
cmd.Parameters.AddWithValue("@ID", TextBox1.Text.Trim())
Dim dt As New DataTable
Using da As New OleDbDataAdapter(cmd)
da.Fill(dt)
If (dt.Rows.Count > 0) Then
DataGridView1.DataSource = dt
Else
MsgBox("Record Not Found", MsgBoxStyle.Exclamation)
End If
End Using
End Using
DataGridView1.EnableHeadersVisualStyles = False
DataGridView1.Columns(0).HeaderCell.Style.BackColor = Color.Red
End Sub
Public Sub search3()
con.Close()
con.Open()
Using cmd As New OleDbCommand()
cmd.CommandText = "Select * From Product where ProductID LIKE @ID + '%' "
cmd.Connection = con
cmd.Parameters.AddWithValue("@ID", TextBox1.Text.Trim())
Dim dt As New DataTable
Using da As New OleDbDataAdapter(cmd)
da.Fill(dt)
If (dt.Rows.Count > 0) Then
DataGridView1.DataSource = dt
Else
MsgBox("Record Not Found", MsgBoxStyle.Exclamation)
End If
End Using
End Using
DataGridView1.EnableHeadersVisualStyles = False
71
DataGridView1.Columns(0).HeaderCell.Style.BackColor = Color.Blue
End Sub
End Sub
End Class
All Report:
Imports System.Data.OleDb
Imports System.Data
Public Class AllReport
Dim ctr As Integer
Dim tbl As String
Private mRow As Integer = 0
Private newpage As Boolean = True
Dim a As String
Private Sub AllReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Label4.Visible = False
ComboBox1.Visible = False
Button5.Visible = False
Label7.Visible = False
Label8.Visible = False
Label9.Visible = False
Label10.Visible = False
End Sub
Public Sub Dgv()
ds.Clear()
con.Close()
con.Open()
str = "Select * From Customer "
Dim Adpt As New OleDbDataAdapter(str, con)
Adpt.Fill(ds, "Customer")
DataGridView1.DataSource = ds.Tables(0)
sum()
con.Close()
End Sub
Public Sub Dgv2()
ds.Clear()
con.Close()
con.Open()
str = "Select * From Doctor"
Dim Adpt As New OleDbDataAdapter(str, con)
Dim ds2 As DataSet = New DataSet
Adpt.Fill(ds2, "Doctor")
DataGridView1.DataSource = ds2.Tables(0)
sum()
con.Close()
End Sub
Public Sub div3()
ds.Clear()
72
con.Close()
con.Open()
str = "Select * From Product"
Dim Adpt As New OleDbDataAdapter(str, con)
Dim ds3 As DataSet = New DataSet
Adpt.Fill(ds3, "Product")
DataGridView1.DataSource = ds3.Tables(0)
sum()
con.Close()
End Sub
Public Sub sum()
'Dim tot As String = 0
'For i As Integer = 0 To DataGridView1.RowCount - 1
' tot += Val(DataGridView1.Rows(i).Cells(8).Value)
'Next
'If tot = 0 Then
' MessageBox.Show("No Records Found")
'End If
'Label8.Text = "Rs." + tot.ToString()
Label10.Text = DataGridView1.RowCount - 1
End Sub
Dgv()
End Sub
73
Label10.Visible = False
con.Close()
If ComboBox1.Text = "Customer" Then
search()
ElseIf ComboBox1.Text = "Doctor" Then
search2()
Else
MsgBox("Select Table Name from Combobox", MsgBoxStyle.Critical)
End If
End Sub
Public Sub search()
con.Close()
con.Open()
Using cmd As New OleDbCommand()
cmd.CommandText = "Select * from Customer where CustomerID LIKE @ID + '%' "
cmd.Connection = con
cmd.Parameters.AddWithValue("@ID", TextBox1.Text.Trim())
Dim dt As New DataTable()
Using da As New OleDbDataAdapter(cmd)
da.Fill(dt)
If (dt.Rows.Count > 0) Then
DataGridView1.DataSource = dt
Else
MsgBox("Record Not Found", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
End Using
End Using
DataGridView1.EnableHeadersVisualStyles = False
DataGridView1.Columns(0).HeaderCell.Style.BackColor = Color.Blue
End Sub
Public Sub search2()
con.Close()
con.Open()
Using cmd As New OleDbCommand()
cmd.CommandText = "Select * from Doctor where DoctorID LIKE @ID + '%' "
cmd.Connection = con
cmd.Parameters.AddWithValue("@ID", TextBox1.Text.Trim())
Dim dt As New DataTable()
Using da As New OleDbDataAdapter(cmd)
da.Fill(dt)
If (dt.Rows.Count > 0) Then
DataGridView1.DataSource = dt
Else
MsgBox("Record Not Found", MsgBoxStyle.Critical, MsgBoxStyle.OkOnly)
End If
End Using
End Using
74
End Sub
End Class
75
10. Methodology used for testing:-
Unit Testing:-
White box testing strategy deals with the internal logic and structure
of the code. White box testing is also called as glass, structural, open box or clears box
testing. The tests written based on the white box testing strategy incorporate coverage of
the code written, branches, paths, statements and internal logic of the code etc.
In order to implement white box testing, the tester has to deal with the code and
hence is needed to possess knowledge of coding and logic i.e. internal working of the
code. White box test also needs the tester to look into the code and find out which
unit/statement/chunk of the code is malfunctioning.
77
11. SECURITY ISSUES:-
In the News Paper Management process various security issues have been
implemented. Like The User can’t enter in the system without a valid login name
and password.
This project can be upgraded in future and many more advanced features can be
added to it.
Access rights:-
78
12. Limitation
1. This project does not cancel the details once placed, due to using third party tool (Web
Services) expect Admin.
2. User cannot change the details after submitting the Registration form.
79
13.Bibliography:-
2. Beginning VB.Net
5. www.google.com
80