// 
// Created by the DataSnap proxy generator.
// 2012/04/09 17:46:15
// 

namespace ClientProxy1;

interface

uses Borland.Data;

type
  TMyServerMethodsClient = class
  private
    FDBXConnection: TAdoDbxConnection;
    FInstanceOwner: Boolean;
    FAS_DSServerModuleCreateCommand: TAdoDbxCommand;
    FAS_DSServerModuleDestroyCommand: TAdoDbxCommand;
    FEchoStringCommand: TAdoDbxCommand;
    FReverseStringCommand: TAdoDbxCommand;
    FServerTimeCommand: TAdoDbxCommand;
    FAdd33Command: TAdoDbxCommand;
    FGetEmployeesCommand: TAdoDbxCommand;
    FAS_GetProviderNamesCommand: TAdoDbxCommand;
    FAS_ExecuteCommand: TAdoDbxCommand;
  protected
    procedure Dispose(ADisposing: Boolean); virtual;
  public
    constructor (ADBXConnection: TAdoDbxConnection);
    constructor (ADBXConnection: TAdoDbxConnection; AInstanceOwner: Boolean);
    procedure Dispose; virtual;
    procedure AS_DSServerModuleCreate(Sender: Object);
    procedure AS_DSServerModuleDestroy(Sender: Object);
    function EchoString(Value: string): string;
    function ReverseString(Value: string): string;
    function ServerTime: DateTime;
    function Add33(X1: Integer; X2: Integer; X3: Integer; X4: Integer; X5: Integer; X6: Integer; X7: Integer; X8: Integer; X9: Integer; X10: Integer; X11: Integer; X12: Integer; X13: Integer; X14: Integer; X15: Integer; X16: Integer; X17: Integer; X18: Integer; X19: Integer; X20: Integer; X21: Integer; X22: Integer; X23: Integer; X24: Integer; X25: Integer; X26: Integer; X27: Integer; X28: Integer; X29: Integer; X30: Integer; X31: Integer; X32: Integer; X33: Integer): Integer;
    function GetEmployees: System.Data.IDataReader;
    function AS_GetProviderNames: string;
    procedure AS_Execute(ProviderName: String; CommandText: String; var ParamReader: System.IO.Stream; var OwnerDataStream: System.IO.Stream);
  end;

implementation

procedure TMyServerMethodsClient.AS_DSServerModuleCreate(Sender: Object);
begin
  if FAS_DSServerModuleCreateCommand = nil then
  begin
    FAS_DSServerModuleCreateCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FAS_DSServerModuleCreateCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FAS_DSServerModuleCreateCommand.CommandText := 'TMyServerMethods.AS_DSServerModuleCreate';
    FAS_DSServerModuleCreateCommand.Prepare;
  end;
  FAS_DSServerModuleCreateCommand.Parameters[0].Value := Sender;
  FAS_DSServerModuleCreateCommand.ExecuteNonQuery;
end;

procedure TMyServerMethodsClient.AS_DSServerModuleDestroy(Sender: Object);
begin
  if FAS_DSServerModuleDestroyCommand = nil then
  begin
    FAS_DSServerModuleDestroyCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FAS_DSServerModuleDestroyCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FAS_DSServerModuleDestroyCommand.CommandText := 'TMyServerMethods.AS_DSServerModuleDestroy';
    FAS_DSServerModuleDestroyCommand.Prepare;
  end;
  FAS_DSServerModuleDestroyCommand.Parameters[0].Value := Sender;
  FAS_DSServerModuleDestroyCommand.ExecuteNonQuery;
end;

function TMyServerMethodsClient.EchoString(Value: string): string;
begin
  if FEchoStringCommand = nil then
  begin
    FEchoStringCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FEchoStringCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FEchoStringCommand.CommandText := 'TMyServerMethods.EchoString';
    FEchoStringCommand.Prepare;
  end;
  FEchoStringCommand.Parameters[0].Value := Value;
  FEchoStringCommand.ExecuteNonQuery;
  Result := FEchoStringCommand.Parameters[1].Value as string;
end;

