Tuesday, March 16, 2010

CODE FOR VISUAL BASIC

Form1 Form
Public Class Form1

Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
Dim Row As DataRow
For Each Row In Me.PassDataSet.tbpass
If (Row.Item("Username") = ComboBox1.Text) Then
If (Row.Item("Password") = Me.txtpassword.Text) Then
mainmenu.bAccess = True
ComboBox1.Text = ""
ComboBox1.Enabled = True
txtpassword.Enabled = True
ComboBox1.Focus()
Me.Close()
Else
MsgBox("Code did not match to the current record! Click 'OK' to retry.", MsgBoxStyle.Critical, "ERROR")
ComboBox1.Text = ""
txtpassword.Text = ""
ComboBox1.Enabled = True
txtpassword.Enabled = True
ComboBox1.Focus()
End If
End If
Next

End Sub

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub

Private Sub txtpassword_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtpassword.KeyPress
If e.KeyChar = Chr(13) Then
btnlogin_Click(sender, e)
End If
End Sub

Private Sub txtpassword_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtpassword.TextChanged
Dim Row As DataRow
For Each Row In Me.PassDataSet.tbpass
If (Row.Item("Password") = Me.txtpassword.Text) Then
txtpassword.Enabled = False
End If
Next
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim Row As DataRow
For Each Row In Me.PassDataSet.tbpass
If (Row.Item("username") = Me.ComboBox1.Text) Then
ComboBox1.Enabled = False

End If
Next

End Sub


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PassDataSet.tbpass' table. You can move, or remove it, as needed.
Me.TbpassTableAdapter.Fill(Me.PassDataSet.tbpass)

End Sub

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
forgetpass.ShowDialog()
End Sub
End Class

Forget pass Form
Public Class forgetpass

Private Sub TbpassBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.TbpassBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.PassDataSet)
End Sub

Private Sub forgetpass_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PassDataSet.tbpass' table. You can move, or remove it, as needed.
Me.TbpassTableAdapter.Fill(Me.PassDataSet.tbpass)
End Sub

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub
End Class
Main menu Form
Public Class mainmenu
Public bAccess As Boolean
Private Sub ExitToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem1.Click
If MsgBox("Operations will be terminated, are you sure you want to quit?", MsgBoxStyle.YesNo + MsgBoxStyle.Question + MsgBoxStyle.DefaultButton2, "QUIT") = MsgBoxResult.No Then
Else
End
End If
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Form1.ShowDialog()
If Not bAccess Then
End
End If
End Sub

Private Sub mainmenu_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
Form1.ShowDialog()
If Not bAccess Then
End
End If
End Sub


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = True
Me.lbltime.Text = String.Format(Now, "hh:mm:ss tt")
End Sub

Private Sub F1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles F1ToolStripMenuItem.Click
Form2.ShowDialog()
End Sub

Private Sub ChangePasswordToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChangePasswordToolStripMenuItem.Click
confirmation.ShowDialog()
End Sub

Private Sub BackupToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BackupToolStripMenuItem.Click
backup.ShowDialog()
End Sub

Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click
Employeeinfo.ShowDialog()
End Sub

Private Sub mainmenu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
End Sub

Private Sub EmployeeInformationToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EmployeeInformationToolStripMenuItem1.Click
makepayroll.ShowDialog()
End Sub

Private Sub ProgrammersFormToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgrammersFormToolStripMenuItem.Click
payrolllist.ShowDialog()
End Sub

Private Sub PaymentPeriodToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaymentPeriodToolStripMenuItem.Click
preprooflist.ShowDialog()
End Sub

Private Sub PaymentPeriodToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaymentPeriodToolStripMenuItem1.Click
preprooflist2.ShowDialog()
End Sub

Private Sub To15PaymentPeriodToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles To15PaymentPeriodToolStripMenuItem.Click
preregister.ShowDialog()
End Sub

Private Sub PaymentPeriodToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaymentPeriodToolStripMenuItem4.Click
preregister1.ShowDialog()
End Sub

Private Sub PaymentPeriodToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaymentPeriodToolStripMenuItem2.Click
prepayslip.ShowDialog()
End Sub

Private Sub PaymentPeriodToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PaymentPeriodToolStripMenuItem3.Click
prepayslip.ShowDialog()
End Sub

Private Sub MasterFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MasterFileToolStripMenuItem.Click
printlist.ShowDialog()
End Sub
End Class
Employee info Form
Public Class Employeeinfo


Public findID As Integer

Private Sub PASSBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.bndinfo.EndEdit()
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
End Sub

Private Sub btnmain_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmain.Click
Me.Close()
Me.btnmain.Refresh()
txtno.Text = ""
txtlastname.Text = ""
txtfirstname.Text = ""
cmbmi.Text = ""
txtaddress.Text = ""
cmbstat.Text = ""
cmbchil.Text = ""
cmbgen.Text = ""
txtage.Text = ""
cmbgrade.Text = ""
cmboffice.Text = ""
cmbpos.Text = ""
cmbsection.Text = ""
cmbtype.Text = ""
txtrice.Text = ""
TextBox1.Text = ""
TextBox4.Text = ""
RadioButton4.Refresh()
RadioButton3.Refresh()
txtno.Enabled = False
txtlastname.Enabled = False
txtfirstname.Enabled = False
cmbmi.Enabled = False
txtaddress.Enabled = False
cmbstat.Enabled = False
cmbchil.Enabled = False
cmbgen.Enabled = False
txtage.Enabled = False
cmbgrade.Enabled = False
cmboffice.Enabled = False
cmbpos.Enabled = False
cmbsection.Enabled = False
cmbtype.Enabled = False
txtrice.Enabled = False
TextBox1.Enabled = False
TextBox4.Enabled = False
End Sub


Private Sub enabledtext()
txtfind.Enabled = True
btnadd.Enabled = True
btnedit.Enabled = True
btndel.Enabled = True
btnmain.Enabled = True
btnun.Enabled = False
btnsave.Enabled = False
txtfind.Enabled = False
EmployeenoTextBox.Enabled = False
txtaddress.Enabled = False
txtage.Enabled = False
txtfirstname.Enabled = False
txtlastname.Enabled = False
cmbmi.Enabled = False
txtrice.Enabled = False
cmbgrade.Enabled = False
cmbchil.Enabled = False
cmbstat.Enabled = False
cmbtype.Enabled = False
cmboffice.Enabled = False
cmbpos.Enabled = False
cmbsection.Enabled = False
cmbgen.Enabled = False
TextBox1.Enabled = False
TextBox4.Enabled = False
TbcapelcoDataGridView.Enabled = True
DateTimePicker1.Enabled = False
RadioButton4.Enabled = False
RadioButton3.Enabled = False
End Sub

Private Sub disabledtext()
DateTimePicker1.Enabled = True
txtfind.Enabled = False
btnadd.Enabled = False
btnedit.Enabled = False
btndel.Enabled = False
btnmain.Enabled = True
btnun.Enabled = True
btnsave.Enabled = True
txtfind.Enabled = True
EmployeenoTextBox.Enabled = True
txtaddress.Enabled = True
txtage.Enabled = True
txtfirstname.Enabled = True
txtlastname.Enabled = True
cmbmi.Enabled = True
cmbgen.Enabled = True
txtrice.Enabled = True
cmbgrade.Enabled = True
cmbchil.Enabled = True
cmbstat.Enabled = True
cmbtype.Enabled = True
cmboffice.Enabled = True
cmbpos.Enabled = True
cmbsection.Enabled = True
TextBox1.Enabled = True
TextBox4.Enabled = True
TbcapelcoDataGridView.Enabled = True
RadioButton4.Enabled = True
RadioButton3.Enabled = True
End Sub

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
EmployeenoTextBox.Text = Strings.Mid(Me.lbltime.Text, 8, 2) & "_0" & Strings.Mid(lbltime.Text, 1, 1) & Strings.Mid(Me.lbltime.Text, 3, 1) & txtno.Text
Me.Capelco1DataSet1.Clear()
Me.bndinfo.AddNew()
Me.disabledtext()
End Sub

