| | |
| | | /// <param name="data"></param>
|
| | | private void AddPhoneNumRowLayout(VerticalListControl listview, ZigBee.Device.Safeguard.PushTargetInfo data)
|
| | | {
|
| | | var strArry = data.PushNumber.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | if (strArry.Length != 2)
|
| | | {
|
| | | return;
|
| | | }
|
| | | string areaCode2 = strArry[0];
|
| | | string phoneNum = strArry[1];
|
| | |
|
| | | string strPhone = "+" + areaCode2 + " " + phoneNum;
|
| | | if (phoneNum.Length >= 11)
|
| | | {
|
| | | phoneNum = phoneNum.Substring(0, 3) + "".PadLeft(phoneNum.Length - 7, '*') + phoneNum.Substring(phoneNum.Length - 4, 4);
|
| | | strPhone = "+" + areaCode2 + " " + phoneNum;
|
| | | }
|
| | | else if (phoneNum.Length >= 5)
|
| | | {
|
| | | //或许这是国外的手机吧
|
| | | phoneNum = phoneNum.Substring(0, 3) + "".PadLeft(phoneNum.Length - 5, '*') + phoneNum.Substring(phoneNum.Length - 2, 2);
|
| | | strPhone = "+" + areaCode2 + " " + phoneNum;
|
| | | }
|
| | |
|
| | | var rowContact = new RowLayoutControl();
|
| | | rowContact.frameTable.UseClickStatu = false;
|
| | | listview.AddChidren(rowContact);
|
| | | //联系方式
|
| | | rowContact.frameTable.AddLeftCaption("+" + data.PushNumber.Replace("-", " "), 800);
|
| | | rowContact.frameTable.AddLeftCaption(strPhone + " (" + data.PushNumberNote + ")", 800);
|
| | | rowContact.frameTable.AddBottomLine();
|
| | | //删除
|
| | | var btnDetete = rowContact.AddDeleteControl();
|