Skip to content

Commit

Permalink
Added missing numbertype
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMayor committed Aug 23, 2019
1 parent f7a5fe7 commit 2f52b1c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SSISPhoneLibShape/ParsedPhoneNumber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ public class ParsedPhoneNumber

public string GeoCoderDescription { get; set; }

public string NumberType { get; set; }

}
}
1 change: 1 addition & 0 deletions SSISPhoneLibShape/PhoneLibMethodConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static class PhoneLibMethodConstants

public const string PreferredDomesticCarrierCode = "PreferredDomesticCarrierCode";
public const string GeoCoderDescription = "GeoCoderDescription";
public const string NumberType = "NumberType";


}
Expand Down
5 changes: 5 additions & 0 deletions SSISPhoneLibShape/PhoneLibShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ private void SetPhoneNumberResultValuesToOutput(PipelineBuffer buffer, int x, Pa
case PhoneLibMethodConstants.PreferredDomesticCarrierCode:
buffer.SetString(colindex, parsedPhoneNumberResult.PreferredDomesticCarrierCode);
break;
case PhoneLibMethodConstants.NumberType:
buffer.SetString(colindex, parsedPhoneNumberResult.NumberType);
break;
}

}
Expand Down Expand Up @@ -417,6 +420,7 @@ private void GeneratePhoneNumbersOutputList(IDTSInputColumn100 inputcolumn)
_outputColumnList.Add(new OutputColumn { ColumnName = $"PhoneLib_HasCountryCode " + inputcolumn.Name, DataType = DataType.DT_BOOL, DataTypeLength = 0, Name = PhoneLibMethodConstants.HasCountryCode });
_outputColumnList.Add(new OutputColumn { ColumnName = $"PhoneLib_PreferredDomesticCarrierCode " + inputcolumn.Name, DataType = DataType.DT_WSTR, DataTypeLength = 255, Name = PhoneLibMethodConstants.PreferredDomesticCarrierCode });
_outputColumnList.Add(new OutputColumn { ColumnName = $"PhoneLib_GeoCoderDescription " + inputcolumn.Name, DataType = DataType.DT_WSTR, DataTypeLength = 255, Name = PhoneLibMethodConstants.GeoCoderDescription });
_outputColumnList.Add(new OutputColumn { ColumnName = $"PhoneLib_NumberType " + inputcolumn.Name, DataType = DataType.DT_WSTR, DataTypeLength = 255, Name = PhoneLibMethodConstants.NumberType });
}

//phonelib calls
Expand All @@ -441,6 +445,7 @@ public ParsedPhoneNumber IsPhoneNumberValid(string phoneNumber, string defaultIs
parsedNumber.PreferredDomesticCarrierCode = numberObject.PreferredDomesticCarrierCode;
var geocoder = PhoneNumbers.PhoneNumberOfflineGeocoder.GetInstance();
parsedNumber.GeoCoderDescription = geocoder.GetDescriptionForNumber(numberObject, PhoneNumbers.Locale.English);
parsedNumber.NumberType = phoneNumberUtil.GetNumberType(numberObject).ToString();
}
}

Expand Down

0 comments on commit 2f52b1c

Please sign in to comment.