Sample Project Report for MCA Student

advertisement
CERTIFICATE
This is to certify that the project entitled “NEPRD” is developed and
submitted by Baljeet kaur(9205910448) in the partial fulfillment of requirement of
MCA for session 2009-2010 under the Vaishnoo Maa Computer Center, Patiala. This
project is bonafield record of work carried out by student during the course of MCA.
It is further certified that this project or part of this project has not been
submitted for the award of any other degree/diploma.
(Mr. Gurpreet Singh)
Manager,
Vaishnoo Maa Computers,
PTU Study Center,
Patiala-147001
Preface
As a part of the regulations for the grant of the (MCA), the Vashnoo Maa
Computer Center, Patiala requires all the students of PGDCA to submit project.
In the pursuance of the above requirements in the partial fulfillment of the
requirements of the MCA, we were allotted the project under the Supervision of Mr
Vipan Batta.
I have tried my best to make a good project report. Information in this
project is collected from various books, and with the help of the teachers.
I am also highly thankful to the teachers for providing me guidance through
out the project.
Submitted by:
Baljeet kaur
ACKNOWELDGEMENT
Punjab Technical University, jallandhar is a great education institute dedicated
to the pursuit of academic excellence and innovations of much college of districts of
Punjab state are affiliated to the privileges of this university. The university has
research teaching departments. There is a well stocked library, spacious auditorium,
centre, space, sports stadium, observatory, art museum and beautiful botanical
gardens.
The faculties of computer center of Punjab Technical University are of very
high quality. Central computer center of university have the best infrastructure in
terms of computer system. Computer center also maintains the website of university
"www.ptu.jal.org". Central computer center provides the best facilities to the
student. Its general labs remains open for the students from morning to evening
Teacher of the MCA department provide all kind of help to the students so
that the students may understand the technical aspects of the subject. There is a
library in computer center providing all necessary books to the student.
We are highly thankful to the teachers, officers and staff of computer Center.
Punjab Technical University, Jalandhar is providing a great opportunity
through MCA to students in different faculties to learn about computer.. We are
highly thankful of the University.
Baljeet kaur
INTRODUCTION
MEANING
OF
PROJECT
Before Starting the project we should fully know about the meaning of project.
There are seven letters in the word “PROJECT” each character has its own
technical meaning.
Planning
This deal with the idea at thinking and which are required for the
project.
Resource
The money problem will be solved and resources from which
collected.
Operating
The procedure from which the getting job is prepared in a systematic
way is known as operation.
Joint effort
This is directly proper to a operation output is made of several
person working sincerely is known as JOINT EFFORT.
Engineering
A well-educated engineer can do this work in a better way to find
out better result. Hence the project is as engineering function.
Co-operation
To make the project successfully, it is necessary for its success and
completion of project.
Technique
It must as it gives a better shape. It is not possible to complete the
project without technique.
The project is a system that gives the systematic way of planning and
working.
INTRODUCTION TO
PROJECT
.
.
Introduction to Project
About NAHAR Group of Companies
From 1949 when small hosiery factory was incorporated into a public
limited company, to the present day, constant upward growth has
symbolized the charter of a company called oswal woollen mills
limited.
Oswal woollen mills,established in 1949 surges ahead to establish it
self as a reputed industrial conglomerate with a wide ranging portfolio
from wool
combing,spinning,knitting,fabric,hosiery garments etc.
From starting out with 800 spindles to 25000 spindles today, from
simple hosiery items to high value – added items like designer
knitwear (monte carlo & canturbury).all these are no mean
achievements, and what made them possible in so short a time is
nothing but a miracle that combined brilliant market insight with
diversification.
With increasing capacity & demand for its products, oswal woollen
mills limited soon became a name to reckon with, both in the domestic
& international markets. Research & development also received
focused attention & today the company boasts of north india’s most
sophisticated
laboratory,
approved
by
the
international
wool
secretariat (iws)& is even authorized to act as a quality checking
center for other manufacturers.
For the domestic market the company launched ‘monte carlo’, the
first truly international range of designer knitwear followed by another
prestigious brand “canterbury”.
Later on an ultra modern lambs wool & angora spinning plant has been
set up, of which more than 50% manufacturer is for captive
consumption. The balance meets the requirements of other hosiery
knitwear exporters in india. This in turn means immense saving in
foreign exchange for india. Further a modernization cum balancing
program
has
been
introduced
to
upgrade
its
capacity
for
manufacturing garments & fabrics for various government & defense
departments.
The group has spinning capacity of 0.55 millions cotton spindles
25000 worsted spindles with turn over of $550 million inclusive of
export turnover of $175 million. The production fascility have been
awarded iso 9001:2000/iso14002 certification & okotex certification.
The markets of nahar group are cris crossed allover the globe. The
objective is meeting the buyers expectations with consistant quality
backed by r& d divisions equipped with latest equipment,cream of
highly qualified technocrats and adhering to timely schedules.
Today oswal woollen mills ltd. Is a company that owes its strength
in
the
market
and
solidity
to
foresight
of
Sh jawahar lal oswal,the professional inputs of
its
chairman
the board of
directors and able team of highly skilled managers oswal woollen
mills ltd is the flagship company of over us$ 550 millions nahar
group of companies.
INTRODUCTION
TO
.NET
Microsoft .NET Framework
The Microsoft .NET Framework is a computing model that make things easier for
application development for the distributed environment of the Internet. The .NET
Framework is an environment for building, deploying, and running Web Services and
other applications. The key components of the .NET Framework are the CLR and the
.NET Framework class library. The .NET Framework is a managed, type safe, multilanguage environment for application development and execution.
.NET Framework is a set of core technologies that facilitates:

Easier application development, deployment and maintenance by providing
rich tools, enhanced IDE, Better run time services etc.

Make information available anytime, anywhere and helps in developing better
distributed applications via Web Services, ADO.NET DataSets and complete
XML support.
With .NET, you can develop various types of applications as follows:

Windows Form based applications (Rich client applications).

Console based applications.

ASP.NET Web applications (Browser based applications).

Web services (Programmable application component that provides some
useful functionality, such as application logic, and is available to any number
of potentially incongruent systems through the use of Internet standards such
as XML and HTTP).

Component Libraries (Components which encapsulate some business logic).

Windows Custom Controls (Your own windows controls).

Web Custom Controls (Your own web controls).

Windows Services (Applications that run as services in the background).
Overall architecture of the .NET Framework:
What is ADO.NET?
ADO.NET is the new database technology of the .NET (Dot Net) platform, and it
builds on Microsoft ActiveX® Data Objects (ADO).
ADO is a language-neutral object model that is the keystone of Microsoft's Universal
Data Access strategy.
ADO.NET is an integral part of the .NET Compact Framework, providing access to
relational data, XML documents, and application data. ADO.NET supports a variety
of development needs. You can create database-client applications and middle-tier
business objects used by applications, tools, languages or Internet browsers.
ADO.NET defines DataSet and DataTable objects which are optimized for moving
disconnected sets of data across intranets and Internets, including through firewalls.
It also includes the traditional Connection and Command objects, as well as an
object called a DataReader that resembles a forward-only, read-only ADO recordset.
If you create a new application, your application requires some form of data access
most of the time.
ADO.NET provides data access services in the Microsoft .NET platform.
You can use ADO.NET to access data by using the new .NET Framework data
providers which are:

Data Provider for SQL Server (System.Data.SqlClient).

Data Provider for OLEDB (System.Data.OleDb).

Data Provider for ODBC (System.Data.Odbc).

Data Provider for Oracle (System.Data.OracleClient).
ADO.NET is a set of classes that expose data access services to the .NET developer.
The ADO.NET classes are found in System.Data.dll and are integrated with the XML
classes in System.Xml.dll.
There are two central components of ADO.NET classes: the DataSet, and the .NET
Framework Data Provider.
Data Provider is a set of components including:

the Connection object (SqlConnection, OleDbConnection, OdbcConnection,
OracleConnection)

the Command object (SqlCommand, OleDbCommand, OdbcCommand,
OracleCommand)

the
DataReader
object
(SqlDataReader,
OleDbDataReader,
OdbcDataReader, OracleDataReader)