Private Sub btnun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnun.Click
Me.bndinfo.CancelEdit()
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.TbcapelcoDataGridView.Enabled = False
Me.TbcapelcoDataGridView.Refresh()
Me.bndinfo.MoveLast()
Me.btnmain.Focus()
Me.enabledtext()
Me.txtfind.Enabled = True
End Sub

Private Sub btnedit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnedit.Click
Me.disabledtext()
DateTimePicker1.Enabled = True
End Sub

Private Sub txtno_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) <= 32 Or _
(Asc(e.KeyChar) >= Asc("0") And Asc(e.KeyChar) <= Asc("9")) Then
txtlastname.Focus()
Else
e.KeyChar = ""
End If
End Sub

Private Sub txtaddress_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtaddress.KeyPress
If e.KeyChar = Chr(13) Then
cmbstat.Focus()
End If
End Sub





Private Sub cmbstat_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = Chr(13) Then
cmbchil.Focus()
End If
End Sub

Private Sub txtage_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtage.KeyPress
If e.KeyChar = Chr(13) Then
cmbgrade.Focus()
End If
End Sub

Private Sub txtrice_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtrice.KeyPress
If e.KeyChar = Chr(13) Then
cmbtype.Focus()
End If
End Sub

Private Sub cmbchil_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = Chr(13) Then
cmbgen.Focus()
End If
End Sub

Private Sub cmboffice_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbtype.KeyPress
If e.KeyChar = Chr(13) Then
cmbpos.Focus()
End If
End Sub

Private Sub cmbpos_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbpos.KeyPress
If e.KeyChar = Chr(13) Then
cmbsection.Focus()
End If
End Sub

Private Sub cmbgrade_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbgrade.KeyPress
If e.KeyChar = Chr(13) Then
cmboffice.Focus()
End If
End Sub

Private Sub cmbtype_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbtype.KeyPress
If e.KeyChar = Chr(13) Then
TextBox1.Focus()
End If
End Sub


Private Sub btndel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndel.Click
If MsgBox("Delete this current record, are you sure?", MsgBoxStyle.YesNo + MsgBoxStyle.Question + MsgBoxStyle.DefaultButton2, "Delete") = MsgBoxResult.Yes Then
Me.bndinfo.RemoveAt(Me.bndinfo.Position)
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
MsgBox("Data successfully deleted!", MsgBoxStyle.Information, "Delete Ok")
End If
End Sub

Private Sub addnewemployee_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
'TODO: This line of code loads data into the 'Capelco1DataSet.tbcapelco' table. You can move, or remove it, as needed.
Me.bndinfo.MoveLast()
txtfind.Text = ""
Me.DateTimePicker1.Enabled = False
Me.cmbchil.Enabled = False
Me.cmbmi.Enabled = False
Me.cmbstat.Enabled = False
Me.cmbgen.Enabled = False
Me.cmbgrade.Enabled = False
Me.txtfind.Enabled = True
Me.cmbtype.Text = "Regular"
Me.ComboBox1.Text = "Job order"
RadioButton4.Enabled = False
RadioButton3.Enabled = False
End Sub

Private Sub btnnext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnext.Click
Me.bndinfo.MoveNext()
End Sub

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
Me.bndinfo.MovePrevious()
End Sub

Private Sub btnsave_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
If Me.txtaddress.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmboffice.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.txtfirstname.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.txtlastname.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmbmi.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmbsection.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.txtno.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmbpos.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmbtype.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmbchil.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmbstat.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.cmbgrade.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
ElseIf Me.txtage.Text = "" Then
MsgBox("Please fill up completely the boxes.", MsgBoxStyle.Information, "FILL UP")
Else
Me.bndinfo.EndEdit()
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
MsgBox("Record Successfully Save", MsgBoxStyle.OkOnly, "SAVE")
Me.enabledtext()
Me.txtfind.Enabled = True
Me.txtfind.Text = ""
End If
End Sub

Private Sub txtfind_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtfind.TextChanged
Me.bndinfo.Filter = " Lastname LIKE '" & Me.txtfind.Text & "%'"
Me.bndinfo.Position += 1
If txtno.Text = "" Then
MsgBox("Record Does Not Exist!", MsgBoxStyle.Information, "Search Error")
Me.txtfind.Text = ""
End If
End Sub






Private Sub txtfind_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtfind.KeyPress
If IsNumeric(e.KeyChar) Then
e.KeyChar = ""
End If
If e.KeyChar = Chr(13) Then

End If
End Sub

Private Sub txtlastname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtlastname.KeyPress
If IsNumeric(e.KeyChar) Then
e.KeyChar = ""
txtfirstname.Focus()
End If
End Sub

Private Sub txtfirstname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtfirstname.KeyPress
If IsNumeric(e.KeyChar) Then
e.KeyChar = ""
cmbmi.Focus()
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.bndinfo.Filter = "Lastname LIKE '" & Me.txtfind.Text & "%'"
Me.bndinfo.Position += 1
If txtno.Text = "" Then
MsgBox("Record Does Not Exist!", MsgBoxStyle.Information, "Search Error")
Me.txtfind.Text = ""

End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
printlist.ShowDialog()
End Sub

Private Sub txtID_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) <= 32 Or _
(Asc(e.KeyChar) >= Asc("0") And Asc(e.KeyChar) <= Asc("9")) Then
txtno.Focus()
Else
e.KeyChar = ""
End If
End Sub




Private Sub cmbmi_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbmi.KeyPress
If IsNumeric(e.KeyChar) Then
e.KeyChar = ""
txtaddress.Focus()
End If
End Sub

Private Sub cmbgen_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbgen.KeyPress
If e.KeyChar = Chr(13) Then
txtage.Focus()
End If
End Sub

Private Sub cmbsection_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbsection.KeyPress
If e.KeyChar = Chr(13) Then
txtrice.Focus()
End If
End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Chr(13) Then
TextBox4.Focus()
End If
End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
preoffice.ShowDialog()
End Sub

Private Sub RadioButton4_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
If Me.cmbgrade.Text = 3 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "333.33"
Me.TextBox4.Text = "10000"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 4 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "350"
Me.TextBox4.Text = "10500"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 5 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "389.6"
Me.TextBox4.Text = "11688"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 6 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "400"
Me.TextBox4.Text = "12000"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 7 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "419.27"
Me.TextBox4.Text = "12578"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 8 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "448.83"
Me.TextBox4.Text = "13465"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 9 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "452.97"
Me.TextBox4.Text = "13589"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 10 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "466.67"
Me.TextBox4.Text = "14000"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 11 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "489.93"
Me.TextBox4.Text = "14698"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 12 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "526.63"
Me.TextBox4.Text = "15799"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 13 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "553.3"
Me.TextBox4.Text = "16599"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 14 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "559.63"
Me.TextBox4.Text = "16789"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 15 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "599.97"
Me.TextBox4.Text = "17999"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 16 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "616.77"
Me.TextBox4.Text = "18503"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 17 Then
Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "666.67"
Me.TextBox4.Text = "20000"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 18 Then

Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "783.33"
Me.TextBox4.Text = "23500"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 19 Then

Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "800"
Me.TextBox4.Text = "24000"
Me.txtrice.Text = "2300"
ElseIf Me.cmbgrade.Text = 20 Then

Me.cmbtype.Text = "Regular"
Me.TextBox1.Text = "853.33"
Me.TextBox4.Text = "25600"
Me.txtrice.Text = "2300"

