REAL ESTATE MANAGEMENT SYSTEM Report

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 58

Table of contents

Sr. No. Contents

1. About project
2. Modules and I/O forms
3. Hardware & Software specification
4. Table Structure
5. Data Flow Diagram
a. 0 level
b. 1st level
6. ER Diagram
7. About VB.net
8. About .net structure
9. About Microsoft Access
10. Conclusion
11. Coding
12. References
Minimum System Qualification for user

Hardware Requirements

PERSONAL COMPUTER with minimum following configuration


1. Microprocessor Intel Pentium IV
2. Primary Storage (RAM) 256MB
3. Secondary Storage (HDD) 40 GB
4. Visual Display Unit (Monitor) Color SVGA with 800X600
Revolution
5. 101 Key Enhanced Keyboard
6. Serial Mouse

Software Requirements

1. Operating System Windows XP


2. .Net Framework
3. MS Access
Minimum System Qualification for Developer

Hardware Requirements

PERSONAL COMPUTER with minimum following configuration


1. Microprocessor Intel Pentium IV
2. Primary Storage (RAM) 256MB
3. Secondary Storage (HDD) 40 GB
4. Visual Display Unit (Monitor) Color SVGA with 800X600
Revolution
5. 101 Key Enhanced Keyboard
6. Serial Mouse

Software Requirements

1. Operating System Windows XP Professional/2000/2003


2. MS Visual Studio.net 2005
3. MS Access (as a back end tool)
4. .Net Framework II
Table Structure

BOOKING_INFOMATION
CUSTOMER_INFORMATION
EMPLOYEE_INFORMATION
SALARY_INFORMATION
SALES INFORMATION
‘0’ LEVEL DATA FLOW DESIGN

INPUT/
REAL ESTATE
CUSTOMER REQUEST
MANAGEMEN RESPONSE
OUTPUT
T SYSTEM

RESPONSE
‘1’ LEVEL DATA FLOW DESIGN

CUSTOMER PASSWORD CORRECT REAL ESTATE


LOGIN PASSWORD MANAGEMEN
T SYSTEM

INVALID

INPUT/

OUTPUT
About vb.net
VISUAL BASIC is a high level programming language which evolved
from the earlier DOS version called BASIC. BASIC means Beginners'
All-purpose Symbolic Instruction Code. It is a very easy
programming language to learn. The code look a lot like English
Language. Different software companies produced different
versions of BASIC, such as Microsoft QBASIC, QUICKBASIC,
GWBASIC, IBM BASICA and so on. However, people prefer to use
Microsoft Visual Basic today, as it is a well developed programming
language and supporting resources are available everywhere. Now,
there are many versions of VB exist in the market, the most popular
one and still widely used by many VB programmers is none other
than Visual Basic 6. We also have VB.net, VB2005, VB2008 and the
latest VB2010. Both Vb2008 and VB2010 are fully object oriented
programming (OOP) language.

VISUAL BASIC is a VISUAL and  events driven Programming


Language. These are the main divergence from the old BASIC. In
BASIC, programming is done in a text-only environment and the
program is executed sequentially. In VB, programming is done in a
graphical environment. In the old BASIC, you have to write program
code for each graphical object you wish to display it on screen,
including its position and its color. However, In VB, you just need
to drag and drop any graphical object anywhere on the form, and
you can change its color any time using the properties windows.

On the other hand, because  the user may click on a certain object
randomly, so each object has to be programmed independently to
be able to response to those actions (events). Therefore, a VB
Program is made up of many subprograms, each has its own
program code, and each can be executed independently and at the
same time each can be linked together in one way or another.
The .net Framework
architecture

The .Net Framework is an inbuilt windows component that supports


Building and running the next generation of application xml web services.
The .Net Framework has been developed to cater to the following
objectives and Requirements:

 To provide a consistent object-oriented environment to develop


applications;
 To provide a code execution environment that simplifies
deployment and versioning;
 To provide a code execution that eliminates the issues faced by
scripted environments with respect to performance.
 To provide a common programming model where the choice of a
programming
 Language becomes a matter of choice.

     The .Net framework is made up of two components- Common


Language Runtime (CLR) and the .Net Framework Class Library (FCL).
The CLR is the basic for the .Net Framework and provides various services
that application can use. It also forms the environment that other
application run on.

     The runtime is supposed to be an agent that manages code at


execution time, providing core services, such as memory management,
thread management, and remoting. It also encourages security and
robustness by implementing safety and other type of code accuracy. Since
code management is a basic principal of the runtime is known as
unmanaged code. The .Net framework consists of web Forms, Windows
Forms and console applications the certain to the presentation layer of an
application.
 Web forms are used in web-based application whereas windows
forms are used in windows based application.
 You can create a character-based console application that can be
executed from the command line.
 .Net Framework consists of two other component the .Net
Framework Base classes the CLR.

The .NET Framework includes classes, interfaces, and value types


that expedite and optimize the development process and provide
access to system functionality. To facilitate interoperability
between languages, the .NET Framework types are CLS-compliant
and can therefore be used from any programming language whose
compiler conforms to the common language specification (CLS).

The .NET Framework types are the foundation on which .NET


applications, components, and controls are built. The .NET
Framework includes types that perform the following functions:

 Represent database types and exceptions.


 Encapsulate data structures.
 Perform I/O.
 Access information about loaded types.
 Invoke .NET Framework security checks.
 Provide data access, rich client-side GUI, and server-
controlled, client-side GUI.

The .NET Framework provides a rich set of interfaces, as well as


abstract and concrete (non-abstract) classes. You can use the
concrete classes as is or, in many cases, derive your own classes
from them. To use the functionality of an interface, you can either
create a class that implements the interface or derive a class from
one of the .NET Framework classes that implements the interface.
Common Language Runtime
(CLR)
The Common Language Runtime (CLR) is the engine behind
the .NET Framework that handles the execution of all managed
application code. It plays an intermediation role between the
operating system and .NET applications. Applications developed in
the .NET platform don’t directly interact with the operating system.
Rather, they talk to the CLR and the CLR manages/handles the
execution of the applications.

