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.

  1. Private Sub tsSSS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsSSS.Click
  3. frmSSSTable.Text = "SSS Contribution Schedule"
  4. frmSSSTable.Show()
  5. End Sub

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.

  1. Public CASESWITCH As String = ""

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

  1. frmNewSSScontribution.Show()

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

  1. Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
  3. If btnSave.Text = "Save" Then
  5. If CASESWITCH = "SSS" Then
  6. saveInsert("Insert into <code>tblsss</code> (<code>FROMSALARY</code>, <code>TOSALARY</code>, <code>EMPLOYEEAMOUNT</code>, <code>EMPLOYERAMOUNT</code>, <code>COMPANYIDNO</code>, <code>CONTEMPLOYEEACC</code>, <code>CONTEMPLOYERACC</code>) values (" &amp; txtSalaryfrom.Text &amp; "," &amp; txtSalaryto.Text &amp; "," &amp; txtEmployeeContribution.Text &amp; "," &amp; txtEmployerContribution.Text &amp; "," &amp; SCHOOLIDNO &amp; "," &amp; cbemployeeAccount.SelectedValue &amp; "," &amp; cbemployerAccount.SelectedValue &amp; ")
  7. End If
  9. Else
  11. If CASESWITCH = "SSS" Then
  12. saveUpdate("Update <code>tblsss</code> SET <code>FROMSALARY</code> = " &amp; txtSalaryfrom.Text &amp; ", <code>TOSALARY</code> =" &amp; txtSalaryto.Text &amp; ", <code>EMPLOYEEAMOUNT</code> = " &amp; txtEmployeeContribution.Text &amp; ", <code>EMPLOYERAMOUNT</code> =" &amp; txtEmployerContribution.Text &amp; ", <code>CONTEMPLOYEEACC</code> =" &amp; cbemployeeAccount.SelectedValue &amp; ", <code>CONTEMPLOYERACC</code> =" &amp; cbemployerAccount.SelectedValue &amp; " WHERE <code>SSSID</code> =" &amp; SSSIDCONTRIBUTION &amp; " and <code>COMPANYIDNO</code> =" &amp; SCHOOLIDNO &amp; "")
  14. End If
  16. End If
  18. End Sub
  20. &nbsp;

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

Facebook Comments


Please enter your comment!
Please enter your name here