End If
cmbtype.Visible = True
ComboBox1.Visible = False
cmbtype.Enabled = True
ComboBox1.Enabled = True
Me.cmbtype.Text = "Regular"
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
If Me.cmbgrade.Text = 3 Then
Me.cmbtype.Text = "Job order"
Me.TextBox1.Text = "250"
Me.TextBox4.Text = "7500"
ElseIf Me.cmbgrade.Text = 3 Then
Me.cmbtype.Text = "Job order"
Me.TextBox1.Text = "300"
Me.TextBox4.Text = "9000"
End If
cmbtype.Visible = False
ComboBox1.Visible = True
cmbtype.Enabled = True
ComboBox1.Enabled = True
txtrice.Text = ""
Me.ComboBox1.Text = "Job order"
End Sub
End Class
Make Payroll Form
Public Class makepayroll

Dim pagibig, OT1, OT2, OT3, monthlysalary, sss, tax As Decimal

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Me.Close()
datagrid.Refresh()
DataGridView1.Refresh()
txtfind.Text = ""
TextBox6.Text = ""
TextBox14.Text = ""
TextBox7.Text = ""
End Sub

Private Sub makepayroll_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PhiltaxDataSet.philtax' table. You can move, or remove it, as needed.
Me.PhiltaxTableAdapter.Fill(Me.PhiltaxDataSet.philtax)
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.cmbID.SelectedValue = Employeeinfo.lblID.Text
'txttax.Text = leavecredits.txttax.Text
btnprint.Enabled = False
btnprint2.Enabled = False
btnprint3.Enabled = False
btnprint4.Enabled = False
btncompute.Enabled = False

btnpaysli.Enabled = False
btnpayslip2.Enabled = False
btncompute2.Enabled = False
DataGridView1.Enabled = False
datagrid.Enabled = False

Button7.Enabled = False
btnexit.Enabled = True
txtfind.Enabled = True
btnexit.Refresh()
btndeduct.Enabled = False
btndeduct2.Enabled = False
btnnet.Enabled = False
btnnet2.Enabled = False
TextBox13.Enabled = False
TextBox15.Enabled = False
TextBox16.Enabled = False
Button1.Enabled = False
End Sub

Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
TextBox4.Text = ""
TextBox9.Text = ""
txtunder.Text = ""
TextBox6.Text = ""
txtcanteen.Text = ""
txtpagibig.Text = ""
txtcig.Text = ""
txtbond.Text = ""
btndeduct2.Enabled = False
btndeduct.Enabled = True
btnnet.Enabled = True
btnnet2.Enabled = True
DataGridView1.Visible = True
datagrid.Visible = False
Button7.Enabled = False
btncompute.Visible = True
btnprint.Visible = False
btnprint3.Visible = False
btnprint4.Visible = True
Label30.Visible = True
Label44.Visible = False
Label30.Enabled = True
Label44.Enabled = True
btnprint2.Visible = True
btnpaysli.Visible = False
btnpayslip2.Visible = True
Label29.Visible = False
Label28.Visible = True
Label29.Enabled = True
Label28.Enabled = True
btndeduct2.Visible = False
btndeduct.Visible = True
btnnet.Visible = True
btnnet2.Visible = False
txtfind.Enabled = True
btnprint.Enabled = False
btnprint4.Enabled = False
btnprint2.Enabled = False
btnprint3.Enabled = False
btnpaysli.Enabled = False
btnpayslip2.Enabled = False
txtfname.Enabled = False
txtlname.Enabled = False
cmbmi.Enabled = False
txtpolicy.Enabled = False
txtrate.Enabled = False
txttax.Enabled = False
txtlife.Enabled = False
txtoptional.Enabled = False
txtpagibig.Enabled = True
txtphil.Enabled = False
txtcash.Enabled = False
txtbond.Enabled = True
txtsale.Enabled = False
txtmotor.Enabled = False
txtcanteen.Enabled = True
txtunder.Enabled = True
txtcig.Enabled = True
TextBox8.Enabled = False
TextBox10.Enabled = False
TextBox4.Enabled = False
TextBox9.Enabled = True
TextBox12.Enabled = False
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox1.Enabled = False
TextBox5.Enabled = False
btncompute.Enabled = True
DataGridView1.Enabled = True
datagrid.Enabled = False
TextBox11.Enabled = False
TextBox13.Enabled = False
TextBox15.Enabled = False
TextBox16.Enabled = False
RadioButton3.Refresh()
Button1.Enabled = False
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
Button1.Enabled = True
txtcash.Text = ""
txtoptional.Text = ""
txtphil.Text = ""
txtsale.Text = ""
txtmotor.Text = ""
txtcanteen.Text = ""
TextBox8.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
btndeduct2.Enabled = True
btndeduct.Enabled = False
btnnet.Enabled = True
btnnet2.Enabled = True
TextBox13.Enabled = True
TextBox15.Enabled = True
TextBox16.Enabled = True
DataGridView1.Visible = False
datagrid.Visible = True
Button7.Enabled = True
btncompute.Visible = False
btnprint.Visible = False
btnprint2.Visible = True
btnprint3.Visible = True
btnprint4.Visible = False
Label30.Visible = False
Label44.Visible = True
Label30.Enabled = True
Label44.Enabled = True
btnpaysli.Visible = True
btnpayslip2.Visible = false
Label29.Visible = True
Label28.Visible = False
Label29.Enabled = True
Label28.Enabled = True
btndeduct2.Visible = True
btndeduct.Visible = False
btnnet.Visible = False
btnnet2.Visible = True
txtfind.Enabled = True
txtfname.Enabled = False
txtlname.Enabled = False
cmbmi.Enabled = False
btnprint.Enabled = False
btnprint4.Enabled = False
btnprint2.Enabled = False
btnprint3.Enabled = False
btnpaysli.Enabled = False
txtpolicy.Enabled = True
txtrate.Enabled = False
txttax.Enabled = False
txtlife.Enabled = False
txtoptional.Enabled = True
txtpagibig.Enabled = False
txtphil.Enabled = True
txtcash.Enabled = True
txtbond.Enabled = False
txtsale.Enabled = True
txtmotor.Enabled = True
txtcanteen.Enabled = False
txtunder.Enabled = True
txtcig.Enabled = False
TextBox8.Enabled = True
TextBox10.Enabled = True
TextBox11.Enabled = True
TextBox4.Enabled = False
TextBox9.Enabled = True
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox1.Enabled = False
TextBox5.Enabled = False
btncompute.Enabled = True
TextBox12.Enabled = False
DataGridView1.Enabled = False
datagrid.Enabled = True
RadioButton4.Refresh()
txtpagibig.Text = ""
End Sub

Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click
preregister.ShowDialog()
End Sub

Private Sub btnprint2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint2.Click
preregister1.ShowDialog()
End Sub

Private Sub btnprint4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint4.Click
preprooflist.ShowDialog()
End Sub
Private Sub btnprint3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint3.Click
preprooflist2.ShowDialog()
End Sub

Private Sub btnnet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnet.Click
TextBox7.Text = Val(pagibig) + Val(Me.txtbond.Text) + Val(Me.txtcanteen.Text) + Val(Me.txtcig.Text)
TextBox14.Text = Val(Me.TextBox6.Text) - Val(Me.TextBox7.Text)
Me.bndpayroll.EndEdit()
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
btnprint.Enabled = True
btnprint3.Enabled = True
btnprint2.Enabled = True
btnprint4.Enabled = True
btnpaysli.Enabled = True
btnpayslip2.Enabled = True
End Sub

Private Sub btndeduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndeduct.Click
Dim mr As Decimal
mr = Val(txtrate.Text)
pagibig = mr * 0.09
Me.txtpagibig.Text = pagibig
TextBox6.Text = Val(Me.TextBox5.Text)
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Me.bndpayroll.Filter = "Salarygrade like'" & Button5.Text & "*'"
If Me.TextBox1.Text = "" Then
MsgBox("Record does not Exist.", MsgBoxStyle.Critical, "ERROR")
Me.bndpayroll.Filter = "Salarygrade like'" & Button5.Text & "*'"
End If
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.bndpayroll.Filter = "Salarygrade like'" & Button6.Text & "*'"
If Me.TextBox1.Text = "" Then
MsgBox("Record does not Exist.", MsgBoxStyle.Critical, "ERROR")
Me.bndpayroll.Filter = "Salarygrade like'" & Button6.Text & "*'"
End If
End Sub

