112 – Managing SSS Contribution Logic for Payroll System

0
141

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
  2. CASESWITCH = "SSS"
  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
  2.  
  3. If btnSave.Text = "Save" Then
  4.  
  5. If CASESWITCH = "SSS" Then
  6. 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 & ")
  7. End If
  8.  
  9. Else
  10.  
  11. If CASESWITCH = "SSS" Then
  12. 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 & "")
  13.  
  14. End If
  15.  
  16. End If
  17.  
  18. End Sub
  19.  
  20.  

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
(Visited 148 times, 2 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here