internal User toUserFromGetUser(string[] response)
{
if (response == null || response.Length == 0)
{
return null;
}
string[] rex = StringUtils.split(response[0], StringUtils.CRLF);
rex = StringUtils.trimArray(rex);
if (rex.Length != 1)
{
throw new Exception("Multiple records returned");
}
string[] flds = StringUtils.split(rex[0], StringUtils.CARET);
User result = new User();
result.Uid = flds[0];
result.Name = new PersonName(flds[1]);
result.Phone = flds[2];
result.VoicePager = flds[3];
if (flds[4] != "")
{
result.VoicePager += (flds[3] != "" ? "/" : "") + flds[4];
}
result.Office = flds[5];
if (flds[6] != "")
{
result.Title = getUserTitle(flds[6]);
}
result.SSN = new SocSecNum(flds[7]);
if (flds[8] != "")
{
result.Service = getUserService(flds[8]);
}
return result;
}