Private Sub btnun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.bndpayroll.CancelEdit()
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.bndpayroll.MoveFirst()
Button3.Visible = True
End Sub


Private Sub txtfind_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If IsNumeric(e.KeyChar) Then
e.KeyChar = ""
End If
If e.KeyChar = Chr(13) Then
End If
End Sub

Private Sub txtfind_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtfind.TextChanged
Me.bndpayroll.Filter = "Lastname LIKE '" & Me.txtfind.Text & "%' "
Me.bndpayroll.Position += 1
If TextBox12.Text = "" Then
MsgBox("Record Does Not Exist!", MsgBoxStyle.Information, "Search Error")
Me.txtfind.Text = ""
End If
End Sub

Private Sub TextBox13_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox13.TextChanged
TextBox2.Text = Val(Me.TextBox13.Text) * 1 * Val(Me.txtrate.Text)
End Sub

Private Sub TextBox15_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox15.TextChanged
TextBox3.Text = Val(Me.TextBox15.Text) * 1.5 * Val(Me.txtrate.Text)
End Sub

Private Sub TextBox16_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox16.TextChanged
TextBox1.Text = Val(Me.TextBox16.Text) * 3 * Val(Me.txtrate.Text)
End Sub

Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged
TextBox5.Text = Val(TextBox9.Text) * Val(txtrate.Text)
End Sub

Private Sub btndeduct2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndeduct2.Click
TextBox17.Text = Val(Me.TextBox2.Text) + Val(Me.TextBox3.Text) + Val(Me.TextBox1.Text)
TextBox6.Text = Val(Me.TextBox5.Text) + Val(Me.TextBox4.Text) + Val(Me.TextBox17.Text)
Dim F As Decimal
F = Val(txtrate.Text)
sss = F * 0.6
Me.txtlife.Text = sss
End Sub

Private Sub txtunder_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtunder.TextChanged
TextBox5.Text = Val(TextBox5.Text) - (Val(txtunder.Text) * Val(txtrate.Text))
End Sub

Private Sub btnnet2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnet2.Click
TextBox7.Text = Val(Me.txttax.Text) + Val(Me.txtlife.Text) + Val(Me.txtoptional.Text) + Val(Me.txtpolicy.Text) + Val(Me.txtcash.Text) + Val(Me.txtphil.Text) + Val(Me.txtsale.Text) + Val(Me.txtmotor.Text) + Val(Me.TextBox8.Text) + Val(Me.TextBox10.Text) + Val(Me.TextBox11.Text)
TextBox14.Text = Val(Me.TextBox7.Text) - Val(Me.TextBox6.Text)
Me.bndpayroll.EndEdit()
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
btnprint.Enabled = True
btnprint3.Enabled = True
btnprint2.Enabled = True
btnprint4.Enabled = True
btnpaysli.Enabled = True
btnpayslip2.Enabled = True
End Sub

Private Sub btnpaysli_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpaysli.Click
prepayslip.ShowDialog()
End Sub

Private Sub btnpayslip2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpayslip2.Click
prepayslip.ShowDialog()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.bndpayroll.AddNew()
txtrate.Enabled = False
TextBox5.Enabled = False
End Sub

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)
leavecredits.ShowDialog()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox6.Text = Val(TextBox5.Text) + 0
TextBox14.Text = Val(TextBox6.Text) + 0
Me.bndpayroll.EndEdit()
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
Me.bndpayroll.EndEdit()
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
MsgBox("Record Successfully Save", MsgBoxStyle.OkOnly, "SAVE")
End Sub


Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
leavecredits.ShowDialog()
End Sub
End Class
Leave credits Form
Public Class leavecredits
Dim totalincome, totaladdtax, total, TOTAL1 As Decimal

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
makepayroll.txttax.Text = Me.txttax.Text
Me.Close()
TextBox4.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
ComboBox1.Text = ""
ComboBox3.Text = ""
ComboBox6.Text = ""
ComboBox5.Text = ""
TextBox8.Text = ""
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox4.Text = Val(TextBox5.Text) * 12
TextBox2.Text = (Val(ComboBox4.Text) * Val(cmbchil.Text)) + Val(ComboBox2.Text)
TextBox3.Text = Val(TextBox4.Text) - Val(TextBox2.Text)

If Me.TextBox3.Text < 30000 Then
Me.ComboBox1.Text = "over 10000 but not over 30000"
Me.ComboBox3.Text = "500 + 10% of the excess over 10000"
Me.ComboBox6.Text = "500"
Me.ComboBox5.Text = ".10"

ElseIf Me.TextBox3.Text < 70000 Then
Me.ComboBox1.Text = "over 30000 but not over 70000"
Me.ComboBox3.Text = "2500 + 15% of the excess over 30000"
Me.ComboBox6.Text = "2500"
Me.ComboBox5.Text = ".15"

ElseIf Me.TextBox3.Text < 140000 Then
Me.ComboBox1.Text = "over 70000 but not over 1400000"
Me.ComboBox3.Text = "8500 + 20% of the excess over 70000"
Me.ComboBox6.Text = "8500"
Me.ComboBox5.Text = ".20"

ElseIf Me.TextBox3.Text < 250000 Then
Me.ComboBox1.Text = "over 140000 but not over 250000"
Me.ComboBox3.Text = "22500 + 25% of the excess over 140000"
Me.ComboBox6.Text = "22500"
Me.ComboBox5.Text = ".25"

ElseIf Me.TextBox3.Text <= 500000 Then
Me.ComboBox1.Text = "over 250000 but not over 500000"
Me.ComboBox3.Text = "50000 + 30% of the excess over 250000"
Me.ComboBox6.Text = "50000"
Me.ComboBox5.Text = ".30"

ElseIf Me.TextBox3.Text >= 500000 Then
Me.ComboBox1.Text = "over(500000)"
Me.ComboBox3.Text = "12500 + 34% of the excess over 500000"
Me.ComboBox6.Text = "125000"
Me.ComboBox5.Text = ".34"
End If
End Sub

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Me.Capelco1DataSet1.Clear()
Me.PhiltaxDataSet.Clear()
Me.bndtax.AddNew()
Me.bndtax1.AddNew()
Me.disabledtext()
End Sub

Private Sub btnun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnun.Click
Me.bndtax.CancelEdit()
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.bndtax.MoveFirst()

Me.bndtax1.CancelEdit()
Me.PhiltaxTableAdapter.Fill(Me.PhiltaxDataSet.philtax)
Me.bndtax1.MoveFirst()
Me.enabledtext()
End Sub

Private Sub leavecredits_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PhiltaxDataSet.philtax' table. You can move, or remove it, as needed.
Me.PhiltaxTableAdapter.Fill(Me.PhiltaxDataSet.philtax)

Me.cmbID.SelectedValue = Employeeinfo.lblID.Text
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
cmbchil.Enabled = False
cmbstat.Enabled = False
ComboBox1.Enabled = False
ComboBox2.Enabled = False
ComboBox5.Enabled = False
DateTimePicker1.Enabled = False
DateTimePicker2.Enabled = False
ComboBox3.Enabled = False
ComboBox1.Text = ""
ComboBox3.Text = ""
ComboBox2.Text = 50000
ComboBox4.Text = 25000
txtfind.Text = ""
txtfind.Enabled = True
ComboBox1.Text = ""
ComboBox3.Text = ""
ComboBox6.Enabled = False
ComboBox5.Enabled = False
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox8.Text = ""

End Sub

