public static List<PhoneDto> LoadExistingSubscriberPhones(string subID ) { try { using (var client = new RosettianClient()) { return client.LoadSubscriberPhones(subID, CurrentUser.AsUserDto()) .OrderBy(p => p.PhoneProvSpec.EquipmentId) .ToList(); } } catch (FaultException<ValidationFault> vx) { throw new Exception(vx.Detail.Details[0].Message, vx); } catch (Exception ex) { throw new Exception(Errors.parseXMLError(ex.Message), ex); } }
/// <summary> /// RestorePhone - deletes and then recreates the subscriber phones /// </summary> /// <param name="subId"></param> /// <param name="expected"></param> public static void RestorePhone(string subId, List<PhoneDto> expected) { using (var client = new RosettianClient()) { var actual = client.LoadSubscriberPhones(subId, user); actual.ForEach(x => client.DeleteSubscriberPhone(subId, x.PhoneNumber, user)); if (expected != null) { expected.ForEach(x => client.CreateSubscriberPhone(subId, x, user)); } } }