コード例 #1
0
 public static DealerManpower ToManpowerDomain(DealerManpowerModel model)
 {
     return new DealerManpower {
         Id = model.Id,
         Name = model.Name,
         Type = model.Type,
         Description = model.Description,
         UserId = model.UserId,
         DealerId = model.DealerId,
         ProductId = model.ProductId
     };
 }
コード例 #2
0
 public static Profile ToProfileDomain(DealerManpowerModel model)
 {
     return new Profile {
         Id = model.ProfileId,
         ContactNumber = model.ContactNumber,
         Address = model.Address,
         Designation = model.Type,
         Email = model.Email,
         PANNumber = model.PANNumber,
         DateOfJoining = model.DateOfJoining.HasValue && model.DateOfJoining.Value.Ticks > 0 ? model.DateOfJoining : null,
         PreviousCompany = model.PreviousCompany,
         PreviousJobProfile = model.PreviousJobProfile,
         TotalWorkExperience = model.TotalWorkExperience,
         ExperienceWithVE = model.ExperienceWithVE,
         TIVRepresenting = model.TIVRepresenting,
         TrainingLevel = model.TrainingLevel,
         DateOfLeaving = model.DateOfLeaving,
         DateOfBirth = model.DateOfBirth.HasValue && model.DateOfBirth.Value.Ticks > 0 ? model.DateOfBirth : null,
         Description = model.Description,
         SAPCode = model.SAPId,
         AreaRepresenting = model.AreaRepresenting
     };
 }
コード例 #3
0
 public static DealerManpowerModel FromDomainModel(DealerManpower manpower)
 {
     var model = new DealerManpowerModel {
         Id = manpower.Id,
         Name = manpower.Name,
         Type = manpower.Type,
         DealerId = manpower.DealerId,
         Dealer = manpower.Dealer.Name,
         UserId = manpower.UserId,
         User = manpower.User.Name,
         ProductId = manpower.ProductId,
         Product = manpower.Product.Name,
         ProfileId = manpower.Profile.Id,
         ContactNumber = manpower.Profile.ContactNumber,
         Address = manpower.Profile.Address,
         Designation = manpower.Profile.Designation,
         Email = manpower.Profile.Email,
         PANNumber = manpower.Profile.PANNumber,
         DateOfJoining = manpower.Profile.DateOfJoining,
         PreviousCompany = manpower.Profile.PreviousCompany,
         PreviousJobProfile = manpower.Profile.PreviousJobProfile,
         TotalWorkExperience = manpower.Profile.TotalWorkExperience,
         ExperienceWithVE = manpower.Profile.ExperienceWithVE,
         TIVRepresenting = manpower.Profile.TIVRepresenting,
         AreaRepresenting = manpower.Profile.AreaRepresenting,
         TrainingLevel = manpower.Profile.TrainingLevel,
         DateOfLeaving = manpower.Profile.DateOfLeaving,
         DateOfBirth = manpower.Profile.DateOfBirth,
         Description = manpower.Profile.Description,
         SAPId = manpower.Profile.SAPCode,
         DOLString = manpower.AttritionProfileMap != null ? (manpower.AttritionProfileMap.DateOfLeaving.HasValue ? manpower.AttritionProfileMap.DateOfLeaving.Value.ToString("dd-MMMM-yyyy") : string.Empty) : string.Empty,
         Competency = manpower.CompetencyProfileMaps != null && manpower.CompetencyProfileMaps.Any() ? manpower.CompetencyProfileMaps.Average(x => x.Score) : 0,
         Salary = manpower.ManpowerSalaries != null && manpower.ManpowerSalaries.Any() ? manpower.ManpowerSalaries.OrderByDescending(x => x.ObjectInfo.CreatedDate).First().Salary : 0,
         Productivity = 0
     };
     return model;
 }