Private Sub enabledtext()
btnadd.Enabled = True
btnedit.Enabled = True
btndel.Enabled = True
btnexit.Enabled = True
btnun.Enabled = False
btnsave.Enabled = False
txtno.Enabled = False
txtfirstname.Enabled = False
txtlastname.Enabled = False
cmbmi.Enabled = False
cmbchil.Enabled = False
cmbstat.Enabled = False
ComboBox1.Enabled = False
ComboBox2.Enabled = False
ComboBox3.Enabled = False
ComboBox5.Enabled = False
ComboBox4.Enabled = False
ComboBox6.Enabled = False
TextBox8.Enabled = False
DateTimePicker1.Enabled = False
DateTimePicker2.Enabled = False
End Sub



Private Sub disabledtext()
btnadd.Enabled = False
btnedit.Enabled = False
btndel.Enabled = False
btnexit.Enabled = True
btnun.Enabled = True
btnsave.Enabled = True
ComboBox5.Enabled = False
txtno.Enabled = True
txtfirstname.Enabled = False
txtlastname.Enabled = False
cmbmi.Enabled = False
cmbchil.Enabled = True
cmbstat.Enabled = False
ComboBox1.Enabled = False
ComboBox2.Enabled = False
ComboBox3.Enabled = FALSE
ComboBox4.Enabled = False
ComboBox6.Enabled = False
TextBox8.Enabled = True
DateTimePicker1.Enabled = True
DateTimePicker2.Enabled = True
End Sub

Private Sub txtno_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtno.KeyPress
If Asc(e.KeyChar) <= 32 Or _
(Asc(e.KeyChar) >= Asc("0") And Asc(e.KeyChar) <= Asc("9")) Then
Else
e.KeyChar = ""
End If
End Sub

Private Sub cmbstat_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = Chr(13) Then
cmbchil.Focus()
End If
End Sub

Private Sub cmbchil_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = Chr(13) Then
TextBox5.Focus()
End If
End Sub

Private Sub btndel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndel.Click

If MsgBox("Delete this current record, are you sure?", MsgBoxStyle.YesNo + MsgBoxStyle.Question + MsgBoxStyle.DefaultButton2, "Delete") = MsgBoxResult.Yes Then
Me.bndtax.RemoveAt(Me.bndtax.Position)
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)

Me.bndtax1.RemoveAt(Me.bndtax1.Position)
Me.PhiltaxTableAdapter.Update(Me.PhiltaxDataSet.philtax)
MsgBox("Data successfully deleted!", MsgBoxStyle.Information, "Delete Ok")
End If
End Sub

Private Sub btnedit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnedit.Click
Me.disabledtext()

End Sub

Private Sub btnnext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnext.Click
Me.bndtax.MoveNext()
Me.bndtax1.MoveNext()
ComboBox2.Text = 50000
ComboBox4.Text = 25000
ComboBox1.Text = ""
ComboBox3.Text = ""
ComboBox2.Enabled = False
ComboBox4.Enabled = False
End Sub

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
Me.bndtax.MovePrevious()
Me.bndtax1.MovePrevious()
ComboBox2.Text = 50000
ComboBox4.Text = 25000
ComboBox1.Text = ""
ComboBox3.Text = ""
ComboBox2.Enabled = False
ComboBox4.Enabled = False
End Sub

Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
Me.bndtax.EndEdit()
'Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.TbcapelcoTableAdapter.Update(Me.Capelco1DataSet1.tbcapelco)
'makepayroll.txttax.Text = Me.txttax.Text
Me.bndtax1.EndEdit()
Me.PhiltaxTableAdapter.Update(Me.PhiltaxDataSet.philtax)
Me.PhiltaxTableAdapter.Fill(Me.PhiltaxDataSet.philtax)
MsgBox("Record Successfully Save", MsgBoxStyle.OkOnly, "SAVE")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim S, C, B As Decimal
S = Val(ComboBox5.Text)
C = Val(TextBox8.Text)
B = Val(ComboBox6.Text)
TOTAL1 = S * C + B / 12
Me.txttax.Text = TOTAL1
End Sub

Private Sub txtfind_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtfind.TextChanged
Me.bndtax.Filter = " Lastname LIKE '" & Me.txtfind.Text & "%'"
Me.bndtax.Position += 1
If txtlastname.Text = "" Then
MsgBox("Record Does Not Exist!", MsgBoxStyle.Information, "Search Error")
Me.txtfind.Text = ""
End If
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Me.bndtax.Filter = "Salarygrade like'" & Button5.Text & "*'"
If Me.txtno.Text = "" Then
MsgBox("Record does not Exist.", MsgBoxStyle.Critical, "ERROR")
Me.bndtax.Filter = "Salarygrade like'" & Button5.Text & "*'"
End If
End Sub

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)
makepayroll.ShowDialog()
End Sub
End Class
Back up Form
Public Class backup

Private Sub btnbackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbackup.Click
If MsgBox("Continue with the backup operation?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Backup") = MsgBoxResult.Yes Then
My.Computer.FileSystem.CopyFile("dbpayroll.mdb", Me.ComboBox1.Text & "BackUp.mdb")
End If
End Sub

Private Sub backup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
For i = 3 To 26
Me.ComboBox1.Items.Add(Chr(64 + i) & ":\")
Next
End Sub

Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancel.Click
Me.Close()
End Sub
End Class
Confirmation Form
Public Class confirmation

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Dim Row As DataRow
For Each Row In Me.passdataset.tbpass
If (Row.Item("Username") = Me.txtuserid.Text) Then
If (Row.Item("password") = Me.txtpassword.Text) Then
changepass.useracess = True
MsgBox("Username and password verification GRANTED!", MsgBoxStyle.Information, "VERIFICATION")
Me.Dispose()
Else
MsgBox("Code did not match to the current record! Click 'OK' to retry.", MsgBoxStyle.Critical, "ERROR")
txtuserid.Text = ""
txtpassword.Text = ""
txtuserid.Enabled = True
txtpassword.Enabled = True
txtuserid.Focus()
End If
End If
Next
End Sub

Private Sub confirmation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PassDataSet.tbpass' table. You can move, or remove it, as needed.
Me.TbpassTableAdapter.Fill(Me.PassDataSet.tbpass)
End Sub
End Class
Changepass Form
Public Class changepass
Public useracess As Boolean

Private Sub changepass_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PassDataSet.tbpass' table. You can move, or remove it, as needed.
Me.TbpassTableAdapter.Fill(Me.PassDataSet.tbpass)
Me.bndpass.AddNew()
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 btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Me.bndpass.EndEdit()
Me.TbpassTableAdapter.Update(Me.PassDataSet.tbpass)
Me.TbpassTableAdapter.Fill(Me.PassDataSet.tbpass)
Me.Close()
MsgBox("Security changes successfully completed!", MsgBoxStyle.Information, "SECURITY")
End Sub

Private Sub changeuserpass_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
If Not useracess Then
Me.Dispose()
End If
End Sub
End Class
Payrollregister1 Form
Public Class payrollregister1

Private Sub payrollregister1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReport41.SetDataSource(Me.Capelco1DataSet1)
Me.CrystalReportViewer1.RefreshReport()
'This will filter the records
Me.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade} like '" & preregister1.ComboBox1.Text & "'"
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReportViewer1.ReportSource = Me.CrystalReport41
End Sub
End Class
Payrollregister Form
Public Class payrollregister

Private Sub payrollregister_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.crv.RefreshReport()
Me.CrystalReport32.SetDataSource(Me.Capelco1DataSet1)
Me.crv.RefreshReport()
'This will filter the records
Me.crv.SelectionFormula = "{tbcapelco.Salarygrade} like '" & preregister.ComboBox1.Text & "'"
Me.crv.RefreshReport()
Me.crv.ReportSource = Me.CrystalReport32
End Sub
End Class

Payrollprooflist1 Form

