public static void MapDtoToEntityForUpdating(UserDefinedSystemConfigDto udscDto, UserDefinedSystemConfig udsc) { udsc.NHoursAgo = udscDto.NHoursAgo; udsc.ShiftPostStartStillValidThresholdValue = udscDto.ShiftPostStartStillValidThresholdValue; udsc.ShiftPreStartEarlyInThresholdValue = udscDto.ShiftPreStartEarlyInThresholdValue; udsc.ShiftPostEndValidThresholdValue = udscDto.ShiftPostEndValidThresholdValue; udsc.PayrollStartDayOfMonth = udscDto.PayrollStartDayOfMonth; udsc.PayrollEndDayOfMonth = udscDto.PayrollEndDayOfMonth; udsc.NICFactor = udscDto.NICFactor; udsc.AccruedHolidayFactor = udscDto.AccruedHolidayFactor; }
public void Update(UserDefinedSystemConfigDto udscDto, long userId) { var systemConfig = _unitOfWork.UserDefinedSystemConfigRepository.GetById(udscDto.Id); CommonHelperAppService.MapDtoToEntityForUpdating(udscDto, systemConfig); _unitOfWork.UserDefinedSystemConfigRepository.Update(systemConfig); _unitOfWork.Save(); // Audit _auditLogAppService.Audit( AppConstants.ActionTypeUpdate, AppConstants.UserDefinedSystemConfigTableName, userId, systemConfig.Id); }