예제 #1
0
        public ActionResult Load(string fullName, decimal annualSalary, decimal superRate, string payPeriod, int employeeID)
        {
            var employee = new Models.EmployeeModel
            {
                EmployeeID   = employeeID,
                AnnualSalary = annualSalary,
                PayPeriod    = payPeriod,
                SuperRate    = superRate
            };

            decimal incomeTax   = serviceImplementation.GetIncomeTaxAmount(employee.AnnualSalary);
            decimal superAmount = serviceImplementation.GetSuperAmount(employee.AnnualSalary, employee.SuperRate);

            Models.PayslipModel payslipModel = new Models.PayslipModel
            {
                FullName    = fullName,
                PayPeriod   = employee.PayPeriod,
                GrossIncome = (employee.AnnualSalary / 12),
                IncomeTax   = incomeTax,
                NetIncome   = (employee.AnnualSalary / 12) - incomeTax,
                SuperAmount = superAmount
            };

            return(View("Payslip", payslipModel));
        }
예제 #2
0
        public ActionResult Print(string fullName, decimal annualSalary, decimal superRate, string payDate)
        {
            decimal incomeTax   = serviceImplementation.GetIncomeTaxAmount(annualSalary);
            decimal superAmount = serviceImplementation.GetSuperAmount(annualSalary, superRate);

            Models.PayslipModel payslipModel = new Models.PayslipModel
            {
                FullName    = fullName,
                PayPeriod   = payDate,
                GrossIncome = (annualSalary / 12),
                IncomeTax   = incomeTax,
                NetIncome   = (annualSalary / 12) - incomeTax,
                SuperAmount = superAmount
            };

            return(View("Payslip", payslipModel));
        }
예제 #3
0
        public ActionResult Display(int employeeID)
        {
            List <Models.EmployeeModel> EmployeeList = TempData["employee"] as List <Models.EmployeeModel>;

            var employee = EmployeeList.FirstOrDefault(p => p.EmployeeID == employeeID);

            decimal incomeTax   = serviceImplementation.GetIncomeTaxAmount(employee.AnnualSalary);
            decimal superAmount = serviceImplementation.GetSuperAmount(employee.AnnualSalary, employee.SuperRate);

            Models.PayslipModel payslipModel = new Models.PayslipModel
            {
                FullName    = String.Format("{0} {1}", employee.FirstName, employee.LastName),
                PayPeriod   = employee.PayPeriod,
                GrossIncome = (employee.AnnualSalary / 12),
                IncomeTax   = incomeTax,
                NetIncome   = (employee.AnnualSalary / 12) - incomeTax,
                SuperAmount = superAmount
            };

            return(View("Payslip", payslipModel));
        }