Public Class payrollprooflist1

Private Sub payrollprooflist1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReport61.SetDataSource(Me.Capelco1DataSet1)
Me.CrystalReportViewer1.RefreshReport()
'This will filter the records
Me.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade} like '" & preprooflist2.ComboBox1.Text & "'"
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReportViewer1.ReportSource = Me.CrystalReport61
End Sub
End Class

Payrollprooflist Form

Public Class payrollprooflist

Private Sub payrollprooflist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReport51.SetDataSource(Me.Capelco1DataSet1)
Me.CrystalReportViewer1.RefreshReport()
'This will filter the records
Me.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade} like '" & preprooflist.ComboBox1.Text & "'"
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReportViewer1.ReportSource = Me.CrystalReport51
End Sub
End Class




Print Pay Form
Public Class printpay

Private Sub printpay_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReport11.SetDataSource(Me.Capelco1DataSet1)
Me.CrystalReportViewer1.RefreshReport()
'This will filter the records
Me.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade} like '" & prepayslip.ComboBox1.Text & "'"
Me.CrystalReportViewer1.RefreshReport()
Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11
End Sub
End Class
Preregister1 Form
Public Class preregister1

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub

Private Sub preregister1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)

End Sub

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
If (Me.ComboBox1.SelectedIndex = 0) Then
payrollregister1.CrystalReport41.SetDataSource(Me.Capelco1DataSet1)
TextBox1.Text = "REGULAR"
payrollregister1.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox1.Text & "'"
payrollregister1.CrystalReportViewer1.Update()
payrollregister1.CrystalReportViewer1.Refresh()
payrollregister1.CrystalReportViewer1.RefreshReport()
payrollregister1.ShowDialog()
Else
payrollregister1.CrystalReport41.SetDataSource(Me.Capelco1DataSet1)
TextBox2.Text = "JOB ORDER"
payrollregister1.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox2.Text & "'"
payrollregister1.CrystalReportViewer1.Update()
payrollregister1.CrystalReportViewer1.Refresh()
payrollregister1.CrystalReportViewer1.RefreshReport()
payrollregister1.ShowDialog()
End If
End Sub
End Class

Preregister Form
Public Class preregister

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
If (Me.ComboBox1.SelectedIndex = 0) Then
payrollregister.CrystalReport32.SetDataSource(Me.Capelco1DataSet1)
TextBox1.Text = "REGULAR"
payrollregister.crv.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox1.Text & "'"
payrollregister.crv.Update()
payrollregister.crv.Refresh()
payrollregister.crv.RefreshReport()
payrollregister.ShowDialog()
Else
payrollregister.CrystalReport32.SetDataSource(Me.Capelco1DataSet1)
TextBox2.Text = "JOB ORDER"
payrollregister.crv.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox2.Text & "'"
payrollregister.crv.Update()
payrollregister.crv.Refresh()
payrollregister.crv.RefreshReport()
payrollregister.ShowDialog()
End If
End Sub

Private Sub preprooflist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)

End Sub
End Class


Preprroflist2 Form
Public Class preprooflist2

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
If (Me.ComboBox1.SelectedIndex = 0) Then
payrollprooflist1.CrystalReport61.SetDataSource(Me.Capelco1DataSet1)
TextBox1.Text = "REGULAR"
payrollprooflist1.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox1.Text & "'"
payrollprooflist1.CrystalReportViewer1.Update()
payrollprooflist1.CrystalReportViewer1.Refresh()
payrollprooflist1.CrystalReportViewer1.RefreshReport()
payrollprooflist1.ShowDialog()
Else
payrollprooflist1.CrystalReport61.SetDataSource(Me.Capelco1DataSet1)
TextBox2.Text = "JOB ORDER"
payrollprooflist1.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox2.Text & "'"
payrollprooflist1.CrystalReportViewer1.Update()
payrollprooflist1.CrystalReportViewer1.Refresh()
payrollprooflist1.CrystalReportViewer1.RefreshReport()
payrollprooflist1.ShowDialog()
End If
End Sub

Private Sub preprooflist2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)

End Sub

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub
End Class
Preprroflist Form
Public Class preprooflist

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
If (Me.ComboBox1.SelectedIndex = 0) Then payrollprooflist.CrystalReport51.SetDataSource(Me.Capelco1DataSet1)
TextBox1.Text = "REGULAR"
payrollprooflist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox1.Text & "'"
payrollprooflist.CrystalReportViewer1.Update()
payrollprooflist.CrystalReportViewer1.Refresh()
payrollprooflist.CrystalReportViewer1.RefreshReport()
payrollprooflist.ShowDialog()
Else
payrollprooflist.CrystalReport51.SetDataSource(Me.Capelco1DataSet1)
TextBox2.Text = "JOB ORDER"
payrollprooflist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox2.Text & "'"
payrollprooflist.CrystalReportViewer1.Update()
payrollprooflist.CrystalReportViewer1.Refresh()
payrollprooflist.CrystalReportViewer1.RefreshReport()
payrollprooflist.ShowDialog()
End If
End Sub

Private Sub preprooflist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
End Sub

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub
End Class

Employeelist Form
Public Class employeelist

Private Sub employeelist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)

End Sub
End Class
Prepayslip Form
Public Class prepayslip

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
If (Me.ComboBox1.SelectedIndex = 0) Then
printpay.CrystalReport11.SetDataSource(Me.Capelco1DataSet1)
TextBox1.Text = "REGULAR"
printpay.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox1.Text & "'"
printpay.CrystalReportViewer1.Update()
printpay.CrystalReportViewer1.Refresh()
printpay.CrystalReportViewer1.RefreshReport()
printpay.ShowDialog()

Else
printpay.CrystalReport11.SetDataSource(Me.Capelco1DataSet1)
TextBox2.Text = "JOB ORDER"
printpay.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox2.Text & "'"
printpay.CrystalReportViewer1.Update()
printpay.CrystalReportViewer1.Refresh()
printpay.CrystalReportViewer1.RefreshReport()
printpay.ShowDialog()
End If
End Sub

Private Sub prepayslip_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)
End Sub

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub
End Class
Preoffice Form
Public Class preoffice

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()

End Sub

Private Sub preoffice_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)

End Sub

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click

If TextBox1.Text = "" Then
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox1.Text = "Timpas, Panitan"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.AreaOffice}='" & TextBox1.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
ElseIf TextBox2.Text = "" Then
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox2.Text = "Roxas City"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.AreaOffice}='" & TextBox2.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
ElseIf TextBox3.Text = "" Then
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox3.Text = "President Roxas"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.AreaOffice}='" & TextBox3.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
ElseIf TextBox4.Text = "" Then
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox4.Text = "Dao"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.AreaOffice}='" & TextBox4.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
ElseIf TextBox5.Text = "" Then
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox5.Text = "Mambusao"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.AreaOffice}='" & TextBox5.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
ElseIf TextBox6.Text = "" Then
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox6.Text = "Dumalag"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.AreaOffice}='" & TextBox6.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
End If

End Sub
End Class
Prelist Form
Public Class printlist

Private Sub btncan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncan.Click
Me.Close()
End Sub

Private Sub btnpre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpre.Click
If (Me.ComboBox1.SelectedIndex = 0) Then
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox1.Text = "REGULAR"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox1.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
Else
employeelist.masterlist.SetDataSource(Me.Capelco1DataSet1)
TextBox2.Text = "JOB ORDER"
employeelist.CrystalReportViewer1.SelectionFormula = "{tbcapelco.Salarygrade}='" & TextBox2.Text & "'"
employeelist.CrystalReportViewer1.Update()
employeelist.CrystalReportViewer1.Refresh()
employeelist.CrystalReportViewer1.RefreshReport()
employeelist.ShowDialog()
End If
End Sub

