zinab_elgendy 7 mēneši atpakaļ
vecāks
revīzija
c49571274e

+ 5 - 0
MTWorkHR.Application/Dtos/Identity/UserDto.cs

@@ -40,6 +40,11 @@ namespace MTWorkHR.Application.Models
         public int? JobTitleId { get; set; }
         public int? IndustryId { get; set; }
         public int? CountryId { get; set; }
+        public string? QualificationName { get; set; }
+        public string? UniversityName { get; set; }
+        public string? JobTitleName { get; set; }
+        public string? IndustryName { get; set; }
+        public string? CountryName { get; set; }
 
         public decimal TaxNumber { get; set; }
         public decimal IncomeTaxValue { get; set; }

+ 7 - 1
MTWorkHR.Application/Mapper/MappingProfile.cs

@@ -24,7 +24,13 @@ namespace MTWorkHR.Application.Mapper
                 .ForMember(m => m.UserRoles, op => op.Ignore())
                 .ForMember(m => m.Id, op => op.Ignore());
 
-            CreateMap<ApplicationUser, UserDto>().ForMember(m => m.Password, op => op.Ignore());
+            CreateMap<ApplicationUser, UserDto>().ForMember(m => m.Password, op => op.Ignore())
+              .ForMember(s => s.QualificationName, o => o.MapFrom(s => s.Qualification == null ? "" : GlobalInfo.lang == "ar" ? s.Qualification.NameAr : s.Qualification.NameEn))
+              .ForMember(s => s.JobTitleName, o => o.MapFrom(s => s.JobTitle == null ? "" : GlobalInfo.lang == "ar" ? s.JobTitle.NameAr : s.JobTitle.NameEn))
+              .ForMember(s => s.IndustryName, o => o.MapFrom(s => s.Industry == null ? "" : GlobalInfo.lang == "ar" ? s.Industry.NameAr : s.Industry.NameEn))
+              .ForMember(s => s.CountryName, o => o.MapFrom(s => s.Country == null ? "" : GlobalInfo.lang == "ar" ? s.Country.NameAr : s.Country.NameEn))
+              .ForMember(s => s.UniversityName, o => o.MapFrom(s => s.University == null ? "" : GlobalInfo.lang == "ar" ? s.University.NameAr : s.University.NameEn)
+              );
             CreateMap<ApplicationUser, UserAllDto>()
                 .ForMember(s => s.QualificationName, o => o.MapFrom(s => s.Qualification ==null ? "" : GlobalInfo.lang == "ar" ? s.Qualification.NameAr : s.Qualification.NameEn))
                 .ForMember(s => s.JobTitleName, o => o.MapFrom(s => s.JobTitle ==null ? "" : GlobalInfo.lang == "ar" ? s.JobTitle.NameAr : s.JobTitle.NameEn))

+ 5 - 0
MTWorkHR.Application/Services/User/UserService.cs

@@ -58,6 +58,11 @@ namespace MTWorkHR.Application.Services
                 .Include(x => x.UserRoles)
                 .Include(x => x.UserAddress)
                 .Include(x => x.UserAttachments)
+                .Include(x => x.JobTitle)
+                .Include(x => x.Industry)
+                .Include(x => x.University)
+                .Include(x => x.Country)
+                .Include(x => x.Qualification)
                 .FirstOrDefaultAsync(x => x.Id == id);
             var response = MapperObject.Mapper.Map<UserDto>(entity);