When we write a program using any of the .NET languages like C#,
VB or C++, the source code doesn’t get compiled to machine code.
Each language specific compiler (VB compiler, C# compiler etc)
converts the source code to an intermediate language code which is
known as IL code. The IL code then is converted to machine specific
code by the CLR engine at runtime.

The CLR is responsible for managing memory allocation, starting


and terminating threads and processes and enforcing security
policy at runtime.
Common Language Runtime (CLR)
Architecture
MS-ACCESS AS BACK END

Microsoft Access, often abbreviated "MS Access", is a popular


database application for Windows. Access allows users to create
custom databases that store information in an organized structure.
The program also provides a visual interface for creating custom
forms, tables, and SQL queries. Data can be entered into an Access
database using either visual forms or a basic spreadsheet interface.
The information stored within an Access database can be browsed,
searched, and accessed from other programs, including Web
services.

While Access is a proprietary database management system


(DBMS), it is compatible with other database programs since it
supports Open Database Connectivity (ODBC). This allows data to
be sent to and from other database programs, such as MS SQL,
FoxPro, File maker Pro, and Oracle databases. This compatibility
also enables Access to serve as the back end for database-driven
Applications. Infact, Microsoft Front Page and Expression Web, as
well as ASP.NET have built-in support for Access databases. For this
reason, Applications hosted on Microsoft Windows servers often
use Access databases for generating dynamic content.

FUNCTIONAL MODEL
The functional model shows how output values in a
computation are derived from input values, without regard for the
order in which the values are computed. The functional model
consists of multiple data flow diagrams, which show the flow from
external inputs, through operations and internal data stores, to
external outputs. The functional model also includes constraints
among values within an object model.

Data Flow Design (DFD)


A DFD is a graphical representation that depicts information
flow and the transforms that are applied as data move from input to
output. The DFD may be used to represent a system or software at
any level abstraction DFD’s may be partitioned into levels that
represent increasing information flow and functional details. The
DFD provides a mechanism for functional modeling as well as
information flow modeling.
A level “O” DFD, also called a fundamental system model or a
context model, represents the entire software element as single
bubble with input and output data indicated by incoming and
outgoing arrows respectively.
A level “1” DFD contains five or six bubbles with interconnecting
arrows. Each of the process represented at level 1 is sub function of
the overall system.
Similarly DFD level 1 can be refined into next level 2. The
information flow continuity has been maintained between each
level.
The refinement of DFD’s continue until each bubble performs
a simple function until the process represented by the bubble
perform a simple function until the process represented by the
bubble performs a function that would be easily implemented as a
program component.

The incremental Model


The incremental model combines the elements of the linear
sequential model with the iterative philosophy of prototyping. The
incremental model applies linear sequences in a staggered fashion
as calendar time progresses. Each linear sequence produces a
deliverable “increment” of the software.
When an incremental model is used, the first increment is
often a core product. That is, basic requirements are addressed, but
many supplementary features remain undelivered. The core
product used by the customer (or undergoes detailed review). As a
result of use and/or evaluation, plan is developed for the next
increment. The plan addressed the modification of the core product
to better meet the needs of the customer and the delivery of
additional features and functionality. This process is repeated
following the delivery of each increment, until the complete
product is produced.

Analysis Design Code Text

Analysis Design Code Text

Analysis Design Code Text

Analysis Design Code Text

The incremental Model


The incremental model, like prototype and other evolutionary
approaches, is iterative in nature. But unlike prototyping the
incremental model focuses on the delivery of and operational
product with each increment. Each increment is stripped down
versions of the final product, they do provide capability that serves
the user and also provides a platform for evaluation by the user.
Incremental development is particularly useful when staffing
is unavailable for a complete implementation by the business
deadline that has been established for the project. Early increments
can be implemented with fewer people. If the core product is well
received, then additional staff (if required) can be added to
implement the next increment. In addition, increments can be
planned to manage technical risk.
FORMS
BOOKING

CUSTOMER
EMPLOYEE
SALARY

SALES
CODING
BOOKING_INFO.VB
Imports System.Data.OleDb

Public Class Booking_info


Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\
anish\Royal Developers.mdb"

Dim sex As Boolean

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


System.EventArgs) Handles closebtn.Click
Me.Hide()
forminfo.Show()

End Sub

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


System.EventArgs) Handles nextbtn.Click
Me.Hide()
Sales_info.Show()

End Sub

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


System.EventArgs) Handles backbtn.Click
Me.Hide()
Customer_info.Show()

End Sub

Sub refresh_all()
bnotxt.Clear()
cntxt.Clear()
frntxt.Clear()
agetxt.Clear()
rbm.Checked = False
rbf.Checked = False
addtxt.Clear()
connotxt.Clear()
sitecombo.Text = ""
typecombo.Text = ""
totaltxt.Clear()
booktxt.Clear()
dtp.Value = Date.Today

End Sub
Private Sub addbtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles addbtn.Click
If rbm.Checked = True Then
sex = True
ElseIf rbf.Checked = True Then
sex = False
Else
MsgBox("Plz select Sex")

End If
ds.Reset()
da = New OleDbDataAdapter("insert into Booking_info values (" &
Val(bnotxt.Text) & ",'" & cntxt.Text & "','" & frntxt.Text & "','" & sex &
"','" & addtxt.Text & "'," & Val(connotxt.Text) & ",'" & sitecombo.Text &
"','" & typecombo.Text & "', " & Val(totaltxt.Text) & ", " &
Val(booktxt.Text) & ",# " & dtp.Value.Date & " #)", con)

da.Fill(ds)
MsgBox("Data Saved", MsgBoxStyle.Information)
Call refresh_all()

End Sub
Dim src_id As Short
Dim rc As Short
Dim ind As Short

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


System.EventArgs) Handles updatebtn.Click
If updatebtn.Text = "Update" Then
backbtn.Enabled = False
addbtn.Enabled = False
delbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False

src_id = Val(InputBox("search emp by id ", , 0))

