Parcourir la source

HR: ProfileImagePath

zinab_elgendy il y a 3 jours
Parent
commit
8cc8882b30

+ 1 - 1
MTWorkHR.API/Controllers/HRController.cs

@@ -23,7 +23,7 @@ namespace MTWorkHR.API.Controllers
         [HttpGet("GetAll")]
         [ProducesResponseType(StatusCodes.Status200OK)]
 
-        public async Task<ActionResult<List<ContractDto>>> GetAll([FromQuery] ContractPagingInputDto pagingInput)
+        public async Task<ActionResult<List<ContractAllHRDto>>> GetAll([FromQuery] ContractPagingInputDto pagingInput)
         {
             return Ok(await _ContractService.GetAllForHr(pagingInput));
         }

+ 2 - 1
MTWorkHR.Application/Dtos/Contract/ContractAllHRDto.cs

@@ -26,7 +26,8 @@ namespace MTWorkHR.Application.Models
         public string UserId { get; set; }
         public string? EmployeeName { get; set; }
         public string? EmployeeEmail { get; set; }
-      
+        public string? ProfileImagePath { get; set; }
+
         public int? JobId { get; set; }
         //-------------------Scope of work-----------
         public string? JobTitleName { get; set; }

+ 1 - 1
MTWorkHR.Application/Dtos/Contract/ContractHRDto.cs

@@ -23,7 +23,7 @@ namespace MTWorkHR.Application.Models
         public string UserId { get; set; }
         public string? EmployeeName { get; set; }
         public string? EmployeeEmail { get; set; }
-      
+        public string? ProfileImagePath { get; set; }
         public int? JobId { get; set; }
         public int? AcademicQualificationId { get; set; }
         public int? SpecializationId { get; set; }

+ 4 - 0
MTWorkHR.Application/Services/Contract/ContractService.cs

@@ -180,6 +180,8 @@ namespace MTWorkHR.Application.Services
                     {
                         item.EmployeeName = user.FirstName + " " + user.LastName;
                         item.EmployeeEmail = user.Email;
+                        var attach = user.UserAttachments?.FirstOrDefault(a => a.AttachmentTypeId == 9);
+                        item.ProfileImagePath = attach?.FilePath;
                         //___________Get Teams
                         //var TeamsList = teamUsersList.Item1.Where(t => t.AssignedUserId == item.UserId).Select(t => GlobalInfo.lang == "en" ? t.Team.NameEn : t.Team.NameAr);
                         //item.Teams = TeamsList == null ? "" : string.Join(",", TeamsList);
@@ -225,6 +227,8 @@ namespace MTWorkHR.Application.Services
                 var user = await _userService.GetUserWithAttachmentById(entity.UserId);
                 response.EmployeeName = user.FirstName + " " + user.LastName;
                 response.EmployeeEmail = user.Email;
+                var attach = user.UserAttachments?.FirstOrDefault(a => a.AttachmentTypeId == 9);
+                response.ProfileImagePath = attach?.FilePath;
                 //___________Get Teams
                 var teamUsersList = await _unitOfWork.TeamUser.GetUserTeams(entity.UserId);
                 var teamsList = MapperObject.Mapper.Map<List<TeamDto>>(teamUsersList.Item1);