and
the
DataAdapter
object
(SqlDataAdapter,
OleDbDataAdapter,
OdbcDataAdapter, OracleDataAdapter).
DataSet object represents a disconnected cache of data which is made up of
DataTables and DataRelations that represent the result of the command
Visual Basic .NET
is the next generation of the Visual Basic language from Microsoft. With Visual Basic
you can build .NET applications, including Web services and ASP.NET Web
applications, quickly and easily. Applications made with Visual Basic are built on the
services of the common language runtime and take advantage of the .NET
Framework.
Visual Basic has many new and improved features such as inheritance, interfaces,
and overloading that make it a powerful object-oriented programming language.
Other new language features include free threading and structured exception
handling. Visual Basic fully integrates the .NET Framework and the common
language runtime, which together provide language interoperability, garbage
collection, enhanced security, and improved versioning support. A Visual Basic
support single inheritance and creates Microsoft intermediate language (MSIL) as
input to native code compilers.
Visual Basic is comparatively easy to learn and use, and Visual Basic has become the
programming language of choice for hundreds of thousands of developers over the
past decade. An understanding of Visual Basic can be leveraged in a variety of ways,
such as writing macros in Visual Studio and providing programmability in applications
such as Microsoft Excel, Access, and Word.
Visual Basic provides prototypes of some common project types, including:
• Windows Application.
• Class Library.
• Windows Control Library.
• ASP.NET Web Application.
• ASP.NET Web Service.
• Web Control Library.
• Console Application.
• Windows Service.
• Windows Service.
SOFTWARE
&
HARDWARE
REQUIRMENTS
SOFTWARE & HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
1.
2.
3.
4.
Visual Studio .net 2008
SQL SERVER 2008
Corel Draw
Ms Office2003
HARDWARE REQUIREMENTS
1.
2.
3.
4.
Computer P-5
RAM 1GB
WINDOWS XP with SP2
HARDISK (80 GB)
SOURCE CODE
OF
PROJECT
SPLASH SCREEN OF NEPRD
SOURCE CODE SPLASH SCREEN
Public Class SPLASH
Private Sub SPLASH_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Activated
Timer1.Enabled = True
Timer1.Interval = 6000
Label2.Text = "Developed By : Jagdeep Singh (6120302026) ,
Gagandeep Ghuman ( 6120302034 )"
Label4.Text = " BABA BANDA SINGH BAHADUR ENGG COLLEGE ,
FATEHGARH SAHIB"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'WebBrowser1.Navigate("http://www.owmnahar.in")
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles
WebBrowser1.DocumentCompleted
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
Me.Hide()
PASSWORD.Show()
End Sub
End Class
SCREEN OF PASSWOR WINDOW
SOURCE CODE PASSWORD WINDOW
Public Class PASSWORD
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim ans = Choose(x, "123", "456")
If TextBox2.Text = ans Then
Me.Hide()
MASTER.Show()
Else
MsgBox("invalid password")
End
End If
End Sub
Private Sub PASSWORD_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Dim x As Integer
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectedIndexChanged
Select Case ComboBox1.SelectedIndex
Case 0
x = 1
Case 1
x = 2
End Select
End Sub
End Class
SCREEN OF MASTER MENU
SOURCE CODE MASTER MENU
Public Class MASTER
Private Sub ExitToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
End
End Sub
Private Sub EmployeeIDGeneratorToolStripMenuItem_Click(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles
EmployeeIDGeneratorToolStripMenuItem.Click
Form2.Show()
Form2.MdiParent = Me
Form2.Top = 104
Form2.Left = 80
End Sub
Private Sub PrintPaySlipToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
MsgBox("Printer Error - Printer Driver Not Installed")
End Sub
Private Sub XToolStripMenuItem5_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub StartToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
StartToolStripMenuItem.Click
End Sub
Private Sub AddEmployeeToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddEmployeeToolStripMenuItem.Click
empidcreator.Show()
empidcreator.MdiParent = Me
empidcreator.Top = 100
empidcreator.Left = 80
End Sub
Private Sub SearchToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SearchToolStripMenuItem.Click
showemp.Show()
showemp.MdiParent = Me
showemp.Top = 100
showemp.Left = 80
End Sub
Private Sub CreateSalaryfixToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CreateSalaryfixToolStripMenuItem.Click
Form1.Show()
Form1.MdiParent = Me
Form1.Top = 104
Form1.Left = 80
End Sub
Private Sub EMIChartToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EMIChartToolStripMenuItem.Click
Form3.Show()
Form3.MdiParent = Me
Form3.Top = 104
Form3.Left = 80
End Sub
Private Sub XToolStripMenuItem3_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
XToolStripMenuItem3.Click
End Sub
Private Sub ApplyToolStripMenuItem1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ApplyToolStripMenuItem1.Click
Form5.Show()
Form5.MdiParent = Me
Form5.Top = 104
Form5.Left = 80
End Sub
Private Sub XToolStripMenuItem7_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
XToolStripMenuItem7.Click
Form7.Show()
Form7.MdiParent = Me
Form7.Top = 104
Form7.Left = 80
End Sub
Private Sub DetailsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DetailsToolStripMenuItem.Click
advshow.Show()
advshow.MdiParent = Me
advshow.Top = 104
advshow.Left = 80
End Sub
Private Sub PToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles PToolStripMenuItem.Click
Form6.Show()
Form6.MdiParent = Me
Form6.Top = 104
Form6.Left = 10
End Sub
Private Sub XToolStripMenuItem6_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
XToolStripMenuItem6.Click
'MsgBox("Printer Not Installed")
sslip.Show()
sslip.MdiParent = Me
sslip.Top = 104
sslip.Left = 10
' Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub ApplyToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ApplyToolStripMenuItem.Click
Form8.Show()
Form8.MdiParent = Me
Form8.Top = 104
Form8.Left = 80
End Sub
Private Sub MASTER_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub LoanDetailToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
LoanDetailToolStripMenuItem.Click
Form9.Show()
Form9.MdiParent = Me
Form9.Top = 104
Form9.Left = 80
End Sub
Private Sub ITRCalculatorToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ITRCalculatorToolStripMenuItem.Click
System.Diagnostics.Process.Start("calc.exe")
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub FillForm2DToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
FillForm2DToolStripMenuItem.Click
Form10.Show()
Form10.MdiParent = Me
Form10.Top = 104
Form10.Left = 80
End Sub
End Sub
Private Sub AddEmployeeToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
AddEmployeeToolStripMenuItem.Click
empidcreator.Show()
empidcreator.MdiParent = Me
empidcreator.Top = 100
empidcreator.Left = 80
End Sub
Private Sub SearchToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SearchToolStripMenuItem.Click
showemp.Show()
showemp.MdiParent = Me
showemp.Top = 100
showemp.Left = 80
End Sub
Private Sub CreateSalaryfixToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CreateSalaryfixToolStripMenuItem.Click
Form1.Show()
Form1.MdiParent = Me
Form1.Top = 104
Form1.Left = 80
End Sub
Private Sub XToolStripMenuItem7_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles XToolStripMenuItem7.Click
Form7.Show()
Form7.MdiParent = Me
Form7.Top = 104
Form7.Left = 80
End Sub
Private Sub DetailsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DetailsToolStripMenuItem.Click
advshow.Show()
advshow.MdiParent = Me
advshow.Top = 104
advshow.Left = 80
End Sub
Private Sub PToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles PToolStripMenuItem.Click
Form6.Show()
Form6.MdiParent = Me
Form6.Top = 104
Form6.Left = 10
End Sub
Private Sub XToolStripMenuItem6_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
XToolStripMenuItem6.Click
'MsgBox("Printer Not Installed")
sslip.Show()
sslip.MdiParent = Me
sslip.Top = 104
sslip.Left = 10
' Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub ApplyToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ApplyToolStripMenuItem.Click
Form8.Show()
Form8.MdiParent = Me
Form8.Top = 104
Form8.Left = 80
End Sub
Private Sub MASTER_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub LoanDetailToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
LoanDetailToolStripMenuItem.Click
Form9.Show()
Form9.MdiParent = Me
Form9.Top = 104
Form9.Left = 80
End Sub
Private Sub ITRCalculatorToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ITRCalculatorToolStripMenuItem.Click
System.Diagnostics.Process.Start("calc.exe")
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub FillForm2DToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
FillForm2DToolStripMenuItem.Click
Form10.Show()
Form10.MdiParent = Me
Private Sub EMIChartToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
EMIChartToolStripMenuItem.Click
Form3.Show()
Form3.MdiParent = Me
Form3.Top = 104
Form3.Left = 80
End Sub
Private Sub XToolStripMenuItem3_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
XToolStripMenuItem3.Click
End Sub
Private Sub ApplyToolStripMenuItem1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ApplyToolStripMenuItem1.Click
Form5.Show()
Form5.MdiParent = Me
Form5.Top = 104
Form5.Left = 80
End Sub
Private Sub XToolStripMenuItem7_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
XToolStripMenuItem7.Click
Form7.Show()
Form7.MdiParent = Me
Form7.Top = 104
Form7.Left = 80
End Sub
Private Sub DetailsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DetailsToolStripMenuItem.Click
advshow.Show()
advshow.MdiParent = Me
advshow.Top = 104
advshow.Left = 80
End Sub
Private Sub PToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles PToolStripMenuItem.Click
SOURCE CODE OF SETUP MENU
Imports System.Data
Imports System.Data.SqlClient
Public Class empidcreator
Private Sub Label7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label7.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Hide()
MASTER.Show()
End Sub
Private Sub empidcreator_Activated(ByVal sender As Object, ByVal e
As System.EventArgs) Handles Me.Activated
ct()
TextBox1.Focus()
End Sub
Sub ct()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = "No"
End Sub
Private Sub empidcreator_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim q As String
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim x As Integer
x = CInt(TextBox6.Text)
q = "insert into empdata values('" + TextBox1.Text + "','"
+ TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','"
+ TextBox5.Text + "'," + x.ToString + ",'" + TextBox7.Text + "','" +
TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text + "','"
+ TextBox11.Text + "')"
Dim con As New SqlConnection(cs)
con.Open()
Dim cmd As New SqlCommand(q, con)
cmd.ExecuteNonQuery()
con.Close()
Label12.Text = "Record Inserted"
Catch ex As Exception
Label12.Text = ex.Message.ToString
End Try
ct()
End Sub
End Class
SOURCE CODE OF EMP SEARCH
Imports System.Data
Imports System.Data.SqlClient
Public Class showemp
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from empdata where empcode='" +
TextBox1.Text.Trim() + "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label2.Text = "No Record Search"
Else
Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
End Sub
Private Sub showemp_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick
End Sub
End Class
SOURCE CODE ADD NEW EMPLOYEE FOR CREATE SALARY
Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectedIndexChanged
On Error Resume Next
Select Case ComboBox1.SelectedIndex
Case 0
TextBox5.Text = TextBox4.Text + (Val(TextBox4.Text) *
96 / 100)
Label7.Text = "Basic Pay " + TextBox4.Text + " -" &
TextBox5.Text
'----------TextBox6.Text = Val(TextBox5.Text) * 14 / 100
TextBox7.Text = Val(TextBox5.Text) * 7 / 100
TextBox8.Text = Val(TextBox5.Text) * 10 / 100
TextBox9.Text = Val(TextBox5.Text) * 7 / 100
TextBox10.Text = Val(TextBox5.Text) * 5 / 100
TextBox18.Text = Val(TextBox5.Text) +
Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) +
Val(TextBox9.Text) + Val(TextBox10.Text)
TextBox15.Text = Math.Round(Val(TextBox18.Text) * 20 /
100)
TextBox14.Text = Math.Round(Val(TextBox18.Text) Val(TextBox15.Text))
TextBox12.Text = Math.Round(Val(TextBox14.Text) / 30)
TextBox11.Text = Math.Round(Val(TextBox12.Text) / 10)
TextBox16.Text = TextBox12.Text
TextBox13.Text = Val(TextBox11.Text) * 1.5
'------------Case 1
TextBox5.Text = TextBox4.Text + (Val(TextBox4.Text) *
76 / 100)
Label7.Text = "Basic Pay " + TextBox4.Text + " -" &
TextBox5.Text
'----------TextBox6.Text = Val(TextBox5.Text) * 14 / 100
TextBox7.Text = Val(TextBox5.Text) * 7 / 100
TextBox8.Text = Val(TextBox5.Text) * 10 / 100
TextBox9.Text = Val(TextBox5.Text) * 7 / 100
TextBox10.Text = Val(TextBox5.Text) * 5 / 100
TextBox18.Text = Val(TextBox5.Text) +
Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) +
Val(TextBox9.Text) + Val(TextBox10.Text)
TextBox15.Text = Math.Round(Val(TextBox18.Text) * 20 /
100)
TextBox14.Text = Math.Round(Val(TextBox18.Text) Val(TextBox15.Text))
TextBox12.Text = Math.Round(Val(TextBox14.Text) / 30)
TextBox11.Text = Math.Round(Val(TextBox12.Text) / 10)
TextBox16.Text = TextBox12.Text
TextBox13.Text = Val(TextBox11.Text) * 1.5
'------------Case 2
TextBox5.Text = TextBox4.Text + (Val(TextBox4.Text) *
36 / 100)
Label7.Text = "Basic Pay " + TextBox4.Text + " -" &
TextBox5.Text
'----------TextBox6.Text = Val(TextBox5.Text) * 14 / 100
TextBox7.Text = Val(TextBox5.Text) * 7 / 100
TextBox8.Text = Val(TextBox5.Text) * 10 / 100
TextBox9.Text = Val(TextBox5.Text) * 7 / 100
TextBox10.Text = Val(TextBox5.Text) * 5 / 100
TextBox18.Text = Val(TextBox5.Text) +
Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) +
Val(TextBox9.Text) + Val(TextBox10.Text)
TextBox15.Text = Math.Round(Val(TextBox18.Text) * 20 /
100)
TextBox14.Text = Math.Round(Val(TextBox18.Text) Val(TextBox15.Text))
TextBox12.Text = Math.Round(Val(TextBox14.Text) / 30)
TextBox11.Text = Math.Round(Val(TextBox12.Text) / 10)
TextBox16.Text = TextBox12.Text
TextBox13.Text = Val(TextBox11.Text) * 1.5
TextBox6.Text = Val(TextBox5.Text) * 14 / 100
TextBox7.Text = Val(TextBox5.Text) * 7 / 100
TextBox8.Text = Val(TextBox5.Text) * 10 / 100
TextBox9.Text = Val(TextBox5.Text) * 7 / 100
TextBox10.Text = Val(TextBox5.Text) * 5 / 100
TextBox18.Text = Val(TextBox5.Text) +
Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) +
Val(TextBox9.Text) + Val(TextBox10.Text)
TextBox15.Text = Math.Round(Val(TextBox18.Text) * 20 /
100)
TextBox14.Text = Math.Round(Val(TextBox18.Text) Val(TextBox15.Text))
TextBox12.Text = Math.Round(Val(TextBox14.Text) / 30)
TextBox11.Text = Math.Round(Val(TextBox12.Text) / 10)
TextBox16.Text = TextBox12.Text
TextBox13.Text = Val(TextBox11.Text) * 1.5
'------------Case 3
TextBox5.Text = TextBox4.Text + (Val(TextBox4.Text) *
16 / 100)
Label7.Text = "Basic Pay " + TextBox4.Text + " -" &
TextBox5.Text
'----------TextBox6.Text = Val(TextBox5.Text) * 14 / 100
TextBox7.Text = Val(TextBox5.Text) * 7 / 100
TextBox8.Text = Val(TextBox5.Text) * 10 / 100
TextBox9.Text = Val(TextBox5.Text) * 7 / 100
TextBox10.Text = Val(TextBox5.Text) * 5 / 100
TextBox18.Text = Val(TextBox5.Text) +
Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) +
Val(TextBox9.Text) + Val(TextBox10.Text)
TextBox15.Text = Math.Round(Val(TextBox18.Text) * 20 /
100)
TextBox14.Text = Math.Round(Val(TextBox18.Text) Val(TextBox15.Text))
TextBox12.Text = Math.Round(Val(TextBox14.Text) / 30)
TextBox11.Text = Math.Round(Val(TextBox12.Text) / 10)
TextBox16.Text = TextBox12.Text
TextBox13.Text = Val(TextBox11.Text) * 1.5
TextBox6.Text = Val(TextBox5.Text) * 14 / 100
TextBox7.Text = Val(TextBox5.Text) * 7 / 100
TextBox8.Text = Val(TextBox5.Text) * 10 / 100
TextBox9.Text = Val(TextBox5.Text) * 7 / 100
TextBox10.Text = Val(TextBox5.Text) * 5 / 100
TextBox18.Text = Val(TextBox5.Text) +
Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) +
Val(TextBox9.Text) + Val(TextBox10.Text)
TextBox15.Text = Math.Round(Val(TextBox18.Text) * 20 /
100)
TextBox14.Text = Math.Round(Val(TextBox18.Text) Val(TextBox15.Text))
TextBox12.Text = Math.Round(Val(TextBox14.Text) / 30)
TextBox11.Text = Math.Round(Val(TextBox12.Text) / 10)
TextBox16.Text = TextBox12.Text
TextBox13.Text = Val(TextBox11.Text) * 1.5
'------------End Select
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from empdata where empcode='" +
TextBox1.Text.Trim() + "'and sset='no'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
TextBox2.Text = ds.Tables(0).Rows(0)(1).ToString
TextBox3.Text = ds.Tables(0).Rows(0)(2).ToString
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label9.Text = "No Record Search or Salary Set only one
time"
Else
'Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
Catch
MsgBox("Your Pay Scale is all ready Fix ,Thanks" +
System.Environment.NewLine + " Or" + System.Environment.NewLine + "No
Record Search")
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "insert into pdriver values('" + TextBox1.Text + "','"
+ TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','"
+ TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','"
+ TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text +
"','" + TextBox11.Text + "','" + TextBox12.Text + "','" +
TextBox14.Text + "','" + TextBox13.Text + "','" + TextBox16.Text +
"','" + TextBox15.Text + "','" + TextBox18.Text + "')"
Dim con As New SqlConnection(cs)
con.Open()
Dim cmd As New SqlCommand(q, con)
cmd.ExecuteNonQuery()
con.Close()
'------------update -----------------Dim xcs As String
xcs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim xq As String
xq = "update empdata set sset='yes' where empcode='" +
TextBox1.Text + "'"
Dim xcon As New SqlConnection(xcs)
xcon.Open()
Dim xcmd As New SqlCommand(xq, xcon)
xcmd.ExecuteNonQuery()
xcon.Close()
'--------------------------------------ct()
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Hide()
MASTER.Show()
End Sub
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Activated
Dim xcon As New SqlConnection(xcs)
xcon.Open()
Dim xcmd As New SqlCommand(xq, xcon)
xcmd.ExecuteNonQuery()
xcon.Close()
'--------------------------------------ct()
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Sub ct()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
TextBox14.Text = ""
TextBox15.Text = ""
TextBox16.Text = ""
TextBox18.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
End Sub
End Class
SOURCE CODE EMP SALARY DETAILS
Imports System.Data
Imports System.Data.SqlClient
Public Class Form6
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from PDRIVER where empid='" +
TextBox1.Text.Trim() + "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label2.Text = "No Record Search"
Else
Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles PictureBox1.Click
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label2.Click
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label1.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick
End Sub
End Class
SOURCE CODE ITR RETURN PROGRAM
Imports System.Data
Imports System.Data.SqlClient
Public Class Form10
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from SALARY where empid='" +
TextBox1.Text.Trim() + "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
TextBox2.Text = ds.Tables(0).Rows(0)(1).ToString
TextBox3.Text = ds.Tables(0).Rows(0)(2).ToString
Dim TP As Integer
For TP = 0 To ds.Tables(0).Rows.Count - 1
TextBox5.Text = Val(TextBox5.Text) +
Val(ds.Tables(0).Rows(0)(19))
TextBox7.Text = Val(TextBox7.Text) +
Val(ds.Tables(0).Rows(0)(18))
Next
TextBox4.Text = Val(TextBox5.Text) - Val(TextBox6.Text)
TextBox10.Text = Val(TextBox4.Text) * 10 / 100
TextBox9.Text = Val(TextBox10.Text) - (Val(TextBox7.Text) +
Val(TextBox8.Text))
If Val(TextBox9.Text) <= 0 Then
Label13.Text = "NIL"
Else
Label13.Text = TextBox9.Text + " Rs"
End If
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label7.Text = "No Record Search"
Else
'Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
Catch
MsgBox("No EMP ID FOUND")
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
End Sub
Private Sub TextBox9_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox9.TextChanged
End Sub
Private Sub Form10_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
SOURCE CODE ADVANCE SALARY
Imports System.Data
Imports System.Data.SqlClient
Public Class Form5
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from pdriver where empid='" +
TextBox1.Text.Trim() + "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
TextBox2.Text = ds.Tables(0).Rows(0)(1).ToString
TextBox3.Text = ds.Tables(0).Rows(0)(2).ToString
TextBox5.Text = ds.Tables(0).Rows(0)(4).ToString
TextBox6.Text = Val(TextBox5.Text) * 75 / 100
TextBox4.Focus()
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label7.Text = "No Record Search"
Else
'Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
Catch
MsgBox("No EMP ID FOUND")
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
'TEST ADVANCE ALLREADY TAKEN OR NOT
If Val(TextBox4.Text) > Val(TextBox6.Text) Then
MsgBox("Maximum limit of advance is " + TextBox6.Text)
TextBox4.Text = ""
TextBox4.Focus()
Else
'ADD ADVANCE DETAIL IS DATABASE
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
Dim MM As String
MM = System.DateTime.Now.Date
q = "insert into ADVSAL values('" + TextBox1.Text +
"','" + TextBox2.Text + "','" + TextBox4.Text + "','" + MM.ToString() +
"','YES')"
Dim con As New SqlConnection(cs)
con.Open()
Dim cmd As New SqlCommand(q, con)
cmd.ExecuteNonQuery()
con.Close()
Label8.Text = "Please pay advance Amount in this month
salary ,thanks"
Catch ee As Exception
Label8.Text = "No Advance Pass Because your all ready
taken advance this month"
If Val(TextBox4.Text) > Val(TextBox6.Text) Then
MsgBox("Maximum limit of advance is " + TextBox6.Text)
TextBox4.Text = ""
TextBox4.Focus()
Else
'ADD ADVANCE DETAIL IS DATABASE
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
Dim MM As String
MM = System.DateTime.Now.Date
q = "insert into ADVSAL values('" + TextBox1.Text +
"','" + TextBox2.Text + "','" + TextBox4.Text + "','" + MM.ToString() +
"','YES')"
End Try
End If
End Sub
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
SOURCE CODE ADVANCE SALARY SHOW
Imports System.Data
Imports System.Data.SqlClient
Public Class advshow
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from advsal where empid='" + TextBox1.Text.Trim()
+ "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label2.Text = "No Record Search"
Else
Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
End Sub
Private Sub advshow_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Activated
TextBox1.Text = ""
TextBox1.Focus()
End Sub
Private Sub advshow_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
SOURCE CODE LOAN MASTER
Imports System.Data
Imports System.Data.SqlClient
Public Class Form8
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from pdriver where empid='" +
TextBox1.Text.Trim() + "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
TextBox2.Text = ds.Tables(0).Rows(0)(1).ToString
TextBox3.Text = ds.Tables(0).Rows(0)(2).ToString
TextBox5.Text = ds.Tables(0).Rows(0)(4).ToString
TextBox6.Text = Val(TextBox5.Text) * 20
TextBox4.Focus()
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label7.Text = "No Record Search"
Else
'Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
Catch
MsgBox("No EMP ID FOUND")
End Try
End Sub
Private Sub TextBox4_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox4.LostFocus
TextBox7.Text = CInt(Val(TextBox4.Text) / 12 +
(Val(TextBox4.Text) * 1) / 100)
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox4.TextChanged
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
'ADD ADVANCE DETAIL IS DATABASE
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
Dim MM As String
MM = System.DateTime.Now.Date
q = "insert into loan values('" + TextBox1.Text + "','" +
TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox5.Text + "','" +
TextBox6.Text + "','" + TextBox4.Text + "','" + TextBox7.Text + "','" +
MM.ToString() + "','YES')"
Dim con As New SqlConnection(cs)
con.Open()
Dim cmd As New SqlCommand(q, con)
cmd.ExecuteNonQuery()
con.Close()
Label8.Text = "Loan Section"
Catch ee As Exception
Label8.Text = ee.Message
End Try
End Sub
Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
SOURCE CODE LOAN EMI
Public Class Form3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim p As Integer
Dim emi As Integer
Dim tot As Integer
Dim amt As Integer
amt = 5000
emi = amt / 12 + (amt * 1) / 100
For p = 1 To 12
Dim x As New ListViewItem(p)
x.SubItems.Add(amt)
x.SubItems.Add(CInt(amt / 12).ToString + " + " + (amt * 1 /
100).ToString)
x.SubItems.Add(emi)
ListView1.Items.Add(x)
tot = tot + emi
If p >= 12 Then
Dim xx As New ListViewItem("Total Pay")
xx.SubItems.Add("")
xx.SubItems.Add("")
xx.SubItems.Add(tot)
ListView1.Items.Add(xx)
End If
Next
End Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ListView1.Columns.Add("Emi.No", 60)
ListView1.Columns.Add("Amount", 70)
ListView1.Columns.Add("Amt + Int(1%) ", 100)
ListView1.Columns.Add("E.M.I", 70)
End Sub
End Class
SOUCR CODE SALARY CREATOR
Imports System.Data
Imports System.Data.SqlClient
Public Class Form2
Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label10.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from pdriver where empid='" +
TextBox1.Text.Trim() + "'"
Dim da As New SqlDataAdapter(q, cs)
da.Fill(ds)
TextBox4.Text = ds.Tables(0).Rows(0)(1).ToString
TextBox5.Text = ds.Tables(0).Rows(0)(2).ToString
a = DateTime.Now.ToString("MMMM")
b = ds.Tables(0).Rows(0)(3).ToString
c = ds.Tables(0).Rows(0)(4).ToString
d = ds.Tables(0).Rows(0)(5).ToString
ee = ds.Tables(0).Rows(0)(6).ToString
f = ds.Tables(0).Rows(0)(7).ToString
g = ds.Tables(0).Rows(0)(8).ToString
h = ds.Tables(0).Rows(0)(9).ToString
adv()
loa()
TextBox6.Focus()
Catch
MsgBox("Your Pay
is all ready generated ,Thanks" +
System.Environment.NewLine + " Or" + System.Environment.NewLine + "No
Record Search")
End Try
End Sub
Sub adv()
On Error Resume Next
Dim ccs As String
ccs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim cq As String
cq = "select * from advsal where empid='" +
TextBox1.Text.Trim() + "'"
Dim cda As New SqlDataAdapter(cq, ccs)
Dim cds As New DataSet
cda.Fill(cds)
TextBox2.Text = cds.Tables(0).Rows(0)(2)
If Err.Number = 0 Then
Else
MsgBox(Err.Description)
End If
End Sub
Sub loa()
On Error Resume Next
Dim ccs As String
ccs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim cq As String
cq = "select * from loan where empid='" + TextBox1.Text.Trim()
+ "'"
Dim cda As New SqlDataAdapter(cq, ccs)
Dim cds As New DataSet
cda.Fill(cds)
TextBox3.Text = cds.Tables(0).Rows(0)(6)
If Err.Number = 0 Then
Else
MsgBox(Err.Description)
End If
End Sub
Sub ct()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
End Sub
Dim ds As New DataSet
Dim a, b, c, d, ee, f, g, h
Dim PH, MH, SL, PL, ML, AD, EMI, PPF, NETS, SAL As Double
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
PH = Val(ds.Tables(0).Rows(0)(13)) * Val(TextBox9.Text)
MH = Val(ds.Tables(0).Rows(0)(10)) * Val(TextBox10.Text)
SL = 0
PL = Val(ds.Tables(0).Rows(0)(14)) * Val(TextBox7.Text)
ML = Val(ds.Tables(0).Rows(0)(14)) * Val(TextBox7.Text) / 2
AD = Val(TextBox2.Text)
EMI = Val(TextBox3.Text)
NETS = Val(c) + Val(d) + Val(ee) + Val(f) + Val(g) + Val(h) +
Val(PH) - Val(MH) - Val(SL) - Val(PL) - Val(ML) - Val(AD) - Val(EMI)
PPF = NETS * 20 / 100
SAL = NETS - PPF
'---------------Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "insert into SALARY VALUES('" + TextBox1.Text + "','" +
TextBox4.Text + "','" + TextBox5.Text + "','" + a + "','" + b + "','" +
c + "','" + d + "','" + ee + "','" + f + "','" + g + "','" + h + "','"
+ PH.ToString + "','" + MH.ToString + "','" + SL.ToString + "','" +
PL.ToString + "','" + ML.ToString + "','" + AD.ToString + "','" +
EMI.ToString + "','" + PPF.ToString + "','" + NETS.ToString + "','" +
SAL.ToString + "')"
Dim con As New SqlConnection(cs)
con.Open()
Dim cmd As New SqlCommand(q, con)
cmd.ExecuteNonQuery()
con.Close()
Label5.Text = "Salary of this Month : " + SAL.ToString
ct()
Catch ee As Exception
MsgBox(ee.Message.ToString())
End Try
End Sub
Private Sub Form2_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Activated
q = "insert into SALARY VALUES('" + TextBox1.Text + "','" +
TextBox4.Text + "','" + TextBox5.Text + "','" + a + "','" + b + "','" +
c + "','" + d + "','" + ee + "','" + f + "','" + g + "','" + h + "','"
+ PH.ToString + "','" + MH.ToString + "','" + SL.ToString + "','" +
PL.ToString + "','" + ML.ToString + "','" + AD.ToString + "','" +
EMI.ToString + "','" + PPF.ToString + "','" + NETS.ToString + "','" +
SAL.ToString + "')"
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Dim con As New SqlConnection(cs)
con.Open()
Dim cmd As New SqlCommand(q, con)
cmd.ExecuteNonQuery()
con.Close()
Label5.Text = "Salary of this Month : " + SAL.ToString
ct()
Catch ee As Exception
MsgBox(ee.Message.ToString())
End Try
End Sub
Private Sub Form2_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Activated
ct()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
SOURCE CODE MONTHLY SALARY
Imports System.Data
Imports System.Data.SqlClient
Public Class Form7
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from salary where empid='" + TextBox1.Text.Trim()
+ "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label2.Text = "No Record Search"
Else
Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End If
End Sub
Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from salary where empid='" + TextBox1.Text.Trim()
+ "'"
Dim da As New SqlDataAdapter(q, cs)
Dim ds As New DataSet
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
Dim x As Integer
x = ds.Tables(0).Rows.Count
If x = 0 Then
Label2.Text = "No Record Search"
Else
Label2.Text = "Emp ID : " +
ds.Tables(0).Rows(0)(0).ToString
End Class
Source code salary print
Imports System.Data
Imports System.Data.SqlClient
Public Class sslip
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
pp.PrintPreviewControl.Zoom = 1
pp.Width = Me.Width
pp.Height = Me.Height
pp.ShowDialog()
End Sub
Sub dp()
Try
Dim cs As String
cs = "Data Source=.;Initial Catalog=ep2009;Integrated
Security=True;Pooling=False"
Dim q As String
q = "select * from salary where empid='" +
TextBox1.Text.Trim() + "'"
Dim da As New SqlDataAdapter(q, cs)
da.Fill(ds)
Catch
MsgBox("No EMP ID FOUND")
End Try
End Sub
Dim ds As New DataSet
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object,
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage
dp()
On Error Resume Next
Dim ff As New Font("arial", 8, FontStyle.Regular)
Dim f As New Font("arial", 11, FontStyle.Bold)
e.Graphics.DrawString("Pay Slip
" +
System.DateTime.Now.ToString("MMMM").ToString + "
" +
System.DateTime.Now.Year.ToString, f, Brushes.Black, 320, 20)
e.Graphics.DrawString("Nahar Tower
Industrial Area - A
,Ludhiana - 141 003 (INDIA),Tel :- +91-161-2600701 to 705,Fax :- +91161-2600709/2601956,E-mail :- nahar@owmnahar.com ", ff, Brushes.Black,
20, 50)
e.Graphics.DrawLine(Pens.Black, 0, 80, 2000, 80)
Dim str(25) As String
str(0) = "Employee ID"
str(1) = "Name"
str(2) = "Section"
str(3) = "Month"
str(4) = "Basic Pay"
str(5) = "Grade Basic Pay"
str(6) = "HouseRent"
str(7) = "TaDA"
str(8) = "Medical"
str(9) = "Mobile"
str(10) = "Welth"
str(11) = "OverTime(+)"
str(12) = "LessHrs(-)"
str(13) = "Standrad Leave(+/-)"
str(14) = "Personal Leave(-PL)"
str(15) = "Medical Leave(-ML)"
str(16) = "Advance (-)"
str(17) = "Loan Emi (-)"
str(18) = "PPF (-)"
str(19) = "Total Salary"
'str(20) = "Total Benfits+"
'str(21) = "Total Reduction-"
str(20) = "Salary of Month"
Dim lc, p As Integer
For lc = 0 To 20
p = p + 26
e.Graphics.DrawString(str(lc), f, Brushes.Black, 220, 70 +
p)
e.Graphics.DrawString(ds.Tables(0).Rows(0)(lc).ToString, f,
Brushes.Black, 500, 70 + p)
Next
Dim ll = 70 + p
Dim h = ll + 26
e.Graphics.DrawLine(Pens.Black, 0, ll, 2000, ll)
e.Graphics.DrawLine(Pens.Black, 0, h, 2000, h)
End Sub
Private Sub sslip_FormClosed(ByVal sender As Object, ByVal e As
System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Me.WindowState = FormWindowState.Maximized
End Sub
Private Sub sslip_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
BIBLIOGRAPHY
BIBLIOGRAPHY
We use some book for making this project coding
1. Visual Basic .net in 21 Days
2. Visual Basic.net Black Book
3. Visual Basic.net Teach Your Self
4. ADO.NET Special Edition by Microsoft
Download