ds.Reset()
da = New OleDbDataAdapter("select * from salary_info where
Emp_id=" & src_id, con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
bnotxt.Text = ds.Tables(0).Rows(ind)(0)
cntxt.Text = ds.Tables(0).Rows(ind)(1)
frntxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
connotxt.Text = ds.Tables(0).Rows(ind)(6)
sitecombo.Text = ds.Tables(0).Rows(ind)(7)
typecombo.Text = ds.Tables(0).Rows(ind)(8)
totaltxt.Text = ds.Tables(0).Rows(ind)(9)
booktxt.Text = ds.Tables(0).Rows(ind)(10)
dtp.Value = ds.Tables(0).Rows(ind)(11)
updatebtn.Text = "Save Data"
End If
ElseIf updatebtn.Text = "Save Data" Then
ds.Reset()

da = New OleDbDataAdapter("update Booking_info set Booking_no =


" & Val(bnotxt.Text) & ",Customer_name = '" & cntxt.Text & "',Fr_name = '"
& frntxt.Text & "',Age = " & Val(agetxt.Text) & ",Sex = " & (sex) &
",Address = '" & addtxt.Text & "',Contact_no = " & Val(connotxt.Text) &
",Nameof_site = '" & sitecombo.Text & "',Type = '" & typecombo.Text &
"',Total_amount = " & Val(totaltxt.Text) & ",Booking_amount = " &
Val(booktxt.Text) & ",Date = # " & dtp.Value.Date & " #)", con)

da.Fill(ds)
MsgBox("Record updated", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
delbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True

bnotxt.Clear()
cntxt.Clear()
frntxt.Clear()
agetxt.Clear()
rbm.Checked = False
rbf.Checked = False
addtxt.Clear()
connotxt.Clear()
sitecombo.Text = ""
typecombo.Text = ""
totaltxt.Clear()
booktxt.Clear()
dtp.Value = Date.Today

End If

End Sub

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


System.EventArgs) Handles delbtn.Click
If delbtn.Text = "Delete Data" Then
backbtn.Enabled = False
addbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False
updatebtn.Enabled = False
src_id = Val(InputBox("Booking by no ", , 0))
ds.Reset()
da = New OleDbDataAdapter("select * from Booking_info where
Booking_No=" & src_id, con)
da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
bnotxt.Text = ds.Tables(0).Rows(ind)(0)
cntxt.Text = ds.Tables(0).Rows(ind)(1)
frntxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
connotxt.Text = ds.Tables(0).Rows(ind)(6)
sitecombo.Text = ds.Tables(0).Rows(ind)(7)
typecombo.Text = ds.Tables(0).Rows(ind)(8)
totaltxt.Text = ds.Tables(0).Rows(ind)(9)
booktxt.Text = ds.Tables(0).Rows(ind)(10)
dtp.Value = ds.Tables(0).Rows(ind)(11)
delbtn.Text = "Delete"

End If
ElseIf delbtn.Text = "Delete" Then
ds.Reset()
da = New OleDbDataAdapter("delete from Booking_info where
Booking_No = " & src_id, con)
da.Fill(ds)
MsgBox("Record Deleted", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True
updatebtn.Enabled = True

bnotxt.Clear()
cntxt.Clear()
frntxt.Clear()
agetxt.Clear()
rbm.Checked = False
rbf.Checked = False
addtxt.Clear()
connotxt.Clear()
sitecombo.Text = ""
typecombo.Text = ""
totaltxt.Clear()
booktxt.Clear()
dtp.Value = Date.Today
delbtn.Text = "Delete Data"

End If
End Sub

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


System.EventArgs) Handles serbtn.Click
ind = ind + 1
If ind = 1 Then
serbbtn.Enabled = True
ElseIf ind = 0 Then
serbbtn.Enabled = False

End If
If ind = rc - 1 Then
serbtn.Enabled = False

End If
If ind <= rc - 1 Then
bnotxt.Text = ds.Tables(0).Rows(ind)(0)
cntxt.Text = ds.Tables(0).Rows(ind)(1)
frntxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
connotxt.Text = ds.Tables(0).Rows(ind)(6)
sitecombo.Text = ds.Tables(0).Rows(ind)(7)
typecombo.Text = ds.Tables(0).Rows(ind)(8)
totaltxt.Text = ds.Tables(0).Rows(ind)(9)
booktxt.Text = ds.Tables(0).Rows(ind)(10)
dtp.Value = ds.Tables(0).Rows(ind)(11)

End If
End Sub

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


System.EventArgs) Handles serfbtn.Click
ds.Reset()
da = New OleDbDataAdapter("select * from Booking_info", con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
serbtn.Visible = True
serbbtn.Visible = True
MsgBox("Record found", MsgBoxStyle.Information)
bnotxt.Text = ds.Tables(0).Rows(ind)(0)
cntxt.Text = ds.Tables(0).Rows(ind)(1)
frntxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
connotxt.Text = ds.Tables(0).Rows(ind)(6)
sitecombo.Text = ds.Tables(0).Rows(ind)(7)
typecombo.Text = ds.Tables(0).Rows(ind)(8)
totaltxt.Text = ds.Tables(0).Rows(ind)(9)
booktxt.Text = ds.Tables(0).Rows(ind)(10)
dtp.Value = ds.Tables(0).Rows(ind)(11)
End If

End Sub

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


System.EventArgs) Handles serbbtn.Click
ind = ind - 1
If ind > rc - 1 Then
Else
bnotxt.Text = ds.Tables(0).Rows(ind)(0)
cntxt.Text = ds.Tables(0).Rows(ind)(1)
frntxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
connotxt.Text = ds.Tables(0).Rows(ind)(6)
sitecombo.Text = ds.Tables(0).Rows(ind)(7)
typecombo.Text = ds.Tables(0).Rows(ind)(8)
totaltxt.Text = ds.Tables(0).Rows(ind)(9)
booktxt.Text = ds.Tables(0).Rows(ind)(10)
dtp.Value = ds.Tables(0).Rows(ind)(11)
End If
If ind = 0 Then
serbbtn.Enabled = False
End If
If ind = rc - 2 Then
serbtn.Enabled = True
End If

End Sub
End Class

CUSTOMER_INFO.VB
Imports System.Data.OleDb

Public Class Customer_info


Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\
anish\Royal Developers.mdb"

Dim sex As Boolean


Dim type As String

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


System.EventArgs) Handles closebtn.Click
Me.Hide()
forminfo.Show()

End Sub

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


System.EventArgs) Handles nextbtn.Click
Me.Hide()
Booking_info.Show()

