112 – Managing SSS Contribution Logic for Payroll System

This tutorial about “Managing SSS Contribution Logic for Payroll System”. The usual algorithm for this kind of module would be the IF ELSE statement or the CASE and the like. We try to set the range conditioning and give a particular value to the result. However, our solution would be one module for the system in order to make one query for the equivalent range.

This will be the scenario, we are going to save the table of the specification of SSS contribution to our database. So that whatever changes or modification of the government we do not have to go to the program code but just edit our item contribution to our table.

Managing SSS Contribution Logic for Payroll System Coding:

Define now our tsSSS toolStrip button click event and add the code below.

[vbnet]

Private Sub tsSSS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsSSS.Click
CASESWITCH = “SSS”
frmSSSTable.Text = “SSS Contribution Schedule”
frmSSSTable.Show()
End Sub

[/vbnet]

As you have observe in our code, I am using CASESWITCH variable and at the same time changing the text of the form for the purpose of I will be using the same form for the PhilHealth and Pag-Ibig Module. So we don’t have to add another form.

If you have already the declaration variable for the CASESWITCH, It is good and you may continue now. However, if you haven’t add it up, please add the code below in our PayrollMod.vb Module.

[vbnet]

Public CASESWITCH As String = “”

[/vbnet]

For the btnNew button, call now the  frmNewSSScontribution form in order to add a new item or row in our SSS Contribution Table.

[vbnet]

frmNewSSScontribution.Show()

[/vbnet]

The code below shows the different CASESWITCH procedure. Go now to your btnSave click event for saving the contribution table.

[vbnet]

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

If btnSave.Text = “Save” Then

If CASESWITCH = “SSS” Then
saveInsert(“Insert into `tblsss` (`FROMSALARY`, `TOSALARY`, `EMPLOYEEAMOUNT`, `EMPLOYERAMOUNT`, `COMPANYIDNO`, `CONTEMPLOYEEACC`, `CONTEMPLOYERACC`) values (” & txtSalaryfrom.Text & “,” & txtSalaryto.Text & “,” & txtEmployeeContribution.Text & “,” & txtEmployerContribution.Text & “,” & SCHOOLIDNO & “,” & cbemployeeAccount.SelectedValue & “,” & cbemployerAccount.SelectedValue & “)
End If

Else

If CASESWITCH = “SSS” Then
saveUpdate(“Update `tblsss` SET `FROMSALARY` = ” & txtSalaryfrom.Text & “, `TOSALARY` =” & txtSalaryto.Text & “, `EMPLOYEEAMOUNT` = ” & txtEmployeeContribution.Text & “, `EMPLOYERAMOUNT` =” & txtEmployerContribution.Text & “, `CONTEMPLOYEEACC` =” & cbemployeeAccount.SelectedValue & “, `CONTEMPLOYERACC` =” & cbemployerAccount.SelectedValue & ” WHERE `SSSID` =” & SSSIDCONTRIBUTION & ” and `COMPANYIDNO` =” & SCHOOLIDNO & “”)

End If

End If

End Sub

 

[/vbnet]

We end our system module here for Managing SSS Contribution for Payroll System. Run your application and encode the database in our SSS Contribution Table.

Previous Topic: Managing SSS Contribution for Payroll System: Table of Contribution and Graphical User Interface

2 thoughts on “112 – Managing SSS Contribution Logic for Payroll System”

Leave a Comment