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.

55 lines
1.3 KiB

  1. using System;
  2. using System.Data;
  3. using System.Data.SqlClient;
  4. using UDDI;
  5. using UDDI.Replication;
  6. namespace UDDI.Web
  7. {
  8. /// <summary>
  9. /// Summary description for operatorcontrols.
  10. /// </summary>
  11. public class OperatorHelper
  12. {
  13. public static OperatorNodeCollection GetOperators( )
  14. {
  15. return GetOperators( false, -1 );
  16. }
  17. public static OperatorNodeCollection GetOperators( OperatorStatus status )
  18. {
  19. return GetOperators( true, (int)status );
  20. }
  21. protected static OperatorNodeCollection GetOperators( bool filter, int status )
  22. {
  23. OperatorNodeCollection operators = new OperatorNodeCollection();
  24. SqlStoredProcedureAccessor sp = null;
  25. SqlDataReaderAccessor data=null;
  26. try
  27. {
  28. sp = new SqlStoredProcedureAccessor( "UI_operatorsList_get" );
  29. if( filter && -1!=status )
  30. {
  31. sp.Parameters.Add( "@StatusID",SqlDbType.TinyInt );
  32. sp.Parameters.SetInt( "@StatusID", status );
  33. }
  34. data = sp.ExecuteReader();
  35. while( data.Read() )
  36. {
  37. operators.Add( data.GetString( "OperatorKey" ), (OperatorStatus)data.GetInt( "OperatorStatusID" ), data.GetString( "Name" ), data.GetString( "soapReplicationUrl" ) );
  38. }
  39. }
  40. finally
  41. {
  42. if( null!=data )
  43. data.Close();
  44. if( null!=sp )
  45. sp.Close();
  46. }
  47. return operators;
  48. }
  49. }
  50. }