NoDataError.jsp
package com; import com.EmployeeObject4; import java.sql.*; import java.io.*; import com.bankFiles; import com.UpdatePayRecord; import com.ConnectionPool2; public class ArrangePayments { EmployeeObject4 employeeObject; Connection connection; UpdatePayRecord updatePayRecord; bankFiles bFile; double totalPayment; //This is the total payment for the bankfile. int NoOfPayements; public void ArrangePayments(){} //This method is called from payRollAxis before the loop is entered //to prepare the strings public void setArrangePayments(String company) { bFile = new bankFiles(); bFile.prepareCompanyData(company); } //This method is called with a different employObject4 for each iteration //of the loop in payRollAxis.jsp public void setArrangePayment(EmployeeObject4 e) { employeeObject = e; double grossPay = employeeObject.getGrossPay(); double taxDeducted = employeeObject.getNewTaxDeducted(); double employeeNIC = employeeObject.getNewEmployeeNICcont(); double finalPay = grossPay - taxDeducted - employeeNIC; totalPayment = totalPayment + finalPay;//Calculate all the payments for the payroll. NoOfPayements++; employeeObject.setNetPay(finalPay); updatePayRecord = new UpdatePayRecord(); updatePayRecord.update(employeeObject); bFile.addEmployee(employeeObject); } //passes on the message to combine and close the bankfile public void createFile() { //Comines header, body and footer and then prints to a file. bFile.createFile(totalPayment, NoOfPayements); } }