示例#1
0
        private void ConfigureMapper()
        {
            var config = Mapper.Configuration;
            Mapper.Initialize(cfg =>
            {


                cfg.CreateMap<Record, JWSModels.Record>()
                    .ForMember(target => target.TierLevel, opts => opts.Ignore())
                    .ForMember(target => target.TierLevelId, opts => opts.Ignore())
                    .ForMember(target => target.TierName, opts => opts.Ignore())
                    .ForMember(target => target.UserLevel, opts => opts.Ignore())
                    .ForMember(target => target.IndexCode, opts => opts.Ignore())
                    .ForMember(target => target.NumberPayPeriods, opts => opts.Ignore())
                    .ForMember(target => target.PayRatePerPayPeriod, opts => opts.Ignore())
                    .ForMember(target => target.AnnualHours, opts => opts.Ignore())
                    .ForMember(target => target.AnnualPayRate, opts => opts.Ignore())
                    .ForMember(target => target.DaysWorkedPerWeek, opts => opts.Ignore())
                    .ForMember(target => target.OccupationCode, opts => opts.Ignore())
                    .ForMember(target => target.UnionCode, opts => opts.Ignore())
                    .ForMember(target => target.AddressLine1, opts => opts.ResolveUsing(c => c.Address1))
                    .ForMember(target => target.AddressLine2, opts => opts.ResolveUsing(c => c.Address2))
                    .ForMember(target => target.City, opts => opts.ResolveUsing(c => c.City))
                    .ForMember(target => target.DateOfBirth, opts => opts.ResolveUsing(c => c.DateOfBirth))
                    .ForMember(target => target.EmployeeId, opts => opts.ResolveUsing(c => c.EmployeeId))
                    .ForMember(target => target.FirstName, opts => opts.ResolveUsing(c => c.FirstName))
                    .ForMember(target => target.Gender, opts => opts.ResolveUsing(c => c.Gender))
                    .ForMember(target => target.HireDate, opts => opts.ResolveUsing(c => c.HireDate))
                    .ForMember(target => target.JobClassCode, opts => opts.ResolveUsing(c => c.JobClassCode))
                    .ForMember(target => target.JobDescription, opts => opts.ResolveUsing(c => c.JobDescription))
                    .ForMember(target => target.LastName, opts => opts.ResolveUsing(c => c.LastName))
                    .ForMember(target => target.MaritalStatus, opts => opts.ResolveUsing(c => c.MaritalStatus))
                    .ForMember(target => target.PayRate, opts => opts.ResolveUsing(c => c.PayRate))
                    .ForMember(target => target.PayRateType, opts => opts.ResolveUsing(c => c.PayRateType))
                    .ForMember(target => target.PhoneNumber, opts => opts.ResolveUsing(c => c.PhoneNumber))
                    .ForMember(target => target.SocialSecurityNumber,
                        opts => opts.ResolveUsing(c => c.SocialSecurityNumber))
                    .ForMember(target => target.State, opts => opts.ResolveUsing(c => c.State))
                    .ForMember(target => target.ZipCode, opts => opts.ResolveUsing(c => c.ZipCode))
                .AfterMap((src, target) =>
                {


                    TierMapping tierMapping;//= new TierMapping(this, target);
                    if (!src.DivisionName.IsEmpty())
                    {
                        tierMapping = new TierMapping(this, target, src.DivisionName);
                        tierMapping.MapOrgLevel(Tiers3, 3, src.DivisionName.ToUpper(), src.DivisionName.ToUpper(),
                            MissingOrganizationMappingEncountered, MultipleOrganizationMappingEncountered);

                    }



                });


            });
            config.AssertConfigurationIsValid();
        }
示例#2
0
        private void ConfigureMapper()
        {
            var config = new MapperConfiguration(cfg =>
           {


                cfg.CreateMap<Record, JWSModels.Record>()
                .ForMember(target => target.DaysWorkedPerWeek, opts => opts.Ignore())
                .ForMember(target => target.OccupationCode, opts => opts.Ignore())
                .ForMember(target => target.UnionCode, opts => opts.Ignore())
                .ForMember(target => target.NumberPayPeriods, opts => opts.Ignore())
                .ForMember(target => target.AnnualHours, opts => opts.Ignore())
                .ForMember(target => target.AnnualPayRate, opts => opts.Ignore())
                .ForMember(target => target.TierLevel, opts => opts.Ignore())
                .ForMember(target => target.TierLevelId, opts => opts.Ignore())
                .ForMember(target => target.TierName, opts => opts.Ignore())
                .ForMember(target => target.UserLevel, opts => opts.Ignore())
                .ForMember(target => target.IndexCode, opts => opts.Ignore())
                .ForMember(target => target.AddressLine1, opts => opts.ResolveUsing(c => c.Address1))
                .ForMember(target => target.AddressLine2, opts => opts.ResolveUsing(c => c.Address2))
                .ForMember(target => target.PayRatePerPayPeriod, opts => opts.ResolveUsing(c => c.PayRate))
                .AfterMap((src, target) =>
                {


                    var tierMapping = new TierMapping(this, target);
                    if (!src.Level5Name.IsEmpty())
                    {
                        tierMapping.MapOrgLevel(Tiers5, 5, src.Level5Name.ToUpper(), src.DepartmentName.ToUpper(),
                            MissingOrganizationMappingEncountered, MultipleOrganizationMappingEncountered);
                    }
                    if (!src.DepartmentName.IsEmpty())
                    {
                        tierMapping = new TierMapping(this, target, src.DepartmentNumber);
                        tierMapping.MapOrgLevel(Tiers4, 4, src.DepartmentName.ToUpper(), src.DivisionName.ToUpper(),
                            MissingOrganizationMappingEncountered, MultipleOrganizationMappingEncountered);
                    }
                    if (target.TierLevel == 0)
                    {
                        target.TierLevel = 2;
                        target.TierLevelId = "109".PadLeft(6, '0');

                    }




                });


            });
            config.AssertConfigurationIsValid();
            mapper = config.CreateMapper();

        }
