Project Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 80

VIVEKANAND MAHAVIDYALAYA

K.K ROAD, MOUDHA PARA, RAIPUR (C.G.)

SESSION 2021 - 2022


BACHELOR OF COMPUTER APPLICATION
A PROJECT REPORT
ON
OPTICAL SHOP MANAGEMENT SYSTEM

GUIDED BY:- SUBMITTED BY:-


Prof.LOVE KUMAR SAHU PRAVEER TIWARI

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

1. Cover page as per format


2. Certificate of the project guide
3. Declaration
4. Introduction
4.1 Objective &Scope of the project
4.2 Definition of problem
4.3 System Analysis &Design vis-a-vis user requirements
4.4 System planning (PERT Chart)
4.5 Methodology adopted,
4.6 System Implementation
4.7 System maintenance &Evaluation
5 Details of Hardware &Software requirements
6 DFD/Flow Charts
7 Database Structure
8 Screen Design
9 Coding
10 Methodology used for testing.
11 User/ Operational Manual- including security issues.
12 Limitation
13 Bibliography

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.

Date: Mr. Coder Baba


Place: India ASST.PROFESSOR
4
IIT.India

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.

Signature of the student Name of the student


………………………… ……………………………

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

Place: Allahabad Shivani


Date- 02/01/2016 Roll no: 132xxxx000

7
4. INTRODUCTION

This project “Optical shop Management System” is solution for optical


store centers for purchasing optical glasses, frames and other eye wears.
This system is implemented in Vb.NET with Visual basic programming
Languages. For database MS Access has been used. This project also
keeps record of all the Sales and Order tracking. With this application
customer can see latest eye wear design and get to know the latest price.

To manage the customers in an easier and more convenient way. The


administrator is able to view all the members Doctor and Product list as
well as their details. The basic structure of the system as follows. This
project is a computer-based program and it manages the Optical shop
activity, the personnel and the inventory. This system also maintains the
Doctor details, to provide the valuable reports regarding the progress of
the Optical shop Management system.

4.1 Objective & Scope of the project:-

8
Objective:-

Main aim in developing Optical Shop Management System is to provide an easy


way not only to automate all functionalities of a Optical Shop, but also to provide full
functional reports to top management with the sales of details about any aspect of Store.

Optical Shop Management System is software has the perspective of attaining


attraction of those Optical shop which don’t have one good performing software for
keeping their information secure and make their management easier.

Optical Shop Management System Software is one of the important media of


communication. It is one of the source from which news will be got by the public. This
system is an application that is designed to act as a subscription management for the
Optical Shop and its record manager.

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

• Existing system was manual.