End Sub

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


System.EventArgs) Handles backbtn.Click
Me.Hide()
Employees_info.Show()

End Sub
Sub refresh_all()
idtxt.Clear()
dtp.Value = Date.Today
nametxt.Clear()
frntxt.Clear()
rbm.Checked = False
rbf.Checked = False
agetxt.Clear()
addtxt.Clear()
citytxt.Clear()
connotxt.Clear()
etxt.Clear()
pcb.Checked = False
dcb.Checked = False
fhcb.Checked = False
amtxt.Clear()

End Sub
Private Sub addbtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles addbtn.Click
If rbm.Checked = True Then
sex = True
ElseIf rbf.Checked = True Then
sex = False
Else
MsgBox("Plz select Sex")

End If
If pcb.Checked = True Then
type = "Plot"
ElseIf dcb.Checked = True Then
type = "Duplex"
ElseIf fhcb.Checked = True Then
type = "Farm House"
End If

MsgBox("Plz select payment detail")


ds.Reset()
da = New OleDbDataAdapter("insert into Customer_info values (" &
Val(idtxt.Text) & ",# " & dtp.Value.Date & " #,'" & nametxt.Text & "','" &
frntxt.Text & "'," & (sex) & "," & Val(agetxt.Text) & ",'" & addtxt.Text &
"','" & citytxt.Text & "'," & Val(connotxt.Text) & ",'" & etxt.Text & "','"
& type & "'," & Val(amtxt.Text) & ")", con)
da.Fill(ds)
ds.Reset()

MsgBox("Data saved", MsgBoxStyle.Information)

Call refresh_all()

End Sub
Dim srch_id As Short
Dim rc As Short
Dim ind As Short

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


System.EventArgs) Handles updatebtn.Click
backbtn.Enabled = False
addbtn.Enabled = False
delbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False
srch_id = Val(InputBox("search Customer by id ", , 0))
ds.Reset()
da = New OleDbDataAdapter("select * from Customer_info where
idtxt=" & srch_id, con)
da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
idtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
nametxt.Text = ds.Tables(0).Rows(ind)(2)
frntxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
agetxt.Text = ds.Tables(0).Rows(ind)(5)
addtxt.Text = ds.Tables(0).Rows(ind)(6)
citytxt.Text = ds.Tables(0).Rows(ind)(7)
connotxt.Text = ds.Tables(0).Rows(ind)(8)
etxt.Text = ds.Tables(0).Rows(ind)(9)
GroupBox2.Text = ds.Tables(0).Rows(ind)(10)
amtxt.Text = ds.Tables(0).Rows(ind)(11)
updatebtn.Text = "Save Data"
End If

ElseIf updatebtn.Text = "Save Data" Then


ds.Reset()
da = New OleDbDataAdapter("Update Customer_info set Id = " &
Val(idtxt.Text) & ",Date = # " & dtp.Value.Date & " #,Name = '" &
nametxt.Text & "',Fr_name = '" & frntxt.Text & "',Sex = " & (sex) & ",Age =
" & Val(agetxt.Text) & ",Address = '" & addtxt.Text & "',City = '" &
citytxt.Text & "',Contact_no = " & Val(connotxt.Text) & ",Email = '" &
etxt.Text & "',Type = '" & type & "',Amount = " & Val(amtxt.Text) & ")",
con)
MsgBox("Record Updated", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
delbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True

idtxt.Clear()
nametxt.Clear()
frntxt.Clear()
rbm.Checked = False
rbf.Checked = False
agetxt.Clear()
addtxt.Clear()
citytxt.Clear()
connotxt.Clear()
etxt.Clear()
pcb.Checked = False
dcb.Checked = False
fhcb.Checked = False
amtxt.Clear()
dtp.Value = Date.Today
End If

End Sub

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


System.EventArgs) Handles delbtn.Click
If delbtn.Text = "Delete Data" Then
backbtn.Enabled = False
addbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False
updatebtn.Enabled = False

srch_id = Val(InputBox("search customer by id ", , 0))


ds.Reset()
da = New OleDbDataAdapter("select * from Customer_info where
Recript_no = " & srch_id, con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
idtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
nametxt.Text = ds.Tables(0).Rows(ind)(2)
frntxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
agetxt.Text = ds.Tables(0).Rows(ind)(5)
addtxt.Text = ds.Tables(0).Rows(ind)(6)
citytxt.Text = ds.Tables(0).Rows(ind)(7)
connotxt.Text = ds.Tables(0).Rows(ind)(8)
etxt.Text = ds.Tables(0).Rows(ind)(9)
GroupBox2.Text = ds.Tables(0).Rows(ind)(10)
amtxt.Text = ds.Tables(0).Rows(ind)(11)
delbtn.Text = "Delete"

End If

ElseIf delbtn.Text = "Delete" Then

ds.Reset()
da = New OleDbDataAdapter("delete from Customer_info where
idtxt= " & srch_id, con)

da.Fill(ds)
MsgBox("Record Deleted", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
updatebtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True

idtxt.Clear()
nametxt.Clear()
frntxt.Clear()
rbm.Checked = False
rbf.Checked = False
agetxt.Clear()
addtxt.Clear()
citytxt.Clear()
connotxt.Clear()
etxt.Clear()
pcb.Checked = False
dcb.Checked = False
fhcb.Checked = False
amtxt.Clear()
dtp.Value = Date.Today
End If

End Sub

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


System.EventArgs) Handles serbtn.Click
ind = ind + 1
If ind = 1 Then
serbbtn.Enabled = True
ElseIf ind = 0 Then
serbbtn.Enabled = False

End If
If ind = rc - 1 Then
serbtn.Enabled = False

End If
If ind <= rc - 1 Then
idtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
nametxt.Text = ds.Tables(0).Rows(ind)(2)
frntxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
agetxt.Text = ds.Tables(0).Rows(ind)(5)
addtxt.Text = ds.Tables(0).Rows(ind)(6)
citytxt.Text = ds.Tables(0).Rows(ind)(7)
connotxt.Text = ds.Tables(0).Rows(ind)(8)
etxt.Text = ds.Tables(0).Rows(ind)(9)
GroupBox2.Text = ds.Tables(0).Rows(ind)(10)
amtxt.Text = ds.Tables(0).Rows(ind)(11)

End If
End Sub

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


System.EventArgs) Handles serfbtn.Click
ds.Reset()
da = New OleDbDataAdapter("select * from sales_info", con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
serbtn.Visible = True
serbbtn.Visible = True
MsgBox("Record found", MsgBoxStyle.Information)
idtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
nametxt.Text = ds.Tables(0).Rows(ind)(2)
frntxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
agetxt.Text = ds.Tables(0).Rows(ind)(5)
addtxt.Text = ds.Tables(0).Rows(ind)(6)
citytxt.Text = ds.Tables(0).Rows(ind)(7)
connotxt.Text = ds.Tables(0).Rows(ind)(8)
etxt.Text = ds.Tables(0).Rows(ind)(9)
GroupBox2.Text = ds.Tables(0).Rows(ind)(10)
amtxt.Text = ds.Tables(0).Rows(ind)(11)
End If

End Sub

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


System.EventArgs) Handles serbbtn.Click
ind = ind - 1
If ind > rc - 1 Then
Else
idtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
nametxt.Text = ds.Tables(0).Rows(ind)(2)
frntxt.Text = ds.Tables(0).Rows(ind)(3)
GroupBox1.Text = ds.Tables(0).Rows(ind)(4)
agetxt.Text = ds.Tables(0).Rows(ind)(5)
addtxt.Text = ds.Tables(0).Rows(ind)(6)
citytxt.Text = ds.Tables(0).Rows(ind)(7)
connotxt.Text = ds.Tables(0).Rows(ind)(8)
etxt.Text = ds.Tables(0).Rows(ind)(9)
GroupBox2.Text = ds.Tables(0).Rows(ind)(10)
amtxt.Text = ds.Tables(0).Rows(ind)(11)

End If
If ind = 0 Then
serbbtn.Enabled = False
End If
If ind = rc - 2 Then
serbtn.Enabled = True
End If

End Sub
End Class

EMPLOYEE_INFO.VB
Imports System.Data.OleDb

Public Class Employees_info


Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\
anish\Royal Developers.mdb"

Dim sex As Boolean

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


System.EventArgs) Handles closebtn.Click
Me.Hide()
forminfo.Show()

End Sub

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


System.EventArgs) Handles nextbtn.Click
Me.Hide()
Customer_info.Show()

