Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

  1. using System;
  2. using System.Data;
  3. using UDDI;
  4. namespace UDDI.Web
  5. {
  6. public class Owner
  7. {
  8. public static void Change( string entityType, string entityKey, string puid )
  9. {
  10. SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();
  11. switch( entityType )
  12. {
  13. case "business":
  14. sp.ProcedureName = "net_businessEntity_owner_update";
  15. sp.Parameters.Add( "@businessKey", SqlDbType.UniqueIdentifier );
  16. sp.Parameters.SetGuidFromString( "@businessKey", entityKey );
  17. break;
  18. case "tmodel":
  19. sp.ProcedureName = "net_tModel_owner_update";
  20. sp.Parameters.Add( "@tModelKey", SqlDbType.UniqueIdentifier );
  21. sp.Parameters.SetGuidFromKey( "@tModelKey", entityKey );
  22. break;
  23. default:
  24. {
  25. #if never
  26. throw new UDDIException(
  27. ErrorType.E_fatalError,
  28. "Unknown entity type '" + entityType + "'" );
  29. #endif
  30. throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_UKNOWN_ENTITY_TYPE", entityType );
  31. }
  32. }
  33. sp.Parameters.Add( "@PUID", SqlDbType.NVarChar, 450 );
  34. sp.Parameters.SetString( "@PUID", puid );
  35. sp.ExecuteNonQuery();
  36. }
  37. }
  38. }