Private Sub printlist_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Capelco1DataSet1.tbcapelco' table. You can move, or remove it, as needed.
Me.TbcapelcoTableAdapter.Fill(Me.Capelco1DataSet1.tbcapelco)

End Sub
End Class

Tuesday, March 9, 2010

chapter IV

Chapter IV

THEORETICAL FRAMEWORK

This chapter includes the theoretical framework which served as the anchor for the study. It discussed the system theory which served as the basic in the development of the study.

Systems theory was introduced by biologist L. von Bertalanffy in the 1930s as a modeling devise that accommodates the interrelationships and overlap between separate disciplines. The reality is that when scientists and philosophers first tried to explain how things worked in the universe, there were no separate disciplines. Related components of a problem were investigated in isolation from one another. The Systems Theory introduced by von Bertalanffy states us of the value of integration of parts of a problem. Problems cannot be solved as well if they are considered in isolation from interrelated components. Enormous advantage systems analysts have in knowing the definitions of systems theory is that they present us with ideal guidelines for initial familiarization with a new problem, which of course is a new system.

The History of Payroll in the U.S. is the definitive chronicle of the evolution of the profession and the process from Colonial America through the end of the 20th century. Discover the astounding, and heretofore unpublished, history of payroll, compiled through painstaking research into the people, organizations, and historical milestones that transformed the Paymaster of the past into the Payroll Professional of the future. This important addition to every payroll library includes rare photos and illustrations.

Leonard A. Haug, CPP, has had a passion for payroll ever since he assumed his position as Payroll Manager for Digital Equipment Corporation in the mid-1980s. Over the next 15 years he would build and lead his payroll team to recognized payroll "best in class" status in areas of quality, customer service, and cost. For almost as long, Leonard has been an active member of the American Payroll Association, serving as both member and chairperson of many boards and committees.

He has received numerous accolades for his contributions to the profession, including the APA's Payroll Man of the Year Award in 1994. He has authored articles, publications, and books and is a frequent speaker on payroll and related topics.

Chapter V

DATA GATHERING PROCEDURE AND OUTPUT

Data gathering is one of the requirements to complete the proposed system. Data gathering is not an easy task because the proponent does not have enough knowledge when it comes to payroll. The proponents conducted several methods that would provide idea and information to accomplish the task. These methods includes conducting series of interview and online and library research.

There were options in order to come up with result and also to gather information needed to support the development of the system, the proponents made a plan of algorithm. It is a throught step by step procedure of gathering data and output. Primarily, the proponents conducted preliminary investigations to the possible business functions having manual practice on their system. From the three chosen business function for the proposal, namely Website for Twin Hearts Realty Corporation, Online Bible Stories and Computerized Payroll System for Capiz Electric Cooperative, Computerized Payroll System for Capiz Electric Cooperative best suited the standards required by the proposed system.

After rigid selection, the proponents submitted a letter to set an appointment with the Capiz Electric Cooperative for a formal interview to the General Manager. After one and half weeks of waiting, the respondents finally granted the proponent an interview. The proponents were first introduced to the general manager and then to the finance manager of finance department and to the payroll maker for the history, function and current development of payroll of capiz electric cooperative. The methods used for data gathering were conducting interview to the finance manager. The objectives of this interview are to be acquainted with the actual procedure in conducting their transaction to develop the system.

The proponents also implemented a series of research about computerized payroll system. This study gives knowledge to the researcher on how to create a computerized system in an understandable way. This will serve as a fresh ground to the researchers whose study will be related in the field of information technology.

Chapter VI

ANALYSIS



In this chapter, the proponents started gathering information about computerized payroll system that can help the users to lessen the time, effort and the problem encountered in the payroll process in terms of generating reports of each employee. The proponents used Fourth Generation Techniques as the methodology of the study to provide comprehensive guidelines to follow for completing activity including specific model, tools and techniques.

Requirements Gathering

In this phase, the proponents interviewed the respondents and other people who have extensive idea and knowledge to gather the data and the proponents knew and understood the flow of information in the specified system. The proponents analyzed the gathered data or information and the gathered data was translated into operational prototype.

Design Strategy

In this phase, the proponents translated the gathered data into set of presentation that described the data, architectures, algorithm procedures and interface characteristics. The proponents used 4GT because without design for large project it will cause difficulties such as poor quality and poor maintenance ability.

Implementation using Fourth Generation Languages (4GL)

In this phase, the design drafts of data or information gathered from CAPELCO were implemented using the appropriate language. The developers used the design representation converted into artificial languages and resulted into instruction that can be executed by computers. The gathered requirements and design were executed using the programming language, Microsoft Visual Basic 2008.

Testing

In this phase, the proponents develop a meaningful documentation and tested the system in the computer hardware, software and overall process to determine that the system will not create errors during runtime, especially when it is being used.

Chapter VII

SYSTEM DESIGN SPECIFICATION



The Computerized Payroll System for Capiz Electric Cooperative was developed with the use of Microsoft Visual Basic 2008. The developed system offered a user friendly feature that would enhance the current Payroll System of Capelco. The splash screen that will display the log-in form and that in turn ask the user name and password from the user before he/she could access the system as a security precaution of all the data stored in database.

The main form will be shown and this contains the menu bar. The menu bar is displayed through the use of menu editor and also buttons and labels that are arranged accordingly to its usage including Files, Reports, Tools and Help.

The File menu contains the make payroll, compute payslip and employee information command. Make payroll is used to compute the salary and deductions of all employees every first period and second period of the month. The compute payslip is used to compute the salary ad deductions of each employee every first period and second period of the month. Employee information used to add, edit and delete the new and old employee records. Reports will show the preview of payroll proof list, payroll register and payslip for regular and job order employees. Tools Menu includes change user which could change the user name and password of the user. It provides back up files. Help Menu includes the Programmer Form and About the Program.

Chapter VIII

SYSTEM REQUIREMENT SPECIFICATION


Hardware Requirements


Minimum Recommended
Processor 1.0 GHz 1.5
DRAM 256 MB 1 GB
Hard Disk 300 MB of free space on system drive
Monitor any model
Printer Required
Ink InkJet
Software Requirements
Windows XP/Windows Vista/Windows 7
Microsoft Visual Studio 2008
Microsoft Access

Human Resource Requirements

The user must be computer literate and posses the skills to operate or interact with the programs or application.

Chapter IX

SUMMARY, CONCLUSION and RECOMMENDATION

SUMMARY


Capiz Electric Cooperative is the most common source of Electricity in Roxas City. Due to the increasing numbers of people whose using electricity every year, the cooperative requires some support. This increasing of number of people who used electricity means more task and transaction to be processed, record to be stored and the increase of task for the employees and the personnel of the said cooperative. With the help of the modern technology and by the use of internet, the proponents learned more about the importance of a computerized payroll system. With the help of the proposed computerized payroll system, the proponents can help the respondents to lessen the problem encountered in the payroll process in terms of generating reports of each employee. This system will provides fast, reliable and efficient computerized payroll transaction. By this study, the Capiz Electric Cooperative will be given significant contribution especially for the improvement of their payroll transaction.

CONCLUSION

The Capiz Electric Cooperative renders inevitable standards of high quality of services for their employees. The Accounting Department of CAPELCO still uses manual method in doing their payroll tasks, because it takes lots of time and efforts and also focuses in recording, calculating, and generating reports. It is a pressure for the Payroll Maker to do the task to avoid committing errors and revisions.
Through the Computerized Payroll System, the Capiz Electric Cooperative will be able to generate accurate records and reports since it is stored in database. The system also provides security where it is only accessible to the authorized user or the person in charge using its own password.

RECOMMENDATION

The Proponent developed a Computerized Payroll System for Capiz Electric Cooperative (CAPELCO) to know the needs and the problem encountered of the Accounting Department, especially the Payroll Maker when it comes to security, the date efficiency of generating necessary reports. The proponents highly recommended the online payroll site for Capiz Electric Cooperative. The employees can search online about their payroll slip and other reports. The proponents recommended also to CAPELCO to implement the system using Local Area Network (LAN). The proponents recommend networking connection to the proposed system to connect and shared data from one Computer to another.