End Sub

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


System.EventArgs) Handles backbtn.Click
Me.Hide()
Salary_info.Show()

End Sub
Sub refresh_all()
eidtxt.clear()
dtp.value = Date.today
enametxt.clear()
frtxt.clear()
agetxt.clear()
mrbtn.checked = False
frbtn.checked = False
addtxt.clear()
contxt.clear()
emailtxt.clear()
End Sub
Private Sub addbtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles addbtn.Click

If mrbtn.Checked = True Then


sex = True
ElseIf frbtn.Checked = True Then
sex = False
Else
MsgBox("Plz select Gender")

End If

da = New OleDbDataAdapter("insert into Employees_info values (" &


Val(eidtxt.Text) & ",#" & dtp.Value.Date & "#,'" & enametxt.Text & "','" &
frtxt.Text & "'," & Val(agetxt.Text) & "," & (sex) & ",'" & addtxt.Text &
"'," & Val(contxt.Text) & ",'" & emailtxt.Text & "')", con)
da.Fill(ds)
MsgBox("Data Saved", MsgBoxStyle.Information)

Call refresh_all()

End Sub
Dim srch_id As Short
Dim rc As Short
Dim ind As Short

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


System.EventArgs) Handles updatebtn.Click
If updatebtn.Text = "Update" Then
backbtn.Enabled = False
addbtn.Enabled = False
delbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False

srch_id = Val(InputBox("search emp by id ", , 0))