function TMyServerMethodsClient.ReverseString(Value: string): string;
begin
  if FReverseStringCommand = nil then
  begin
    FReverseStringCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FReverseStringCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FReverseStringCommand.CommandText := 'TMyServerMethods.ReverseString';
    FReverseStringCommand.Prepare;
  end;
  FReverseStringCommand.Parameters[0].Value := Value;
  FReverseStringCommand.ExecuteNonQuery;
  Result := FReverseStringCommand.Parameters[1].Value as string;
end;

function TMyServerMethodsClient.ServerTime: DateTime;
begin
  if FServerTimeCommand = nil then
  begin
    FServerTimeCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FServerTimeCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FServerTimeCommand.CommandText := 'TMyServerMethods.ServerTime';
    FServerTimeCommand.Prepare;
  end;
  FServerTimeCommand.ExecuteNonQuery;
  Result := FServerTimeCommand.Parameters[0].Value as DateTime;
end;

function TMyServerMethodsClient.Add33(X1: Integer; X2: Integer; X3: Integer; X4: Integer; X5: Integer; X6: Integer; X7: Integer; X8: Integer; X9: Integer; X10: Integer; X11: Integer; X12: Integer; X13: Integer; X14: Integer; X15: Integer; X16: Integer; X17: Integer; X18: Integer; X19: Integer; X20: Integer; X21: Integer; X22: Integer; X23: Integer; X24: Integer; X25: Integer; X26: Integer; X27: Integer; X28: Integer; X29: Integer; X30: Integer; X31: Integer; X32: Integer; X33: Integer): Integer;
begin
  if FAdd33Command = nil then
  begin
    FAdd33Command := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FAdd33Command.CommandType := System.Data.CommandType.StoredProcedure;
    FAdd33Command.CommandText := 'TMyServerMethods.Add33';
    FAdd33Command.Prepare;
  end;
  FAdd33Command.Parameters[0].Value := X1;
  FAdd33Command.Parameters[1].Value := X2;
  FAdd33Command.Parameters[2].Value := X3;
  FAdd33Command.Parameters[3].Value := X4;
  FAdd33Command.Parameters[4].Value := X5;
  FAdd33Command.Parameters[5].Value := X6;
  FAdd33Command.Parameters[6].Value := X7;
  FAdd33Command.Parameters[7].Value := X8;
  FAdd33Command.Parameters[8].Value := X9;
  FAdd33Command.Parameters[9].Value := X10;
  FAdd33Command.Parameters[10].Value := X11;
  FAdd33Command.Parameters[11].Value := X12;
  FAdd33Command.Parameters[12].Value := X13;
  FAdd33Command.Parameters[13].Value := X14;
  FAdd33Command.Parameters[14].Value := X15;
  FAdd33Command.Parameters[15].Value := X16;
  FAdd33Command.Parameters[16].Value := X17;
  FAdd33Command.Parameters[17].Value := X18;
  FAdd33Command.Parameters[18].Value := X19;
  FAdd33Command.Parameters[19].Value := X20;
  FAdd33Command.Parameters[20].Value := X21;
  FAdd33Command.Parameters[21].Value := X22;
  FAdd33Command.Parameters[22].Value := X23;
  FAdd33Command.Parameters[23].Value := X24;
  FAdd33Command.Parameters[24].Value := X25;
  FAdd33Command.Parameters[25].Value := X26;
  FAdd33Command.Parameters[26].Value := X27;
  FAdd33Command.Parameters[27].Value := X28;
  FAdd33Command.Parameters[28].Value := X29;
  FAdd33Command.Parameters[29].Value := X30;
  FAdd33Command.Parameters[30].Value := X31;
  FAdd33Command.Parameters[31].Value := X32;
  FAdd33Command.Parameters[32].Value := X33;
  FAdd33Command.ExecuteNonQuery;
  Result := FAdd33Command.Parameters[33].Value as Integer;
end;

function TMyServerMethodsClient.GetEmployees: System.Data.IDataReader;
begin
  if FGetEmployeesCommand = nil then
  begin
    FGetEmployeesCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FGetEmployeesCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FGetEmployeesCommand.CommandText := 'TMyServerMethods.GetEmployees';
    FGetEmployeesCommand.Prepare;
  end;
  FGetEmployeesCommand.ExecuteNonQuery;
  Result := FGetEmployeesCommand.Parameters[0].Value as System.Data.IDataReader;
