
{*********************************************************************************************************************************************}
{                                                                                                                                             }
{                                                              XML Data Binding                                                               }
{                                                                                                                                             }
{         Generated on: 08/11/2013 10:57:59 a.m.                                                                                              }
{       Generated from: C:\Users\Desarrollo-2\Documents\Programas Edith\Codigos trabajando\FACTURADOR WEB\FacturadorWeb dll\FacturasCli.xml   }
{   Settings stored in: C:\Users\Desarrollo-2\Documents\Programas Edith\Codigos trabajando\FACTURADOR WEB\FacturadorWeb dll\FacturasCli.xdb   }
{                                                                                                                                             }
{*********************************************************************************************************************************************}

unit FacturasCli;

interface

uses xmldom, XMLDoc, XMLIntf;

type

{ Forward Decls }

  IXMLFacturasType = interface;
  IXMLFacturaType = interface;

{ IXMLFacturasType }

  IXMLFacturasType = interface(IXMLNodeCollection)
    ['{068145F8-8715-4E48-9126-CB3662EB2BD9}']
    { Property Accessors }
    function Get_Factura(Index: Integer): IXMLFacturaType;
    { Methods & Properties }
    function Add: IXMLFacturaType;
    function Insert(const Index: Integer): IXMLFacturaType;
    property Factura[Index: Integer]: IXMLFacturaType read Get_Factura; default;
  end;

{ IXMLFacturaType }

  IXMLFacturaType = interface(IXMLNode)
    ['{A08B98F8-10F2-4789-B0BD-6D66193545D0}']
    { Property Accessors }
    function Get_DoctoPvId: Integer;
    function Get_Cliente: WideString;
    function Get_Folio: WideString;
    function Get_Fecha: WideString;
    procedure Set_DoctoPvId(Value: Integer);
    procedure Set_Cliente(Value: WideString);
    procedure Set_Folio(Value: WideString);
    procedure Set_Fecha(Value: WideString);
    { Methods & Properties }
    property DoctoPvId: Integer read Get_DoctoPvId write Set_DoctoPvId;
    property Cliente: WideString read Get_Cliente write Set_Cliente;
    property Folio: WideString read Get_Folio write Set_Folio;
    property Fecha: WideString read Get_Fecha write Set_Fecha;
  end;

{ Forward Decls }

  TXMLFacturasType = class;
  TXMLFacturaType = class;

{ TXMLFacturasType }

  TXMLFacturasType = class(TXMLNodeCollection, IXMLFacturasType)
  protected
    { IXMLFacturasType }
    function Get_Factura(Index: Integer): IXMLFacturaType;
    function Add: IXMLFacturaType;
    function Insert(const Index: Integer): IXMLFacturaType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLFacturaType }

  TXMLFacturaType = class(TXMLNode, IXMLFacturaType)
  protected
    { IXMLFacturaType }
    function Get_DoctoPvId: Integer;
    function Get_Cliente: WideString;
    function Get_Folio: WideString;
    function Get_Fecha: WideString;
    procedure Set_DoctoPvId(Value: Integer);
    procedure Set_Cliente(Value: WideString);
    procedure Set_Folio(Value: WideString);
    procedure Set_Fecha(Value: WideString);
  end;

{ Global Functions }

function GetFacturas(Doc: IXMLDocument): IXMLFacturasType;
function LoadFacturas(const FileName: WideString): IXMLFacturasType;
function NewFacturas: IXMLFacturasType;

const
  TargetNamespace = '';

implementation

{ Global Functions }

function GetFacturas(Doc: IXMLDocument): IXMLFacturasType;
begin
  Result := Doc.GetDocBinding('Facturas', TXMLFacturasType, TargetNamespace) as IXMLFacturasType;
end;

function LoadFacturas(const FileName: WideString): IXMLFacturasType;
begin
  Result := LoadXMLDocument(FileName).GetDocBinding('Facturas', TXMLFacturasType, TargetNamespace) as IXMLFacturasType;
end;

function NewFacturas: IXMLFacturasType;
begin
  Result := NewXMLDocument.GetDocBinding('Facturas', TXMLFacturasType, TargetNamespace) as IXMLFacturasType;
end;

{ TXMLFacturasType }

procedure TXMLFacturasType.AfterConstruction;
begin
  RegisterChildNode('Factura', TXMLFacturaType);
  ItemTag := 'Factura';
  ItemInterface := IXMLFacturaType;
  inherited;
end;

function TXMLFacturasType.Get_Factura(Index: Integer): IXMLFacturaType;
begin
  Result := List[Index] as IXMLFacturaType;
end;

function TXMLFacturasType.Add: IXMLFacturaType;
begin
  Result := AddItem(-1) as IXMLFacturaType;
end;

function TXMLFacturasType.Insert(const Index: Integer): IXMLFacturaType;
begin
  Result := AddItem(Index) as IXMLFacturaType;
end;

{ TXMLFacturaType }

function TXMLFacturaType.Get_DoctoPvId: Integer;
begin
  Result := ChildNodes['DoctoPvId'].NodeValue;
end;

procedure TXMLFacturaType.Set_DoctoPvId(Value: Integer);
begin
  ChildNodes['DoctoPvId'].NodeValue := Value;
end;

function TXMLFacturaType.Get_Cliente: WideString;
begin
  Result := ChildNodes['Cliente'].Text;
end;

procedure TXMLFacturaType.Set_Cliente(Value: WideString);
begin
  ChildNodes['Cliente'].NodeValue := Value;
end;

function TXMLFacturaType.Get_Folio: WideString;
begin
  Result := ChildNodes['Folio'].Text;
end;

procedure TXMLFacturaType.Set_Folio(Value: WideString);
begin
  ChildNodes['Folio'].NodeValue := Value;
end;

function TXMLFacturaType.Get_Fecha: WideString;
begin
  Result := ChildNodes['Fecha'].Text;
end;

procedure TXMLFacturaType.Set_Fecha(Value: WideString);
begin
  ChildNodes['Fecha'].NodeValue := Value;
end;

end.