Ver Mensaje Individual
  #9  
Antiguo 09-12-2015
Avatar de olbeup
olbeup olbeup is offline
Miembro
 
Registrado: jul 2005
Ubicación: Santiago de la Ribera (España)
Posts: 688
Reputación: 21
olbeup Va camino a la fama
Cita:
Empezado por newtron Ver Mensaje
Gracias olbeup, ya he resuelto el tema usando TXMLDocument pero igual tu solución es más elegante. ¿Cómo funciona el objeto ese que has preparado?.

Saludos
Hola newtron,

Mas elegante no creo que sea, te pongo un ejemplo de la etiqueta del <GrpHdr>:

Código Delphi [-]
const
  ISODateTime: string   = 'yyyy-mm-dd"T"hh:nn:ss';
  ISODate: string       = 'yyyy-mm-dd';
  ISOMsgId: string      = '"PRE"yyyymmddhhnnss"%sRMS-%s"';
  ISOUNIFI20022         = [32, 39..41, 65..90, 63, 97..122, 43..58];
  ISOCHANGE20022: char  = '.';

type

  /// 1.0 ///

  {+} {1.0 Cabecera – }
  TGrpHdr = class;
    {++} {1.8 - Parte iniciadora - }
    TInitgPty = class;
      {+++} {1.8 - Identificación de la Parte iniciadora - }
      TInitgPty_Id = class;
        {++++} {1.8 - Persona jurídica - }
        TInitgPty_Id_OrgId = class;
          {+++++} {1.8 - Otra}
          TInitgPty_Id_OrgId_Othr = class;

  {Raíz del mensaje – Message root }
  TCstmrDrctDbtInitn = class
  private
    FGrpHdr: TGrpHdr; {class --> Cabecera – }
    FPmtInf: TPmtInf; {class --> Información del pago }

    // --- * --- // Variables definidas por el usuario que no forman parte del ISO20022
    FIDRemittance: Integer;
    FIDBankSEPA: Integer;

    // --- * --- Variables que no forman parte del componente ISO20022 SEPA XML
    FConnectionString: string;
  protected
  public
    constructor Create(AConnectionString: string);
    destructor Destroy; override;
    function ExecuteConvertToXML: Boolean;
    procedure SaveToFileXML(const FileName: string);
  published
    property GrpHdr: TGrpHdr read FGrpHdr write FGrpHdr; {class --> Cabecera – }
    property PmtInf: TPmtInf read FPmtInf write FPmtInf; {class --> Información del pago }

    property ConnectionString: string read FConnectionString write FConnectionString;
    property IDBankSEPA: Integer read FIDBankSEPA write FIDBankSEPA;
    property IDRemittance: Integer read FIDRemittance write FIDRemittance;
  end;

  {+} {1.0 Cabecera – }
  TGrpHdr = class
  private
    FMsgId: string;         {35}    {1.1 Identificación del mensaje}
    FCreDtTm: TDateTime;    {19}    {1.2 Fecha y hora de creación 'yyyy-mm-ddThh:nn:ss'}
    FNbOfTxs: Integer;      {15}    {1.6 Número de operaciones}
    FCtrlSum: Double;       {18}{2} {1.7 Control de suma}
    FInitgPty: TInitgPty;           {1.8 Parte iniciadora}

    {15} {1.6 Número de operaciones}
    function GetNbOfTxs: Integer;
    {18}{2} {1.7 Control de suma}
    function GetCtrlSum: Double;

    // --- * --- // Variables para controlar el GrpHdrId
    function GetMsgId: string;

  protected
    FCstmrDrctDbtInitn: TCstmrDrctDbtInitn;
  public
    constructor Create(Owner: TCstmrDrctDbtInitn);
    destructor Destroy; override;
    function GetIXMLNode: IXMLNode;
  published
    property MsgId: string read GetMsgId;
    property CreDtTm: TDateTime read FCreDtTm;
    property NbOfTxs: Integer read GetNbOfTxs;
    property CtrlSum: Double read GetCtrlSum;
    property InitgPty: TInitgPty read FInitgPty write FInitgPty;
  end;

Esto es una parte del desarrollo.

Un saludo.
__________________
Al hacer una consulta SQL, haz que los demás te entiendan y disfruten de ella, será tú reflejo de tú saber.
Responder Con Cita