COMPUTERISED EMPLOYEE RECORD SYSTEM BY HAMPO, JOHNPAUL ANENECHUKWU CHUKWUNONSO
Descripción
COMPUTERISED EMPLOYEE RECORD SYSTEM
BY
HAMPO, JOHNPAUL ANENECHUKWU CHUKWUNONSO
A GRADUATE OF COMPUTER SCIENCE, MATHEMATICS AND COMPUTER SCIENCE DEPARTMENT OF DELTA STATE UNIVERSITY, ABRAKA – NIGERIA
MARCH, 2012
Table of Contents
DEDICATION 3
ACKNOWLEDGEMENT 4
INTERFACES 5
CODES 9
DEDICATION
This research work is dedicated first to Jehovah God and humanity especially those in computing and ICT, and related fields.
ACKNOWLEDGEMENT
I appreciate and gratefully acknowledge God Almighty for making me who I am today. Also for the intuition, life, Peace and every good thing God has been giving me; Lord you're indeed wonderful.
I salute my relatives, past and present friends (foes inclusive), lecturers back in school, bosses at past times and opponents for all their support and otherwise.
More thanks to you, my readers. Continue the voyage on this work for better discoveries.
INTERFACES
CODES
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class clsConnect
Public cn As New SqlConnection
Public ServerDate As DateTime
Public Sub Connect()
Try
cn = New SqlConnection("server=localhost;uid=sa;pwd=hamplus; database=Computerized_Employee_Record_System")
If cn.State = Data.ConnectionState.Open Then
cn.Close()
End If
cn.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Public Sub DT()
Try
Connect()
Dim cmd = New SqlCommand("select GetDate()", cn)
ServerDate = cmd.ExecuteScalar
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
Imports System.Data.SqlClient
Public Class frmAdd
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
If txtStaffID.Text "" Then
Dim hampo, johnpaul As New clsConnect
hampo.Connect()
johnpaul.DT()
Dim hamplus As New SqlCommand
hamplus.Connection = hampo.cn
hamplus.CommandText = "insert into tblStaffData1 (SysID,StaffID,Surname,Othernames,sex,dob,StateLGA,Nationality,Religion,MaritalStatus,EmailAdd,ResidentAdd,PerAdd,dt)" _
& "values (@sys,@staff,@s,@o,@sex,@dob,@State,@nat,@rel,@ms,@ea,@ra,@pa,@dt)"
hamplus.Parameters.AddWithValue("@sys", Label14.Text)
hamplus.Parameters.AddWithValue("@staff", txtStaffID.Text)
hamplus.Parameters.AddWithValue("@s", txtSN.Text)
hamplus.Parameters.AddWithValue("@o", txtON.Text)
hamplus.Parameters.AddWithValue("@sex", cboSex.Text)
hamplus.Parameters.AddWithValue("@dob", DateTimePicker1.Text)
hamplus.Parameters.AddWithValue("@state", txtState.Text)
hamplus.Parameters.AddWithValue("@nat", txtNationality.Text)
hamplus.Parameters.AddWithValue("@rel", cboReligion.Text)
hamplus.Parameters.AddWithValue("@ms", cboMS.Text)
hamplus.Parameters.AddWithValue("@ea", txtEmail.Text)
hamplus.Parameters.AddWithValue("ra", txtRA.Text)
hamplus.Parameters.AddWithValue("@pa", txtPA.Text)
hamplus.Parameters.AddWithValue("@dt", johnpaul.ServerDate)
hamplus.ExecuteNonQuery()
Me.Hide()
frmAdd2.Show()
Else
Label15.Text = "Please type Staff ID"
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.Close()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtEmail.Text = ""
txtNationality.Text = ""
txtON.Text = ""
txtPA.Text = ""
txtRA.Text = ""
txtSN.Text = ""
txtStaffID.Text = ""
txtState.Text = ""
cboMS.Text = ""
cboReligion.Text = ""
cboSex.Text = ""
DateTimePicker1.Value = Now.Date
End Sub
Private Sub frmAdd_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a, b, c As Integer
a = 2012
Randomize()
b = 2 + Rnd(a) * 858
b = Mid(b, 1, 3)
c = b
Label14.Text = "NNPC " + CStr(c)
End Sub
End Class
Imports System.Data.SqlClient
Public Class frmAdd2
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click
With OpenFileDialog1
.Filter = "All Images "*.jpg;*.gif;*.bmp;*.png"
.FileName = ""
.Title = "Blinks Digital Diary " Select Picture"
End With
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName.ToString "" Then
PictureBox1.ImageLocation = OpenFileDialog1.FileName.ToString
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
GroupBox1.Enabled = True
End If
End Sub
Private Sub frmAdd2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = frmAdd.Label14.Text
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.Close()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtSB.Text = ""
cboSCR.Text = ""
cboSUB.Text = ""
cboSUD.Text = ""
DateTimePicker1.Value = Today.Date
DateTimePicker2.Value = Now.Date
NumericUpDown1.Value = 4
GroupBox1.Enabled = False
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
Dim hampo, johnpaul As New clsConnect
hampo.Connect()
johnpaul.DT()
Dim hamplus As New SqlCommand
hamplus.Connection = hampo.cn
hamplus.CommandText = "insert into tblStaffData2 (SysID,StaffCadre,StaffBranch,StaffUnit,Subsi,StaffGL,Acadmic,DOFA,DateComfirmed,pic,dt)" _
& "values (@sys,@staff,@s,@o,@sex,@dob,@State,@nat,@rel,@pic,@dt)"
hamplus.Parameters.AddWithValue("@sys", frmAdd.Label14.Text)
hamplus.Parameters.AddWithValue("@staff", cboSCR.Text)
hamplus.Parameters.AddWithValue("@s", txtSB.Text)
hamplus.Parameters.AddWithValue("@o", cboSUD.Text)
hamplus.Parameters.AddWithValue("@sex", cboSUB.Text)
hamplus.Parameters.AddWithValue("@dob", NumericUpDown1.Value)
hamplus.Parameters.AddWithValue("@state", CheckedListBox1.CheckedItems.ToString)
hamplus.Parameters.AddWithValue("@nat", DateTimePicker1.Text)
hamplus.Parameters.AddWithValue("@rel", DateTimePicker2.Text)
hamplus.Parameters.AddWithValue("@pic", OpenFileDialog1.FileName)
hamplus.Parameters.AddWithValue("@dt", johnpaul.ServerDate)
hamplus.ExecuteNonQuery()
Me.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
Lihat lebih banyak...
Comentarios