end;

function TMyServerMethodsClient.AS_GetProviderNames: string;
begin
  if FAS_GetProviderNamesCommand = nil then
  begin
    FAS_GetProviderNamesCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FAS_GetProviderNamesCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FAS_GetProviderNamesCommand.CommandText := 'TMyServerMethods.AS_GetProviderNames';
    FAS_GetProviderNamesCommand.Prepare;
  end;
  FAS_GetProviderNamesCommand.ExecuteNonQuery;
  Result := FAS_GetProviderNamesCommand.Parameters[0].Value as string;
end;

procedure TMyServerMethodsClient.AS_Execute(ProviderName: String; CommandText: String; var ParamReader: System.IO.Stream; var OwnerDataStream: System.IO.Stream);
begin
  if FAS_ExecuteCommand = nil then
  begin
    FAS_ExecuteCommand := FDBXConnection.CreateCommand as TAdoDbxCommand;
    FAS_ExecuteCommand.CommandType := System.Data.CommandType.StoredProcedure;
    FAS_ExecuteCommand.CommandText := 'TMyServerMethods.AS_Execute';
    FAS_ExecuteCommand.Prepare;
  end;
  FAS_ExecuteCommand.Parameters[0].Value := ProviderName;
  FAS_ExecuteCommand.Parameters[1].Value := CommandText;
  if ParamReader = nil then
    FAS_ExecuteCommand.Parameters[2].Value := DbNull.Value
  else
    FAS_ExecuteCommand.Parameters[2].Value := ParamReader;
  if OwnerDataStream = nil then
    FAS_ExecuteCommand.Parameters[3].Value := DbNull.Value
  else
    FAS_ExecuteCommand.Parameters[3].Value := OwnerDataStream;
  FAS_ExecuteCommand.ExecuteNonQuery;
  if FAS_ExecuteCommand.Parameters[2].Value = DBNull.Value then
    ParamReader := nil
  else
    ParamReader := FAS_ExecuteCommand.Parameters[2].Value as System.IO.Stream;
  if FAS_ExecuteCommand.Parameters[3].Value = DBNull.Value then
    OwnerDataStream := nil
  else
    OwnerDataStream := FAS_ExecuteCommand.Parameters[3].Value as System.IO.Stream;
end;


constructor TMyServerMethodsClient(ADBXConnection: TAdoDbxConnection);
begin
  if ADBXConnection = nil then
    raise new ArgumentException('Connection cannot be nil.  Make sure the connection has been opened.');
  FDBXConnection := ADBXConnection;
FInstanceOwner := True;
end;


constructor TMyServerMethodsClient(ADBXConnection: TAdoDbxConnection; AInstanceOwner: Boolean);
begin
  if ADBXConnection = nil then
    raise new ArgumentException('Connection cannot be nil.  Make sure the connection has been opened.');
  FDBXConnection := ADBXConnection;
FInstanceOwner := AInstanceOwner;
end;


procedure TMyServerMethodsClient.Dispose;
begin
  Dispose(true);
end;

procedure TMyServerMethodsClient.Dispose(ADisposing: Boolean);
begin
  if FAS_DSServerModuleCreateCommand <> nil then
    FAS_DSServerModuleCreateCommand.Dispose;
  if FAS_DSServerModuleDestroyCommand <> nil then
    FAS_DSServerModuleDestroyCommand.Dispose;
  if FEchoStringCommand <> nil then
    FEchoStringCommand.Dispose;
  if FReverseStringCommand <> nil then
    FReverseStringCommand.Dispose;
  if FServerTimeCommand <> nil then
    FServerTimeCommand.Dispose;
  if FAdd33Command <> nil then
    FAdd33Command.Dispose;
  if FGetEmployeesCommand <> nil then
    FGetEmployeesCommand.Dispose;
  if FAS_GetProviderNamesCommand <> nil then
    FAS_GetProviderNamesCommand.Dispose;
  if FAS_ExecuteCommand <> nil then
    FAS_ExecuteCommand.Dispose;
end;

end.
