Guest User

Untitled

a guest
Oct 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. session.Logon("TVServer",
  2. "AdminUser",
  3. "AdminPass",
  4. 0,
  5. TVApplicationType.tvApplicationTypeAdministrator,
  6. 34202,
  7. TVServerConnectionLevel.tvServerConnectionLevelFull,
  8. false,
  9. TVStationUsage.tvStationUsageOwner);
  10.  
  11. bool station_found = false;
  12. Folder f = session.GetDefaultFolder(TVDefaultFolders.tvFolderUsers);
  13. TeleVantage.User u = f.Items.Item("John Galt", TVSearchType.tvSearchKey);
  14.  
  15. foreach (Address a in u.Addresses)
  16. {
  17. if (a.AddressType == TVAddressType.tvAddressTypeStation)
  18. {
  19. a.Value = new_station;
  20. u.Save();
  21. station_found = true;
  22. break;
  23. }
  24. }
  25.  
  26. if (!station_found)
  27. {
  28. Address a = u.Addresses.Add();
  29. a.AddressType = TVAddressType.tvAddressTypeStation;
  30. a.Category = TVAddressCategory.tvAddressCategoryNone;
  31. a.Description = "Default Station";
  32. a.Value = new_station;
  33. a.Default = true;
  34. u.Save();
  35. }
Add Comment
Please, Sign In to add comment