コード例 #1
0
        public ActionResult GetDetails(int anEmployeeId)
        {
            EmployeeCalculations empCalcs = new EmployeeCalculations(empRepo, configRepo);
            EmpDetailsViewModel empDetails = new EmpDetailsViewModel();
            empDetails.employee = empRepo.GetEmployeeById(anEmployeeId);
            empDetails.employee.BenefitCost = empCalcs.CalculateEmpCost(empDetails.employee);
            empDetails.dependents = empRepo.GetDependents(anEmployeeId);
            foreach (var dependent in empDetails.dependents)
            {
                dependent.BenefitCost = empCalcs.CalculateDependentCost(dependent);
            }
            empDetails.PayrollDeduction = empCalcs.CalculateEmpDeductions(empDetails.employee);
            empDetails.PayAfterBenefitDeduction = empCalcs.CalculatePayAfterBenefitDeduction(empDetails.employee);

            return PartialView("_Details", empDetails);
        }
コード例 #2
0
 public void AddEmployee(EmpDetailsViewModel anEmpDetails)
 {
     EmployeeCalculations empCalcs = new EmployeeCalculations(empRepo, configRepo);
     empRepo.AddEmployee(anEmpDetails.employee, anEmpDetails.dependents);
 }
コード例 #3
0
 public ActionResult _AddEmployee()
 {
     EmpDetailsViewModel model = new EmpDetailsViewModel();
     return PartialView(model);
 }