⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s2.tools.ts2record.pas

📁 轉載的程序應用框架
💻 PAS
字号:
unit S2.Tools.TS2Record;

interface

uses
  Types, S2.Tools.TS2Dict, S2.Tools.IS2Record, S2.Tools.IS2IntegerField,
  S2.Tools.IS2StringField, S2.Tools.TS2Field, S2.Tools.TS2DateField, S2.Tools.TS2DoubleField,
  S2.Tools.TS2MoneyField, S2.Tools.TS2DictItem, S2.Tools.TS2IntegerField,
  S2.Tools.TS2StringField;

type
  TS2Record = class(TS2Dict, IS2Record)
  public  //  S2.Tools.IS2Record
    function GetFieldCount: Integer; virtual;
    function GetIntegerField(const FieldName: string): TS2IntegerField; virtual;
    function GetStringField(const FieldName: string): TS2StringField; virtual;
    function GetDateField(const FieldName: string): TS2DateField; virtual;
    function GetDoubleField(const FieldName: string): TS2DoubleField; virtual;
    function GetMoneyField(const FieldName: string): TS2MoneyField; virtual;
    function GetFieldName(const Index: Integer): string; virtual;
    function GetField(const FieldName: string): TS2Field; virtual;
    procedure AddField(Field: TS2Field); virtual;
  end;

implementation

uses
  Variants, S2.Tools.IS2DictItem;

{ TS2Record }

procedure TS2Record.AddField(Field: TS2Field);
begin
  Add(TS2DictItem(Field));
end;

function TS2Record.GetDateField(const FieldName: string): TS2DateField;
begin
  Result := TS2DateField(Find(FieldName))
end;

function TS2Record.GetDoubleField(const FieldName: string): TS2DoubleField;
begin
  Result := TS2DoubleField(Find(FieldName))
end;

function TS2Record.GetField(const FieldName: string): TS2Field;
begin
 Result := TS2Field(Find(FieldName))
end;

function TS2Record.GetFieldCount: Integer;
begin
  Result := GetCount;
end;

function TS2Record.GetFieldName(const Index: Integer): string;
begin
  Result := GetName(Index);
end;

function TS2Record.GetIntegerField(const FieldName: string): TS2IntegerField;
begin
  Result := TS2IntegerField(Find(FieldName))
end;

function TS2Record.GetMoneyField(const FieldName: string): TS2MoneyField;
begin
  Result := TS2MoneyField(Find(FieldName))
end;

function TS2Record.GetStringField(const FieldName: string): TS2StringField;
begin
  Result := TS2StringField(Find(FieldName))
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -