public List <EmployeeTotalWorkingHoursReportDomainModel> GetEmployeeReportFilledByTeamLeaderAccToEmployeeId(long TLEmployeeId, long EmployeeId) { try { long DepartmentId = 0; if (TLEmployeeId > 0) { IManagement managementRepository = new ManagementRepository(); var emp = managementRepository.GetEmployeeDataById(TLEmployeeId); if (emp != null && emp.UserId > 0) { DepartmentId = emp.DepartmentId; } } var list = objHelper.Query <EmployeeTotalWorkingHoursReportDomainModel>("GET_EMPLOYEE_REPORT_FILLED_BY_TEAMLEADER_ACCORDING_TO_EMPLOYEEID", new { departmentid = DepartmentId, teamleaderid = TLEmployeeId, employeeid = EmployeeId }).ToList(); if (list != null && list.Count > 0) { foreach (var obj in list) { obj.listEmployeeDailyReportDetails = GetEmployeeReportAccordingToEmployeeId(DepartmentId, TLEmployeeId, EmployeeId, obj.CreatedDate); if (obj.listEmployeeDailyReportDetails != null && obj.listEmployeeDailyReportDetails.Count > 0) { long totalWorkingMinutes = obj.listEmployeeDailyReportDetails.Select(s => HelperMethods.ConversionInMinute(s.WorkingHours)).Sum(); obj.TotalWorking = Convert.ToString(HelperMethods.ConversionInHour(totalWorkingMinutes)); } } } return(list); } catch (Exception ex) { ErrorLog.LogError(ex); return(null); } }
public static ManagementRepository GetManagementRepository(IUnitOfWork unitOfWork) { var repository = new ManagementRepository(); repository.UnitOfWork = unitOfWork; return repository; }
public static ManagementRepository GetManagementRepository() { var repository = new ManagementRepository(); repository.UnitOfWork = GetUnitOfWork(); return repository; }