From 9e974f1b6ea24e1c270577e559ca746c11c77321 Mon Sep 17 00:00:00 2001 From: chapal Date: Tue, 17 Dec 2024 16:39:43 +0600 Subject: [PATCH] bug --- HRM.UI/Controllers/Payroll/BonusController.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/HRM.UI/Controllers/Payroll/BonusController.cs b/HRM.UI/Controllers/Payroll/BonusController.cs index 4542f29..b50e596 100644 --- a/HRM.UI/Controllers/Payroll/BonusController.cs +++ b/HRM.UI/Controllers/Payroll/BonusController.cs @@ -476,7 +476,7 @@ namespace HRM.UI.Controllers.Payroll foreach (ProdBonusSupervisor prodSupervisor in prodLine.ProdBonusSupervisors) { oEmp = new EmployeeService().Get(prodSupervisor.EmployeeID); - if (oEmp.DepartmentID != null) + if (oEmp!=null && oEmp.DepartmentID != null) { var dev = detps.FirstOrDefault(x => x.ID == oEmp.DepartmentID); @@ -503,9 +503,11 @@ namespace HRM.UI.Controllers.Payroll } } - prodSupervisor.EmpName = oEmp.Name; - prodSupervisor.EmployeeNo = oEmp.EmployeeNo; - + if (oEmp != null) + { + prodSupervisor.EmpName = oEmp.Name; + prodSupervisor.EmployeeNo = oEmp.EmployeeNo; + } } prodLine.ProdBonusParameters = _prodBonusParameterService.GetByLineID(prodLine.ID); Department oDept = new Department();