
{*****************************************************************************************************************************************}
{                                                                                                                                         }
{                                                            XML Data Binding                                                             }
{                                                                                                                                         }
{         Generated on: 07/11/2013 09:47:37 a.m.                                                                                          }
{       Generated from: C:\Users\Desarrollo-2\Documents\Programas Edith\Codigos trabajando\FACTURADOR WEB\FacturadorWeb dll\Estados.xml   }
{   Settings stored in: C:\Users\Desarrollo-2\Documents\Programas Edith\Codigos trabajando\FACTURADOR WEB\FacturadorWeb dll\Estados.xdb   }
{                                                                                                                                         }
{*****************************************************************************************************************************************}

unit Estados;

interface

uses xmldom, XMLDoc, XMLIntf;

type

{ Forward Decls }

  IXMLEstadosType = interface;
  IXMLEstadoType = interface;

{ IXMLEstadosType }

  IXMLEstadosType = interface(IXMLNodeCollection)
    ['{75D7B151-C697-423E-BD80-6915320397B5}']
    { Property Accessors }
    function Get_Estado(Index: Integer): IXMLEstadoType;
    { Methods & Properties }
    function Add: IXMLEstadoType;
    function Insert(const Index: Integer): IXMLEstadoType;
    property Estado[Index: Integer]: IXMLEstadoType read Get_Estado; default;
  end;

{ IXMLEstadoType }

  IXMLEstadoType = interface(IXMLNode)
    ['{07548DC5-3CB8-4FF7-B307-5BD383F11EB8}']
    { Property Accessors }
    function Get_Row: Integer;
    function Get_Id: Integer;
    function Get_Nombre: WideString;
    function Get_Pais: WideString;
    procedure Set_Row(Value: Integer);
    procedure Set_Id(Value: Integer);
    procedure Set_Nombre(Value: WideString);
    procedure Set_Pais(Value: WideString);
    { Methods & Properties }
    property Row: Integer read Get_Row write Set_Row;
    property Id: Integer read Get_Id write Set_Id;
    property Nombre: WideString read Get_Nombre write Set_Nombre;
    property Pais: WideString read Get_Pais write Set_Pais;
  end;

{ Forward Decls }

  TXMLEstadosType = class;
  TXMLEstadoType = class;

{ TXMLEstadosType }

  TXMLEstadosType = class(TXMLNodeCollection, IXMLEstadosType)
  protected
    { IXMLEstadosType }
    function Get_Estado(Index: Integer): IXMLEstadoType;
    function Add: IXMLEstadoType;
    function Insert(const Index: Integer): IXMLEstadoType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLEstadoType }

  TXMLEstadoType = class(TXMLNode, IXMLEstadoType)
  protected
    { IXMLEstadoType }
    function Get_Row: Integer;
    function Get_Id: Integer;
    function Get_Nombre: WideString;
    function Get_Pais: WideString;
    procedure Set_Row(Value: Integer);
    procedure Set_Id(Value: Integer);
    procedure Set_Nombre(Value: WideString);
    procedure Set_Pais(Value: WideString);
  end;

{ Global Functions }

function GetEstados(Doc: IXMLDocument): IXMLEstadosType;
function LoadEstados(const FileName: WideString): IXMLEstadosType;
function NewEstados: IXMLEstadosType;

const
  TargetNamespace = '';

implementation

{ Global Functions }

function GetEstados(Doc: IXMLDocument): IXMLEstadosType;
begin
  Result := Doc.GetDocBinding('Estados', TXMLEstadosType, TargetNamespace) as IXMLEstadosType;
end;

function LoadEstados(const FileName: WideString): IXMLEstadosType;
begin
  Result := LoadXMLDocument(FileName).GetDocBinding('Estados', TXMLEstadosType, TargetNamespace) as IXMLEstadosType;
end;

function NewEstados: IXMLEstadosType;
begin
  Result := NewXMLDocument.GetDocBinding('Estados', TXMLEstadosType, TargetNamespace) as IXMLEstadosType;
end;

{ TXMLEstadosType }

procedure TXMLEstadosType.AfterConstruction;
begin
  RegisterChildNode('Estado', TXMLEstadoType);
  ItemTag := 'Estado';
  ItemInterface := IXMLEstadoType;
  inherited;
end;

function TXMLEstadosType.Get_Estado(Index: Integer): IXMLEstadoType;
begin
  Result := List[Index] as IXMLEstadoType;
end;

function TXMLEstadosType.Add: IXMLEstadoType;
begin
  Result := AddItem(-1) as IXMLEstadoType;
end;

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

{ TXMLEstadoType }

function TXMLEstadoType.Get_Row: Integer;
begin
  Result := ChildNodes['row'].NodeValue;
end;

procedure TXMLEstadoType.Set_Row(Value: Integer);
begin
  ChildNodes['row'].NodeValue := Value;
end;

function TXMLEstadoType.Get_Id: Integer;
begin
  Result := ChildNodes['id'].NodeValue;
end;

procedure TXMLEstadoType.Set_Id(Value: Integer);
begin
  ChildNodes['id'].NodeValue := Value;
end;

function TXMLEstadoType.Get_Nombre: WideString;
begin
  Result := ChildNodes['nombre'].Text;
end;

procedure TXMLEstadoType.Set_Nombre(Value: WideString);
begin
  ChildNodes['nombre'].NodeValue := Value;
end;

function TXMLEstadoType.Get_Pais: WideString;
begin
  Result := ChildNodes['Pais'].Text;
end;

procedure TXMLEstadoType.Set_Pais(Value: WideString);
begin
  ChildNodes['Pais'].NodeValue := Value;
end;

end.