示例#3
0
        private void ConfigureMapper()
        {

            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Record, JWSModels.Record>()
                    .ForMember(target => target.TierLevel, opts => opts.Ignore())
                    .ForMember(target => target.TierLevelId, opts => opts.Ignore())
                    .ForMember(target => target.TierName, opts => opts.Ignore())
                    .ForMember(target => target.UserLevel, opts => opts.Ignore())
                    .ForMember(target => target.IndexCode, opts => opts.Ignore())
                    .ForMember(target => target.NumberPayPeriods, opts => opts.Ignore())
                    .ForMember(target => target.PayRatePerPayPeriod, opts => opts.Ignore())
                    .ForMember(target => target.AnnualHours, opts => opts.Ignore())
                    .ForMember(target => target.AnnualPayRate, opts => opts.Ignore())
                    .ForMember(target => target.NameSuffix, opts => opts.Ignore())
                    .ForMember(target => target.OccupationCode, opts => opts.Ignore())
                    .ForMember(target => target.UnionCode, opts => opts.Ignore())
                    .ForMember(target => target.PhoneNumber, opts => opts.Ignore())
                    .ForMember(target => target.JobDescription, opts => opts.Ignore())
                    .ForMember(target => target.AddressLine1, opts => opts.ResolveUsing(c => c.Address1))
                    .ForMember(target => target.AddressLine2, opts => opts.ResolveUsing(c => c.Address2))
                    .ForMember(target => target.EmployeeId, opts => opts.ResolveUsing(c => c.EmployeeId))
                    .ForMember(target => target.HoursWorkedPerDay, opts => opts.ResolveUsing(c => c.HoursWorkedPerDay))
                    .ForMember(target => target.DaysWorkedPerWeek, opts => opts.ResolveUsing(c => c.DaysWorkedPerWeek))
                    .ForMember(target => target.JobClassCode, opts => opts.ResolveUsing(c => c.JobClassCode))
                       .AfterMap((src, target) =>
                       {


                           TierMapping tierMapping;//= new TierMapping(this, target);
                           if (src.DivisionNumber > 0)
                           {
                               tierMapping = new TierMapping(this, target, src.DivisionNumber.ToString());
                               //var list = OrgList.Where(c => c.Number.Contains(src.DivisionNumber.ToString()));

                               tierMapping.MapOrgLevel(Tiers3, 3, src.DivisionNumber.ToString(), string.Empty,
                                   MissingOrganizationMappingEncountered, MultipleOrganizationMappingEncountered);

                           }


                       });





            });


            config.AssertConfigurationIsValid();


        }
示例#4
0
        private void ConfigureMapper()
        {
            var config = Mapper.Configuration;
            Mapper.Initialize(cfg =>
            {


                cfg.CreateMap<Record, JWSModels.Record>()
                    .ForMember(target => target.TierLevel, opts => opts.Ignore())
                    .ForMember(target => target.TierLevelId, opts => opts.Ignore())
                    .ForMember(target => target.TierName, opts => opts.Ignore())
                    .ForMember(target => target.UserLevel, opts => opts.Ignore())
                    .ForMember(target => target.IndexCode, opts => opts.Ignore())
                    .ForMember(target => target.NumberPayPeriods, opts => opts.Ignore())
                    .ForMember(target => target.PayRatePerPayPeriod, opts => opts.Ignore())
                    .ForMember(target => target.AnnualHours, opts => opts.Ignore())
                    .ForMember(target => target.AnnualPayRate, opts => opts.Ignore())
                    .ForMember(target => target.DaysWorkedPerWeek, opts => opts.Ignore())
                    .ForMember(target => target.AddressLine1, opts => opts.ResolveUsing(c => c.Address1))
                    .ForMember(target => target.AddressLine2, opts => opts.ResolveUsing(c => c.Address2))
                      .AfterMap((src, target) =>
                      {


                          TierMapping tierMapping;//= new TierMapping(this, target);
                          if (!src.DivisionName.IsEmpty())
                          {
                              tierMapping = new TierMapping(this, target, src.DivisionName);
                              tierMapping.MapOrgLevel(Tiers3, 3, src.DivisionName.ToUpper(), src.DivisionName.ToUpper(),
                                  MissingOrganizationMappingEncountered, MultipleOrganizationMappingEncountered);

                          }
                          if (!src.DepartmentName.IsEmpty())
                          {
                              tierMapping = new TierMapping(this, target, src.DepartmentName.Trim());
                              tierMapping.MapOrgLevel(Tiers4, 4, src.DepartmentName.Trim().ToUpper(), src.DivisionName.Trim().ToUpper(),
                                  MissingOrganizationMappingEncountered, MultipleOrganizationMappingEncountered);

                          }


                      });






            });
            config.AssertConfigurationIsValid();
        }