unit srvConfiguracion_Impl;

{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading  }
{ the RODL file associated with this project .                               }
{                                                                            }
{ This is where you are supposed to code the implementation of your objects. }
{----------------------------------------------------------------------------}

interface

uses
  {vcl:} Classes, SysUtils, 
  {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions,
  {Ancestor Implementation:} DARemoteService_Impl,
  {Used RODLs:} DataAbstract_Intf,
  {Generated:} FactuGES_Intf, uDAClasses, uDADataTable, uDABINAdapter;

type
  { TsrvConfiguracion }
  TsrvConfiguracion = class(TDARemoteService, IsrvConfiguracion)
    schConfiguracion: TDASchema;
    DABINAdapter: TDABINAdapter;
  private
  protected
    { IsrvConfiguracion methods }
    function darRutaProyectos: String;
    function darRutaNormativas: String;
    function darEstructuraDirProyectos: TDAStringArray;
    function darEstructuraDirNormativas: TDAStringArray;    
  end;

implementation

{$R *.dfm}
uses
  {Generated:} FactuGES_Invk, uDataModuleServer, uDAInterfaces;

procedure Create_srvConfiguracion(out anInstance : IUnknown);
begin
  anInstance := TsrvConfiguracion.Create(NIL);
end;

{ srvConfiguracion }
function TsrvConfiguracion.darRutaProyectos: String;
var
   ADataSet : IDADataset;
begin
  try
    Result:= '';
    ADataSet := schConfiguracion.NewDataset(Connection, 'darRutaProyectos');
    ADataSet.Open;
    if ADataSet.Dataset.RecordCount > 0 then
       Result := ADataSet.Dataset.Fields[0].AsString;
  finally
    ADataSet.Close;
  end;
end;

function TsrvConfiguracion.darRutaNormativas: String;
var
   ADataSet : IDADataset;
begin
  try
    Result:= '';
    ADataSet := schConfiguracion.NewDataset(Connection, 'darRutaNormativas');
    ADataSet.Open;
    if ADataSet.Dataset.RecordCount > 0 then
       Result := ADataSet.Dataset.Fields[0].AsString;
  finally
    ADataSet.Close;
  end;
end;

function TsrvConfiguracion.darEstructuraDirProyectos: TDAStringArray;
var
   ADataSet : IDADataset;
   AResultado : TDAStringArray;
begin
  try
    AResultado := TDAStringArray.Create;
    ADataSet := schConfiguracion.NewDataset(Connection, 'darEstructuraDirProyectos');
    ADataSet.Open;
    while not ADataSet.EOF do
    begin
      AResultado.Add(ADataSet.Dataset.Fields[0].AsString);
      ADataSet.Next;
    end;

    Result := AResultado;
  finally
    ADataSet.Close;
  end;
end;

function TsrvConfiguracion.darEstructuraDirNormativas: TDAStringArray;
var
   ADataSet : IDADataset;
   AResultado : TDAStringArray;
begin
  try
    AResultado := TDAStringArray.Create;
    ADataSet := schConfiguracion.NewDataset(Connection, 'darEstructuraDirNormativas');
    ADataSet.Open;
    while not ADataSet.EOF do
    begin
      AResultado.Add(ADataSet.Dataset.Fields[0].AsString);
      ADataSet.Next;
    end;

    Result := AResultado;
  finally
    ADataSet.Close;
  end;
end;

initialization
  TROClassFactory.Create('srvConfiguracion', Create_srvConfiguracion, TsrvConfiguracion_Invoker);

finalization

end.