ds.Reset()
da = New OleDbDataAdapter("select * from Employees_info where
eidtxt=" & srch_id, con)
da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
eidtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
frtxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
groupbox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
contxt.Text = ds.Tables(0).Rows(ind)(6)
emailtxt.Text = ds.Tables(0).Rows(ind)(7)
updatebtn.Text = "Save Data"
End If
ElseIf updatebtn.Text = "Save Data" Then
ds.Reset()
da = New OleDbDataAdapter("Update Employees_info set Emp_id = "
& Val(eidtxt.Text) & ",Date_hired = #" & dtp.Value.Date & "#,Emp_name ='" &
enametxt.Text & "',Fr_name = '" & frtxt.Text & "',Age = " &
Val(agetxt.Text) & ",Sex = " & (sex) & ",Address = '" & addtxt.Text &
"',Contact_no = " & Val(contxt.Text) & ",Email = '" & emailtxt.Text & "')",
con)
da.Fill(ds)
MsgBox("Record Updated", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
delbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True

eidtxt.Clear()
dtp.Value = Date.Today
enametxt.Clear()
frtxt.Clear()
agetxt.Clear()
mrbtn.Checked = False
frbtn.Checked = False
addtxt.Clear()
contxt.Clear()
emailtxt.Clear()
End If

End Sub

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


System.EventArgs) Handles delbtn.Click
If delbtn.Text = "Delete Data" Then
backbtn.Enabled = False
addbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False
updatebtn.Enabled = False

srch_id = Val(InputBox("search emp by id ", , 0))


ds.Reset()
da = New OleDbDataAdapter("select * from Employees_info where
Emp_id=" & srch_id, con)
da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
eidtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
frtxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
groupbox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
contxt.Text = ds.Tables(0).Rows(ind)(6)
emailtxt.Text = ds.Tables(0).Rows(ind)(7)
delbtn.Text = "Delete"
End If

ElseIf delbtn.Text = "Delete" Then

ds.Reset()
da = New OleDbDataAdapter("delete from salary_info where
Employee_id = " & srch_id, con)
da.Fill(ds)
MsgBox("Record Deleted", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True
updatebtn.Enabled = True

eidtxt.Clear()
dtp.Value = Date.Today
enametxt.Clear()
frtxt.Clear()
agetxt.Clear()
mrbtn.Checked = False
frbtn.Checked = False
addtxt.Clear()
contxt.Clear()
emailtxt.Clear()
delbtn.Text = "Delete Data"

End If

End Sub

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


System.EventArgs) Handles serbtn.Click
ind = ind + 1
If ind = 1 Then
serbbtn.Enabled = True
ElseIf ind = 0 Then
serbbtn.Enabled = False

End If
If ind = rc - 1 Then
serbtn.Enabled = False
End If
If ind <= rc - 1 Then
eidtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
frtxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
groupbox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
contxt.Text = ds.Tables(0).Rows(ind)(6)
emailtxt.Text = ds.Tables(0).Rows(ind)(7)
End If

End Sub

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


System.EventArgs) Handles serfbtn.Click
ds.Reset()
da = New OleDbDataAdapter("select * from salary_info", con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
serbtn.Visible = True
serbbtn.Visible = True
MsgBox("Record found", MsgBoxStyle.Information)
eidtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
frtxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
groupbox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
contxt.Text = ds.Tables(0).Rows(ind)(6)
emailtxt.Text = ds.Tables(0).Rows(ind)(7)
End If

End Sub

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


System.EventArgs) Handles serbbtn.Click
ind = ind - 1
If ind > rc - 1 Then
Else
eidtxt.Text = ds.Tables(0).Rows(ind)(0)
dtp.Value = ds.Tables(0).Rows(ind)(1)
frtxt.Text = ds.Tables(0).Rows(ind)(2)
agetxt.Text = ds.Tables(0).Rows(ind)(3)
groupbox1.Text = ds.Tables(0).Rows(ind)(4)
addtxt.Text = ds.Tables(0).Rows(ind)(5)
contxt.Text = ds.Tables(0).Rows(ind)(6)
emailtxt.Text = ds.Tables(0).Rows(ind)(7)

End If
If ind = 0 Then
serbbtn.Enabled = False
End If
If ind = rc - 2 Then
serbtn.Enabled = True
End If

End Sub
End Class

SALARY_INFO.VB
Imports System.Data.OleDb

Public Class Salary_info


Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\
anish\Royal Developers.mdb"
Dim pay As String

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


System.EventArgs) Handles closebtn.Click
Me.Hide()
forminfo.Show()

End Sub

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


System.EventArgs) Handles backbtn.Click
Me.Hide()
Sales_info.Show()
End Sub

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


System.EventArgs) Handles nextbtn.Click
Me.Hide()
Employees_info.Show()

End Sub
Sub refresh_all()
empidtxt.Clear()
empntxt.Clear()
postcombo.Text = ""
CheckBox1.Checked = False
CheckBox2.Checked = False

paymtxt.Clear()
End Sub
Private Sub addbtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles addbtn.Click
If CheckBox1.Checked = True Then
pay = "commision"
ElseIf CheckBox2.Checked = True Then
pay = "salary"
Else
MsgBox("Plz select payment detail")
End If

Try
da = New OleDbDataAdapter("insert into Salary_info values (" &
Val(empidtxt.Text) & ",'" & empntxt.Text & "','" & postcombo.Text & "','" &
pay & "'," & Val(paymtxt.Text) & ")", con)

da.Fill(ds)
ds.Reset()

MsgBox("Data saved", MsgBoxStyle.Information)

Call refresh_all()

Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub
Dim srch_id As Short
Dim rc As Short
Dim ind As Short

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


System.EventArgs) Handles updatebtn.Click
If updatebtn.Text = "Update" Then
backbtn.Enabled = False
addbtn.Enabled = False
delbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False

srch_id = Val(InputBox("search emp by id ", , 0))