• Time consuming as data entry which include calculations took lot of time.
• Searching was very complex as there could be 100’s of entry every year.
• The proposed system is expected to be faster than the existing system.
• The project was made in order to effectively and efficiently to requirements of the fitness
center. every frequently the person who generally holds the tasks to manage the center
needs t keep records of all the transactions as well as data manually generally and order to
structure these tasks Separate register are maintained. This whole process thus becomes to
control manually.(recovery worn data entered mistakenly can brings serious results.
System Redundancy means repetition/Thus data modified o updated at a particular place
may not be data modified o updated at the other related place which may create
inconsistencies in data handling Destroys *and integrity and creates confusion for the
owner.

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.

Initial functional requirements will be: -

 Secure Login and profile management facilities for all modules


 This project can be used within intranet.
 It will help to increase the efficiency of the OSMS
 It saves time, energy and cost.
 It will also help to avoid manual data entries. And it works very fast.

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

The Optical Shop Management System application will enable


Admin/user to use the system and easily can fill New Customer details, Doctor Detail
form and also can get Product Details with bill record.
The OSMS Management System will have the following functionalities:
I. The Software will enable Admin to fill Product info, Customer, Add Doctor & also
selling purchasing Records.
II. The software will enable Admin/user who can easily maintain the OSMS Records
III. The software will enable to view Daily collection details and Customer details.
IV. The application will also provide the facility to Print Receipt when customer buy any
eye wears & also can access more information about the Sales and all record which
is necessary to the OSMS
V. Admin can also provide various information that is related to the OSMS System and
also managed it.
VI. You can change your Password easily

13
Module wise description

OSM System Modules


 
• Login: User must provide their user name and password to get access the system,
system validate user name and password. After successful login system will captured
login date, time and allow to accessing the main screen and menu options as per user
type.
• Main Menu: After successfully login system display main screen with available menu
option to the user as per rights. It also display user name, Date, time in top of the screen.
•Customer master: The details of the customers like name, address, Phone address, etc
that can be maintained easily.

• 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.

• Change Password: User can change his/her own password.

• Admin Master: Admin master are used to maintain the Admin details like name,
address, contact no of the Trainer.

14
Forms

This module consists of the following sub modules

1. Admin Login Form


2. Add & Edit Customer
3. Add & Edit Product Form
4. Add & Edit Doctor Form
5. Bill or Receipt printing & enquiry Form
6. All Reports & Receipt Form
7. Change Password
8. About Me
9. Loading form etc.

15
4.4 Methodology adopted:-

This model is development combines the features of the prototyping


model and the waterfall model. The spiral model is intended for large, expensive and
complicated projects.

The steps in the spiral model can be generated as follows:

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.

2. A preliminary design is created for the new 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.

4. A second prototype is evolved by the fourfold procedure:

5. Evaluating the first prototype in terms of its strengths, weakness and risks

6. Defining the requirements of the second prototype.

7. Planning and designing the second prototype.

8. Constructing and testing the second prototype.

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:-

The system implementation is very effective of the project to the


system requirement data. It is a system requirement implementation of the system
analysis. System requirement of the data to the system maintenance and data recovery

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:

 MS_Access 2007 should be installed with appropriate Database.

Operation implied by a message that is passed to an object. Implementation details include


information about the object’s private part; that is, internal details about the data structure
that describe the object’s attributes and procedural details that describe operations.
An Implementation description that shows implementation details for each

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:-

It is recommended that the minimum configuration for clients is as


appended below:-

Suggested Configuration of Windows clients:-

Microprocessor : Pentium-4 class processor, 2.2 GHz


Ram : 1GB of RAM.
Hard Disk : 10 gigabytes (GB) on installation drive,
which includes 500 MB on system drive.
CD ROM Drive : 52 X CD ROM Drive.

2. Software Specifications:-

Operating System : Windows 7.


RDBMS : MS Access 2007/ Sql Server 2008.
Front End : Microsoft Visual Studio 2010.
.

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.

Faster Operating System:

Windows 98 includes tools that help your computer run


faster than Windows 95 without adding new hardware. Window 98 includes a suite
of programs designed to optimized you’re web.

Integration:

Windows 98 Explorer and Internet Explorer integrate local and Web-


based resources in a single viewer computer’s efficiency, especially when used
together. Window 98 makes your computer more entertaining by new hardware.
These enhancements provide you with hours of fun.

Multitasking Concepts:

Multitasking in general refers to an operating system’s


capability to load and execute several applications concurrently. A multitasking
operating system is consider a robust and reliable one if it successful shields
concurrent applications from each other, making them believe that they system also
shields application from other’s bugs.

To large extent, multitasking operating system relay on system hardware to


implement these capabilities. Another important aspect of multitasking is process
scheduling. As process is capable of executing only a single stream of instruction at
any given, multitasking would obviously not be possible without the technique of
the context switching. A context switch, triggered by a specific event (such as an
interrupt from a timer circuit or a call by the running application to a specific

20
function), essentially consist of saving the processor context (instruction pointer,
stack pointer, register contents) of one running program and loading that of another.

In a cooperative multitasking environment, the operating system relies explicitly on


applications to yield control by regularly calling a specific set of operating system
functions. Context switching takes place at well-defined point during the execution
of a program.

6 . DFD/Flow Charts:-

The Data flow Diagram shows the flow of data. It is generally made of symbols
given below:

A square shows the Entity.

A Circle shows the Process

An open Ended Rectangle shows the data store.

An arrow shows the data flow.

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:

1. Process should be named.


2. The direction of flow is from top to bottom and from left to right.
3. When a process is exploded into lower level details, they are numbered.
4. The name of data stores, sources , and destinations are written in capital letters.
Process and data flow names have the first letter of each word capitalized.

0 - LEVEL DFD

Admin/User
22
OPTICAL SHOP
MANAGEMENT
SYSTEM

DATABASE

23
1 - LEVEL DFD

User ADMIN Login

Login

OPTICAL SHOP MANAGEMENT SYSTEM

DATABASE

24
Printing Receipt
Change passwrod

Reports
Add, Edit-Customer

Add
mer/Product/Equipme
nt/enqury

ADMINISTRATOR

Optical shop
MANAGEMENT SYSTEM

Login

ADMIN can view all DATABASE


details of agency

25
7. Database Structure:-

Tables:-

Table 1: login Table

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

Public Class LoginForm1

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


OK.Click
con.Close()
If UsernameTextBox.Text = "" Then UsernameTextBox.Focus() : Exit Sub
If PasswordTextBox.Text = "" Then PasswordTextBox.Focus() : Exit Sub

cmd = New OleDbCommand("Select * from Login where UserName=@UserName and


Password=@Password", con)

Dim UParam As New OleDb.OleDbParameter("@UserName", Me.UsernameTextBox.Text)


Dim PassParam As New OleDb.OleDbParameter("@Password", Me.PasswordTextBox.Text)
cmd.Parameters.Add(UParam)
cmd.Parameters.Add(PassParam)
cmd.Connection = con
cmd.Connection.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
If dr.HasRows Then
con.Close()

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

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Cancel.Click
Me.Close()
End Sub

Private Sub UsernameTextBox_KeyPress(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles UsernameTextBox.KeyPress

If Asc(e.KeyChar) <> 8 Then


If Asc(e.KeyChar) < 65 Or Asc(e.KeyChar) > 122 Then
e.Handled = True

End If
End If

End Sub
End Class

44
Home Form:
Imports System.Windows.Forms

Public Class MDIParent1

Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


Me.Close()
End Sub

Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


' Use My.Computer.Clipboard to insert the selected text or images into the clipboard
End Sub

Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


' Use My.Computer.Clipboard to insert the selected text or images into the clipboard
End Sub

Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData to retrieve
information from the clipboard.
End Sub

Private Sub ToolBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)

End Sub

Private Sub StatusBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)

End Sub

Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


Me.LayoutMdi(MdiLayout.Cascade)

45
End Sub

Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


Me.LayoutMdi(MdiLayout.TileVertical)
End Sub

Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub

Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


Me.LayoutMdi(MdiLayout.ArrangeIcons)
End Sub

Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


' Close all child forms of the parent.
For Each ChildForm As Form In Me.MdiChildren
ChildForm.Close()
Next
End Sub

Private m_ChildFormNumber As Integer

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ExitToolStripMenuItem.Click
Dim res As Integer = MsgBox("Do You Really Want to logout The Application.?",
MsgBoxStyle.YesNo)
If res = DialogResult.No Then
ElseIf res = DialogResult.Yes Then
LoginForm1.Show()
Me.Hide()
End If
End Sub

Private Sub MDIParent1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
LoginForm1.Show()
End Sub

Private Sub ADDCustomerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ADDCustomerToolStripMenuItem.Click
Customer.Show()

End Sub

Private Sub EDITCustomerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles EDITCustomerToolStripMenuItem.Click
EditCustomer.Show()

End Sub

Private Sub MDIParent1_FormClosing(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Application.Exit()
End Sub

46
Private Sub ADDProductToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ADDProductToolStripMenuItem.Click
AddProduct.Show()

End Sub

Private Sub EDITProductToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles EDITProductToolStripMenuItem.Click
EditProduct.Show()

End Sub

Private Sub ADDDctorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ADDDctorToolStripMenuItem.Click
AddDoctor.Show()

End Sub

Private Sub EDITDoctorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles EDITDoctorToolStripMenuItem.Click
EditDoctor.Show()

End Sub

Private Sub SalesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles SalesToolStripMenuItem.Click
SaleForm.Show()

End Sub

Private Sub CustomerReportsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CustomerReportsToolStripMenuItem.Click

ALLDetails.Show()

End Sub

Private Sub ProductReportsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ProductReportsToolStripMenuItem.Click
ALLDetails.Show()

End Sub

Private Sub DoctorReportsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles DoctorReportsToolStripMenuItem.Click
ALLDetails.Show()

End Sub

Private Sub SalesReportsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles SalesReportsToolStripMenuItem.Click
SaleReport.Show()

47
End Sub
End Class

Add Customer:
Imports System.Data
Imports System.Data.OleDb
Public Class Customer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
If TextBox1.Text = "" Then TextBox1.Focus() : Exit Sub
If TextBox2.Text = "" Then TextBox2.Focus() : Exit Sub
If TextBox3.Text = "" Then TextBox3.Focus() : Exit Sub
If TextBox4.Text = "" Then TextBox4.Focus() : Exit Sub
If TextBox5.Text = "" Then TextBox5.Focus() : Exit Sub

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

MsgBox("Record saved successfully ", MsgBoxStyle.Information,


MsgBoxStyle.OkOnly)

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

Public Sub SearchID()


con.Close()
con.Open()
cmd = New OleDbCommand("Select MAX(CustomerID) from Customer", con)
Dim dr As OleDbDataReader
Try
dr = cmd.ExecuteReader()
While dr.Read
Dim CusID As String = dr.GetValue(0).ToString()
MessageBox.Show("Your Registration Done...!" & vbCrLf & "Your ID=" & CusID & "")

End While

Catch ex As Exception
MsgBox("Error", ex.Message)
Finally
con.Close()
End Try
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click
Me.Close()

End Sub
End Class

49
Edit Customer:
Imports System.Data.OleDb
Public Class EditCustomer

Private Sub EditCustomer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
con.Close()

CusID()
End Sub

Public Sub CusID()


ComboBox1.Items.Clear()
ds.Clear()
con.Close()

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

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ComboBox1.SelectedIndexChanged
con.Close()

con.Open()

cmd = New OleDbCommand(str, con)


If IsNumeric(ComboBox1.Text) Then
cmd.CommandText = "select * from Customer where CustomerID=@cid"
cmd.Prepare()
cmd.Parameters.AddWithValue("@cid", ComboBox1.Text)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Try
If dr.Read() Then
TextBox1.Text = dr.GetValue(1)
TextBox2.Text = dr.GetValue(2)
TextBox3.Text = dr.GetValue(3)
TextBox4.Text = dr.GetValue(4)
TextBox5.Text = dr.GetValue(5)
dr.Close()

End If

50
Catch ex As Exception
MsgBox("", ex.Message)
dr.Close()
Finally
con.Close()

End Try

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = ""
Or TextBox5.Text = "" Or ComboBox1.Text = "" Then
MsgBox("PLZ FIll the details")
Exit 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()

MsgBox("Record Updated successfully", MsgBoxStyle.Information, MsgBoxStyle.OkOnly)

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")

If msg = DialogResult.Yes Then

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()

Dim ctr As Integer


'cn.Open()
ComboBox1.Items.Clear()
ds.Clear()
str = "select * from Customer"
cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "Customer")
ctr = ds.Tables("Customer").Rows.Count - 1
For i = 0 To ctr
ComboBox1.Items.Add(ds.Tables("Customer").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()

52
End Sub

Private Sub EditCustomer_FormClosing(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing

ComboBox1.Items.Clear()
Me.Hide()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
Me.Close()

End Sub
End Class

Add Magazine:
Imports System.Data.OleDb
Imports System.Data
Public Class AddMagazins

Private Sub AddMagazins_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub
Public Sub clr()
TextBox1.Clear()
TextBox2.Text = ""
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
If TextBox1.Text = "" Then TextBox1.Focus() : Exit Sub
If TextBox2.Text = "" Then TextBox2.Focus() : Exit Sub
If TextBox3.Text = "" Then TextBox3.Focus() : Exit Sub
If TextBox4.Text = "" Then TextBox4.Focus() : Exit Sub
If TextBox5.Text = "" Then TextBox5.Focus() : Exit 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

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
If TextBox1.Text = "" Then TextBox1.Focus() : Exit Sub
If TextBox2.Text = "" Then TextBox2.Focus() : Exit Sub
If TextBox3.Text = "" Then TextBox3.Focus() : Exit Sub
If TextBox4.Text = "" Then TextBox4.Focus() : Exit Sub
If TextBox5.Text = "" Then TextBox5.Focus() : Exit Sub

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

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)

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

Public Class EditDoctor

Private Sub EditDoctor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
CusID()
End Sub

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

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ComboBox1.SelectedIndexChanged
con.Close()

con.Open()

cmd = New OleDbCommand(str, con)


If IsNumeric(ComboBox1.Text) Then
cmd.CommandText = "select * from Doctor where DoctorID=@did"
cmd.Prepare()
cmd.Parameters.AddWithValue("@did", ComboBox1.Text)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Try
If dr.Read() Then
TextBox1.Text = dr.GetValue(1)
TextBox2.Text = dr.GetValue(2)
TextBox3.Text = dr.GetValue(3)
TextBox4.Text = dr.GetValue(4)
TextBox5.Text = dr.GetValue(5)
dr.Close()

End If

Catch ex As Exception
MsgBox("", ex.Message)
dr.Close()
Finally
con.Close()

End Try

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = ""
Or TextBox5.Text = "" Or ComboBox1.Text = "" Then
MsgBox("PLZ FIll the details")

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()

MsgBox("Record Updated successfully", MsgBoxStyle.Information, MsgBoxStyle.OkOnly)

Catch ex As Exception
MsgBox("", ex.Message)
Finally
con.Close()

End Try

con.Close()

End Sub

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 Doctor :-'" & TextBox1.Text &
"' ?", MsgBoxStyle.YesNoCancel, "Delete Customer Record")

If msg = DialogResult.Yes Then

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()

Dim ctr As Integer


'cn.Open()

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

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
Me.Close()

End Sub
End Class

Add Product:
Imports System.Data.OleDb

Public Class AddProduct


Dim Lastno As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
con.Close()

If TextBox1.Text = "" Then TextBox1.Focus() : Exit Sub


If TextBox2.Text = "" Then TextBox2.Focus() : Exit Sub
If TextBox3.Text = "" Then TextBox3.Focus() : Exit Sub
If TextBox4.Text = "" Then TextBox4.Focus() : Exit Sub
If TextBox5.Text = "" Then TextBox5.Focus() : Exit Sub
If TextBox6.Text = "" Then TextBox5.Focus() : Exit Sub

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

MsgBox("Record saved successfully ", MsgBoxStyle.Information,


MsgBoxStyle.OkOnly)
Dim result As Integer = MessageBox.Show("New Product Added. Want To Add Another
One.", "Added", MessageBoxButtons.YesNo)

If result = DialogResult.Yes Then


clr()
con.Close()
con.Open()

str = "select * from Product"


cmd = New OleDbCommand(str, con)
da.SelectCommand = cmd
da.Fill(ds, "Product")
Lastno = ds.Tables("Product").Rows.Count + 1
If Lastno >= 0 Then
TextBox1.Text = "PID" & Lastno
Else
TextBox1.Text = "PID" & 0
TextBox2.Focus()

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

Private Sub AddProduct_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
con.Close()

con.Open()
str = "select * from Product"
cmd = New OleDbCommand(str, con)

59
da.SelectCommand = cmd
da.Fill(ds, "Product")

'for ProductID Number

Lastno = ds.Tables("Product").Rows.Count + 1

If Lastno >= 0 Then


TextBox1.Text = "PID" & Lastno
Else
TextBox1.Text = "PID" & 0
End If
End Sub

Public Sub clr()


ds.Clear()

TextBox1.Clear()
TextBox2.Text = ""
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
End Sub
End Class

60
Edit Product:
Imports System.Data.OleDb

Public Class EditProduct

Private Sub EditProduct_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
getdata()

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

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
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
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

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles TextBox1.TextChanged
clr()
getdata()
End Sub

Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick

'For DataGridView Cell Click

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

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click

'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

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
con.Close()

If TextBox2.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")

If msg = DialogResult.Yes Then


con.Open()

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

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button4.Click
clr()
Me.Close()

End Sub

Private Sub EditProduct_FormClosed(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
Me.Hide()

63
End Sub
End Class

Magazine Sale:
Imports System.Data
Imports System.Data.OleDb

Public Class MagazineSale

Dim Lastno As Integer


Public b, cn, np, t, d As String

Public Sub CusID()


ComboBox1.Items.Clear()
ds.Clear()
con.Close()

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()

cmd = New OleDbCommand(str, con)

If cmd.ExecuteNonQuery() > 0 Then


MsgBox("Record save")
cn = ComboBox1.Text
b = TextBox1.Text
np = ComboBox2.Text
t = TextBox6.Text
d = TextBox7.Text

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")

'for ProductID Number

Lastno = ds.Tables("MagazineSale").Rows.Count + 1

If Lastno >= 0 Then


TextBox1.Text = "Bill-" & Lastno
Else
TextBox1.Text = "Bill-" & 0
End If
con.Close()

End Sub

Private Sub MagazineSale_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
bill()

CusID()
magazinename()

End Sub

Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ComboBox2.SelectedIndexChanged
con.Close()

con.Open()

cmd = New OleDbCommand(str, con)


If Not IsNumeric(ComboBox1.Text) Then
cmd.CommandText = "select * from Magazine where Mname=@did"
cmd.Prepare()
cmd.Parameters.AddWithValue("@did", ComboBox2.Text)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Try
If dr.Read() Then
TextBox2.Text = dr.GetValue(1)
TextBox3.Text = dr.GetValue(2)
TextBox4.Text = dr.GetValue(3)
TextBox5.Text = dr.GetValue(4)

dr.Close()

End If

Catch ex As Exception
MsgBox("", ex.Message)

66
dr.Close()
Finally
con.Close()

End Try

End If
End Sub

Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ComboBox3.SelectedIndexChanged
Dim tot As Integer
tot = Val(TextBox3.Text) * Val(ComboBox3.Text)
TextBox6.Text = Convert.ToString(tot)
End Sub
End Class

67
Sales Report:
Imports System.Data
Imports System.Data.OleDb
Public Class SaleReport

Private Sub SaleReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
Dgv()
End Sub
Public Sub Dgv()
ds.Clear()
con.Close()
con.Open()
str = "Select * From tblSale"
Dim Adpt As New OleDbDataAdapter(str, con)
Adpt.Fill(ds, "tblSale")
DataGridView1.DataSource = ds.Tables(0)
con.Close()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
SaleReport2.Show()

End Sub
End Class

All Details:
Imports System.Data.OleDb
Imports System.Data

Public Class ALLDetails

Private Sub ALLDetails_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
ComboBox1.Visible = False
Button5.Visible = False

68
Label4.Visible = False
Label9.Visible = False
Label10.Visible = False

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
TextBox1.Text = ""
ComboBox1.Visible = False
Button5.Visible = False
Label4.Visible = False
Label9.Visible = True
Label10.Visible = True

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

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click
TextBox1.Text = ""
ComboBox1.Visible = False
Button5.Visible = False
Label4.Visible = False
Label9.Visible = True
Label10.Visible = True
Dgv2()
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)
con.Close()
sum()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
TextBox1.Text = ""

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

Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Label4.Visible = True
ComboBox1.Visible = True

End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Button5.Visible = True

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button5.Click
Label10.Visible = False
Label9.Visible = False

If ComboBox1.Text = "Customer" Then


search()
ElseIf ComboBox1.Text = "Doctor" Then
search2()
ElseIf ComboBox1.Text = "Product" Then
search3()
Else
MsgBox("Plz Select Table name form 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 + '%' "

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

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button4.Click
Me.Close()

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

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button3.Click
TextBox1.Text = ""
ComboBox1.Visible = False
Button5.Visible = False
Label4.Visible = False
'Label7.Visible = True
'Label8.Visible = True
Label9.Visible = True
Label10.Visible = True

Dgv()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button4.Click
TextBox1.Text = ""
ComboBox1.Visible = False
Button5.Visible = False
Label4.Visible = False
' Label7.Visible = True
'Label8.Visible = True
Label9.Visible = True
Label10.Visible = True
Dgv2()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button5.Click
Label7.Visible = False
Label8.Visible = False
Label9.Visible = False

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

Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
ComboBox1.Visible = True
Label4.Visible = True
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Button5.Visible = True
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button1.Click
TextBox1.Text = ""
ComboBox1.Visible = False
Button5.Visible = False
Label4.Visible = False
div3()
End Sub

End Class

75
10. Methodology used for testing:-

Unit Testing:-

Unit testing emphasizes the verification effort on the smallest unit of


software design i.e. a software component or module. Unit Testing is a dynamic method
for verification, where program is actually compiled and executed. Unit testing is
performed in parallel with the coding phase. Unit testing tests units or module not the
whole software.

White Box 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.

Black Box Testing:-

Black Box Testing is not a type of testing; it instead is a testing


strategy, which does not need any knowledge of internal design or code etc. As the name
"black box" suggests, no knowledge of internal logic or code structure is required. The
types of testing under this strategy are totally based/focused on the testing for
requirements and functionality of the work product/software application. Black box
testing is sometimes also called as "Opaque Testing", "Functional/Behavioral Testing"
and "Closed Box Testing".
76
The base of the Black box testing strategy lies in the selection of
appropriate data as per functionality and testing it against the functional specifications in
order to check for normal and abnormal behavior of the system. Now a days, it is
becoming common to route the Testing work to a third party as the developer of the
system knows too much of the internal logic and coding of the system, which makes it
unfit to test the application by the developer.

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:-

 Only Administrator able to access Database.


 Admin/user can only access Main menu. He/she cannot access Admin 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.

3. duplication is strictly prohibited.

4. This application have access any database


5. This application does not have any PDF file downloading with user administrator
requirement.

79
13.Bibliography:-

1. Beginning Visual Basic 2010 programming

2. Beginning VB.Net

3. Mastering in VB.NET (Black Book)

4. Mastering in ASP.NET 3.5 (Stephan feather)

5. www.google.com

80

You might also like