Exemplo n.º 1
0
  }//main()

  ///<summary>FaxSend</summary>
  public static void FaxSend
  (
   ref UtilityFaxArgument  utilityFaxArgument,
   ref String              exceptionMessage
  )
  {

   int             faxDocStatus                    =  -1;

   object          faxServerClassDocument          =  null;
   
   FaxDoc          faxDoc                          =  null;
   FaxServerClass  faxServerClass                  =  null;
   
   if ( utilityFaxArgument.FaxDocument == null || utilityFaxArgument.FaxDocument == String.Empty )
   {
    return;
   }//if ( utilityFaxArgument.FaxDocument == null || utilityFaxArgument.FaxDocument == String.Empty )    	

   try 
   {
    faxServerClass = new FaxServerClass();
    
    faxServerClass.Connect( utilityFaxArgument.FaxServerName ); //specifies the machinename
    
    faxServerClassDocument = faxServerClass.CreateDocument
    (
     utilityFaxArgument.FaxDocument
    );
    
    faxDoc = ( FaxDoc) faxServerClassDocument;
    
    faxDoc.FaxNumber = utilityFaxArgument.FaxNumber;
    faxDocStatus = faxDoc.Send();

    UtilityDebug.Write
    (
     String.Format
     (
      "Fax Status: {0}",
      faxDocStatus
     )
    );

    faxServerClass.Disconnect();

   }//try
   catch ( Exception exception )
   {
    UtilityDebug.Write
    (
     String.Format
     (
      "Exception: {0}",
      exception.Message
     )
    );
   }//catch ( Exception exception )   	
    
  }//public static void FileImport()
Exemplo n.º 2
0
  }//public String FaxServerName

  /// <summary>ButtonSubmit_Click().</summary>
  public void ButtonSubmit_Click
  (
   Object sender, 
   EventArgs e
  )
  {

   String                exceptionMessage    =  null;
   UtilityFaxArgument    utilityFaxArgument  =  null;

   utilityFaxArgument = new UtilityFaxArgument
   (
    FaxDocument,
    FaxServerName,
    FaxNumber
   );
   
   UtilityFax.FaxSend
   (
    ref utilityFaxArgument,    
    ref exceptionMessage
   );

   if ( exceptionMessage != null )
   {
    Feedback = exceptionMessage;
   	return;
   }//if ( exceptionMessage != null )
   
  }//public void ButtonSubmit_Click()
Exemplo n.º 3
0
  /// <summary>The entry point for the application.</summary>
  /// <param name="argv">A list of arguments</param>
  public static void Main( String[] argv )
  {
   bool parseCommandLineArguments = false;        
   //Boolean                         booleanParseCommandLineArguments   =  false;
   String                          exceptionMessage                   =  null;
   
   UtilityFaxArgument  utilityFaxArgument    =  null;
   
   utilityFaxArgument = new UtilityFaxArgument();

   /*
   booleanParseCommandLineArguments =  UtilityParseCommandLineArgument.ParseCommandLineArguments
   ( 
    argv, 
    utilityFaxArgument
   );
   
   if ( booleanParseCommandLineArguments  == false )
   {
    // error encountered in arguments. Display usage message
    UtilityDebug.Write
    (
     UtilityParseCommandLineArgument.CommandLineArgumentsUsage( typeof ( UtilityFaxArgument ) )    
    );  
    return;
   }//if ( booleanParseCommandLineArguments  == false )
   */

   parseCommandLineArguments = Parser.ParseArgumentsWithUsage
   (
    argv, 
    utilityFaxArgument
   );
   if ( parseCommandLineArguments == false )
   {
    return;
   }

   FaxSend
   (
    ref utilityFaxArgument,
    ref exceptionMessage
   );
   
  }//main()