ds.Reset()
da = New OleDbDataAdapter("select * from salary_info where
Emp_id=" & srch_id, con)
da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
empidtxt.Text = ds.Tables(0).Rows(ind)(0)
empntxt.Text = ds.Tables(0).Rows(ind)(1)
postcombo.Text = ds.Tables(0).Rows(ind)(2)
GroupBox1.Text = ds.Tables(0).Rows(ind)(3)
paymtxt.Text = ds.Tables(0).Rows(ind)(4)
updatebtn.Text = "Save Data"
End If
ElseIf updatebtn.Text = "Save Data" Then
ds.Reset()
da = New OleDbDataAdapter("update salary_info set Emp_name ='"
& empntxt.Text & "',post = '" & postcombo.Text & "',pay_details = '" & pay
& "',payment = val(paymtxt.text)", con)

MsgBox("Record Updated", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
delbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
closebtn.Enabled = True
empidtxt.Clear()
empntxt.Clear()
postcombo.Text = ""
CheckBox1.Checked = False
CheckBox2.Checked = False
paymtxt.Clear()
End If

End Sub

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


System.EventArgs) Handles delbtn.Click
If delbtn.Text = "Delete Data" Then
backbtn.Enabled = False
addbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False
updatebtn.Enabled = False

srch_id = Val(InputBox("search emp by id ", , 0))


ds.Reset()
da = New OleDbDataAdapter("select * from salary_info where
Emp_id=" & srch_id, con)
da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
empidtxt.Text = ds.Tables(0).Rows(ind)(0)
empntxt.Text = ds.Tables(0).Rows(ind)(1)
postcombo.Text = ds.Tables(0).Rows(ind)(2)
GroupBox1.Text = ds.Tables(0).Rows(ind)(3)
paymtxt.Text = ds.Tables(0).Rows(ind)(4)
delbtn.Text = "Delete"
End If
ElseIf delbtn.Text = "Delete" Then

ds.Reset()
da = New OleDbDataAdapter("delete from salary_info where
Employee_id = " & srch_id, con)
da.Fill(ds)
MsgBox("Record Deleted", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
closebtn.Enabled = True
empidtxt.Clear()
empntxt.Clear()
postcombo.Text = ""
CheckBox1.Checked = False
CheckBox2.Checked = False
paymtxt.Clear()
delbtn.Text = "Delete Data"
End If

End Sub

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


System.EventArgs) Handles serbtn.Click
ind = ind + 1
If ind = 1 Then
serbbtn.Enabled = True
ElseIf ind = 0 Then
serbbtn.Enabled = False

End If
If ind = rc - 1 Then
serbtn.Enabled = False

End If
If ind <= rc - 1 Then
empidtxt.Text = ds.Tables(0).Rows(ind)(0)
empntxt.Text = ds.Tables(0).Rows(ind)(1)
postcombo.Text = ds.Tables(0).Rows(ind)(2)
GroupBox1.Text = ds.Tables(0).Rows(ind)(3)
paymtxt.Text = ds.Tables(0).Rows(ind)(4)

End If
End Sub
Private Sub serfbtn_click()
ds.Reset()
da = New OleDbDataAdapter("select * from salary_info", con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
serbtn.Visible = True
serbbtn.Visible = True
MsgBox("Record found", MsgBoxStyle.Information)

empidtxt.Text = ds.Tables(0).Rows(ind)(0)
empntxt.Text = ds.Tables(0).Rows(ind)(1)
postcombo.Text = ds.Tables(0).Rows(ind)(2)
GroupBox1.Text = ds.Tables(0).Rows(ind)(3)
paymtxt.Text = ds.Tables(0).Rows(ind)(4)

End If
End Sub
Private Sub serbbtn_click()
ind = ind - 1
If ind > rc - 1 Then
Else
empidtxt.Text = ds.Tables(0).Rows(ind)(0)
empntxt.Text = ds.Tables(0).Rows(ind)(1)
postcombo.Text = ds.Tables(0).Rows(ind)(2)
GroupBox1.Text = ds.Tables(0).Rows(ind)(3)
paymtxt.Text = ds.Tables(0).Rows(ind)(4)

End If
If ind = 0 Then
serbbtn.Enabled = False
End If
If ind = rc - 2 Then
serbtn.Enabled = True

End If
End Sub
End Class

SALES_INFO.VB
Imports System.Data.OleDb

Public Class Sales_info


Dim da As New OleDbDataAdapter
Dim ds As New DataSet
Dim con As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\
anish\Royal Developers.mdb"

Dim pro As String

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


System.EventArgs) Handles closebtn.Click
Me.Hide()
forminfo.Show()

End Sub

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


System.EventArgs) Handles backbtn.Click
Me.Hide()
Booking_info.Show()

End Sub

Sub refresh_all()
rectxt.Clear()
proidtxt.Clear()
cntxt.Clear()
addtxt.Clear()
contxt.Clear()
emailtxt.Clear()
noscombo.Text = ""
ptxt.Checked = False
dtxt.Checked = False
ftxt.Checked = False
tatxt.Clear()
dtp.Value = Date.Today

End Sub
Private Sub addbtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles addbtn.Click
If ptxt.Checked = True Then
pro = "Plot"

ElseIf dtxt.Checked = True Then


pro = "Dopulex"

ElseIf ftxt.Checked = True Then


pro = "Frame House"

Else
MsgBox("Plz Select detaile")

End If
da = New OleDbDataAdapter(" insert into Sales_info values (# " &
dtp.Value.Date & " #," & Val(rectxt.Text) & "," & Val(proidtxt.Text) & ",'"
& cntxt.Text & "','" & addtxt.Text & "'," & Val(contxt.Text) & ",'" &
emailtxt.Text & "','" & noscombo.Text & "','" & pro & "'," &
Val(tatxt.Text) & ")", con)
da.Fill(ds)

MsgBox("Data Saved", MsgBoxStyle.Information)

Call refresh_all()

End Sub

Dim src_id As Short


Dim rc As Short
Dim ind As Short

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


System.EventArgs) Handles updatebtn.Click
If updatebtn.Text = "Update" Then
backbtn.Enabled = False
addbtn.Enabled = False
delbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False

src_id = Val(InputBox("search emp by id ", , 0))

ds.Reset()
da = New OleDbDataAdapter("select * from salary_info where
Emp_id=" & src_id, con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
rectxt = ds.Tables(0).Rows(ind)(0)
proidtxt.Text = ds.Tables(0).Rows(ind)(1)
cntxt.Text = ds.Tables(0).Rows(ind)(2)
addtxt = ds.Tables(0).Rows(ind)(3)
contxt.Text = ds.Tables(0).Rows(ind)(4)
emailtxt.Text = ds.Tables(0).Rows(ind)(5)
noscombo.Text = ds.Tables(0).Rows(ind)(6)
GroupBox1.Text = ds.Tables(0).Rows(ind)(7)
tatxt.Text = ds.Tables(0).Rows(ind)(8)
dtp.Value = ds.Tables(0).Rows(ind)(9)
updatebtn.Text = "Save Data"

End If

ElseIf updatebtn.Text = "Save Data" Then


ds.Reset()
da = New OleDbDataAdapter(" Update Sales_info set dtp = # " &
dtp.Value.Date & " #,Recipt_No = " & Val(rectxt.Text) & ",Product_id = " &
Val(proidtxt.Text) & ",Customer_name = '" & cntxt.Text & "',Address = '" &
addtxt.Text & "',Contact_No = " & contxt.Text & ",Email = '" &
emailtxt.Text & "',Nameof_site = '" & noscombo.Text & "',Type = '" & pro &
"',Total_amount = " & Val(tatxt.Text) & ")", con)
MsgBox("Record Updated", MsgBoxStyle.Information)

backbtn.Enabled = True
addbtn.Enabled = True
delbtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True

rectxt.Clear()
proidtxt.Clear()
cntxt.Clear()
addtxt.Clear()
contxt.Clear()
emailtxt.Clear()
noscombo.Text = ""
ptxt.Checked = False
dtxt.Checked = False
ftxt.Checked = False
tatxt.Clear()
dtp.Value = Date.Today

End If

End Sub

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


System.EventArgs) Handles delbtn.Click
If delbtn.Text = "Delete Data" Then
backbtn.Enabled = False
addbtn.Enabled = False
nextbtn.Enabled = False
serbtn.Enabled = False
serbbtn.Enabled = False
serfbtn.Enabled = False
closebtn.Enabled = False
updatebtn.Enabled = False

src_id = Val(InputBox("search emp by id ", , 0))


ds.Reset()
da = New OleDbDataAdapter("select * from sales_info where
Recript_no = " & src_id, con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
MsgBox("Records found", MsgBoxStyle.Information)
rectxt.Text = ds.Tables(0).Rows(ind)(0)
proidtxt.Text = ds.Tables(0).Rows(ind)(1)
cntxt.Text = ds.Tables(0).Rows(ind)(2)
addtxt.Text = ds.Tables(0).Rows(ind)(3)
contxt.Text = ds.Tables(0).Rows(ind)(4)
emailtxt.Text = ds.Tables(0).Rows(ind)(5)
noscombo.Text = ds.Tables(0).Rows(ind)(6)
GroupBox1.Text = ds.Tables(0).Rows(ind)(7)
tatxt.Text = ds.Tables(0).Rows(ind)(8)
dtp.Value = ds.Tables(0).Rows(ind)(9)
delbtn.Text = "Delete"

End If
ElseIf delbtn.Text = "Delete" Then

ds.Reset()
da = New OleDbDataAdapter("delete from sales_info where
Receipt_no = " & src_id, con)

da.Fill(ds)
MsgBox("Record Deleted", MsgBoxStyle.Information)
backbtn.Enabled = True
addbtn.Enabled = True
updatebtn.Enabled = True
nextbtn.Enabled = True
serbtn.Enabled = True
serbbtn.Enabled = True
serfbtn.Enabled = True
closebtn.Enabled = True

rectxt.Clear()
proidtxt.Clear()
cntxt.Clear()
addtxt.Clear()
contxt.Clear()
emailtxt.Clear()
noscombo.Text = ""
ptxt.Checked = False
dtxt.Checked = False
ftxt.Checked = False
tatxt.Clear()
dtp.Value = Date.Today
End If

End Sub

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


System.EventArgs) Handles serbtn.Click
ind = ind + 1
If ind = 1 Then
serbbtn.Enabled = True
ElseIf ind = 0 Then
serbbtn.Enabled = False

End If
If ind = rc - 1 Then
serbtn.Enabled = False

End If
If ind <= rc - 1 Then
rectxt.Text = ds.Tables(0).Rows(ind)(0)
proidtxt.Text = ds.Tables(0).Rows(ind)(1)
cntxt.Text = ds.Tables(0).Rows(ind)(2)
addtxt.Text = ds.Tables(0).Rows(ind)(3)
contxt.Text = ds.Tables(0).Rows(ind)(4)
emailtxt.Text = ds.Tables(0).Rows(ind)(5)
noscombo.Text = ds.Tables(0).Rows(ind)(6)
GroupBox1.Text = ds.Tables(0).Rows(ind)(7)
tatxt.Text = ds.Tables(0).Rows(ind)(8)
dtp.Value = ds.Tables(0).Rows(ind)(9)

End If
End Sub
Private Sub btnfbtn_click()
ds.Reset()
da = New OleDbDataAdapter("select * from sales_info", con)

da.Fill(ds)
rc = ds.Tables(0).Rows.Count
MsgBox(rc)
If rc = 0 Then
MsgBox("No records found", MsgBoxStyle.Critical)
Else
ind = 0
serbtn.Visible = True
serbbtn.Visible = True
MsgBox("Record found", MsgBoxStyle.Information)

rectxt.Text = ds.Tables(0).Rows(ind)(0)
proidtxt.Text = ds.Tables(0).Rows(ind)(1)
cntxt.Text = ds.Tables(0).Rows(ind)(2)
addtxt.Text = ds.Tables(0).Rows(ind)(3)
contxt.Text = ds.Tables(0).Rows(ind)(4)
emailtxt.Text = ds.Tables(0).Rows(ind)(5)
noscombo.Text = ds.Tables(0).Rows(ind)(6)
GroupBox1.Text = ds.Tables(0).Rows(ind)(7)
tatxt.Text = ds.Tables(0).Rows(ind)(8)
dtp.Value = ds.Tables(0).Rows(ind)(9)

End If
End Sub
Private Sub serbbtn_click()
ind = ind - 1
If ind > rc - 1 Then
Else
rectxt.Text = ds.Tables(0).Rows(ind)(0)
proidtxt.Text = ds.Tables(0).Rows(ind)(1)
cntxt.Text = ds.Tables(0).Rows(ind)(2)
addtxt.Text = ds.Tables(0).Rows(ind)(3)
contxt.Text = ds.Tables(0).Rows(ind)(4)
emailtxt.Text = ds.Tables(0).Rows(ind)(5)
noscombo.Text = ds.Tables(0).Rows(ind)(6)
GroupBox1.Text = ds.Tables(0).Rows(ind)(7)
tatxt.Text = ds.Tables(0).Rows(ind)(8)
dtp.Value = ds.Tables(0).Rows(ind)(9)
End If
If ind = 0 Then
serbbtn.Enabled = False
End If
If ind = rc - 2 Then
serbtn.Enabled = True

End If
End Sub
End Class

References
 Beginnig VB.net 2005
By Thearon Willis
 Black book
By Steven Hozner

You might also like