chapter III

Chapter III

METHODOLOGY OF THE STUDY


This study employed the Fourth Generation Technique also known as 4GT. This is a suitable method used in developing a system.

Fourth Generation Technique (4GT) best suits the system developed because it has a characteristic that makes the system methodical and systematic. Fourth generation techniques (4GT) encompasses a broad array of software tools that have one thing in common each enables the software engineer to specify some characteristic of software at a high level. The tool then automatically generates source code based on the developer's specification. There is little debate that the higher the level at which software can be specified to a machine, the faster a program can be built. The 4GT paradigm for software engineering focuses on the ability to specify software using specialized language forms or a graphic notation that describes the problem to be solved in terms that the customer can understand.

Technique (4GT) involve different phase such as Requirements Gathering, Design Strategy, Implementation using Fourth Generation Languages and Testing.

Requirements Gathering

The first phase of 4GT is the Requirements Gathering. This is the phase where the definition of requirements necessary in building software is defined. This is where the gathered data is translated into operational prototype, which is necessary in developing a design strategy for the system. This phase was done by interviewing the respondent and other people who have extensive knowledge in developing a specified system.

Design Strategy

In this phase, the gathered data is translated into a set of presentation that describes data structures, architecture, algorithmic procedures and interface characteristic. This is the phase where the proponents defined how the system is to be developed. The use of 4GT without design for large project will cause difficulties such as poor quality, poor maintenance ability, and poor customer acceptance that are often encountered when developing software using conventional approaches. All this necessary in order to proceed to the next phase called implementation.

Implementation using Fourth Generation Languages (4GL)

This the third phase of 4GT wherein the design presentation is translated to an artificial language that result in instruction that could be executed by the computer. The gathered requirements and design are put into a machine executable form using the newest programming language the Microsoft Visual Basic 2008 as a tool.

Testing

The last phase is testing, in computer hardware and software development is used at key checkpoints in the overall process to determine whether objectives are being met. This is required to ensure the system quality and that it will not create errors during run time, especially when it is being used.

chapter II

Chapter II

REVIEW OF RELATED LITERATURE


This chapter includes related studies and literature that have similar concepts to the study being conducted. This chapter covers the conceptual literature, foreign studies and local studies.

CONCEPTUAL LITERATURE

Payroll System is a flexible compensation administration solution. It is designed to help human resource professionals as well as finance and accounting personnel to manage employee compensation, deductions, allowances, and benefits in an organization. The system is integrated with the Employee Information System, offers efficient features and functionality to manage company's expenses (www.blastasia.com).

Payroll is an application that lends itself well to the computer because of its repetitive procedures and calculation. A Computerized payroll system can perform the same basic function as those performed manually by payroll clerk. The important differences are the computer’s speed, accuracy, reliability, and ability to easily generate reports. In a computerized payroll system, the computer stores data such as an employee’s name, address, social security number, marital status, number of withholding allowances, pay rate and voluntary deductions. At the end of each pay period, the operator enters all payroll transaction data, such as regular and overtime hours for each employee and deduction into the computer. The computer calculates all withholding taxes and other deductions and accumulates and updates the earnings and withholdings (Www.wadsworth.com).

FOREIGN STUDIES

Titus Information Payroll System


Titus Information Payroll system is designed to produce payroll checks with appropriate withholdings, benefits, allowances, and deductions for employees in multiple companies, departments, and/or sub-departments. It has been designed to handle up to 1,000,000 employees in 100 companies, 1,000 departments in each company, and 36 sub-departments in each department.

Some of the features and benefits of the Payroll System are multiple cost centers for payroll reporting, will handle special non-taxable benefits for ministers, flexible withholding capability, ability to split payroll expense between different cost centers, complete governmental reporting; FICA, FUTA, SUTA, Workman's Compensation, W-2's, and 1099's, Payroll check reversal, One check capability, Salaried, hourly, and contract employees in the same payroll run, Combined processing for weekly, bi-weekly, semi-monthly, or monthly, Taxable and non-taxable benefits and deductions, Multiple hourly rates for each employee, General ledger interface, Check list UFD file for check reconciliation, Extensive personnel information for each employee, Accrual of sick, vacation, and holiday hours, Flexible federal, state, and local taxation, Multiple company, department, and sub-department capability, Flexible benefit and deduction capability, Easy federal, state, and local tax table maintenance, Split income over multiple companies, departments, sub-departments, Payroll accrual/reversal capabilities, Time card data entry function, Special message function for printing on check stubs. (Www.titusinformationsystems.com)
Canadian Payroll System

Sage Accpac Canadian Payroll is a flexible module that gives you complete control over employee earnings and benefits, special payroll situations and government reporting, ensuring that your company's payroll requirements and personnel policies are accurate to the penny. You can enter or import timecards, enter after-the-fact paycheques, run automatic calculations or even combine all three methods to get your pay data into the system and your paycheques deployed on time. Payroll handles all pay frequencies; multiple work states; unlimited earnings, deductions, benefits and taxes; and other pay factors such as expense reimbursements, accruals and advances
(www.2020software.com).

LOCAL STUDIES

Cagayan de Oro City Hall Computerized Payroll System


The City Accounting Department has introduced an upgraded computerized payroll system for permanent employees in a bid to improve its services and maximize resources. This project, which was conceived two years ago, basically aims to improve our services particularly in the processing of payrolls for permanent employees, City Accountant Wilma Polley-Rugay told payroll in-charge of the different departments and offices at City Hall during a briefing and orientation on the concept of the one-month payroll system held Friday last week at the City Council session hall in Cagayan de Oro City. With the added features of the new computerized payroll system, Rugay said the preparation, processing and payment of payroll system to permanent employees would be hastened and fast-tracked.

Adopting of the one-month payroll system is also beneficial, not only to the City Accounting Department, but also to the payroll-in-charge as it would save time, energy and resources. “Employees who handle payroll preparation and processing can now attend to other office needs and concerns as the new payroll system will lessen their workload,” she added. Under the new payroll system, preparation of payroll, which reflects the accrued, amount payable every 15th and 30th day of the month, done only once. Unlike the time-consuming old payroll system, preparation and processing of payroll is done twice a month covering the first half and second half of the month. (www.sunstar.com.ph).

Computerized Payroll System of Department of Health (DOH)

The Computerized Payroll System is a window based program especially designed to facilitate and simplify the monthly preparation of general payroll and related reports such as Standard computerized payroll system for use in all DOH offices. It allows faster and more accurate computation of monthly gross income, deductions and net salary, less-resource-consuming generation of General Payroll and other payroll related reports and security and integrity of payroll data and information. The features of computerized payroll system of DOH are graphical user interface interactive and menu-driven program, systematic maintenance and retrieval of employee records. It is flexible as it provides options to include additional fields for other compensation and deductions unique to an office or unit and could do automatic computation of monthly net income, GSIS, PAG-IBIG, Withholding Tax and other deductions, Y2K compliant, Fast and easy generation of the General Payroll and all other payroll related reports which include Monthly reports like GSIS and PAG-IBIG remittances, Denominations Report and Leave Credits Report and annual Year-end Tax Reports. It has password security to ensure the integrity of data. General payroll reports such as Payroll Summary sheet, Pay slip, Leave Credits Report, Withholding Tax Statement (W-2), BIR Remittance Reports, GSIS Remittance Reports, PAG-IBIG Remittance Reports, Other User-defined Reports (PERA, ACA, PNB, etc..) could be generated by this system. (www2.doh.gov.ph).

This studies on the payroll system of DOH and Cagayan de Oro City Hall bears a resemblance on this study because they focus on the development of a similar system.