📄 etycondition.pas
字号:
unit EtyCondition;
interface
uses
SysUtils, Entity;
const ENTITY_NAME : String = 'ETYCONDITION';
const FD_ENTITY_FIELD_NAME : String = 'EntityFieldName';
const FD_OPERATION : String = 'Operation';
const FD_VALUE : String = 'Value';
type
TEtyCondition = class(TInterfacedObject, IEntity)
private
EntityFieldName : String;
Operation : String;
Value : String;
m_bIsClearValue : boolean;
public
function GetEntityName() : String;
function GetAttributeValue(strAttributeName : String) : Variant;
procedure SetAttributeValue(strAttributeName : String; varAttributeValue : Variant);
function IsAttributeChanged(strAttributeName : String) : Boolean;
procedure SetChangedFlag(bFlag : Boolean);
procedure ClearValue();
function IsClearValue() : boolean;
end;
implementation
//-----------------------------------------------------------------------------
// GetEntityName
//-----------------------------------------------------------------------------
function TEtyCondition.GetEntityName() : String;
begin
Result := ENTITY_NAME;
end;
//-----------------------------------------------------------------------------
// SetAttributeValue
//-----------------------------------------------------------------------------
procedure TEtyCondition.SetAttributeValue(strAttributeName : String; varAttributeValue : Variant);
begin
strAttributeName := LowerCase(strAttributeName);
if (strAttributeName = LowerCase(FD_ENTITY_FIELD_NAME)) then
EntityFieldName := varAttributeValue
else if (strAttributeName = LowerCase(FD_OPERATION)) then
Operation := varAttributeValue
else if (strAttributeName = LowerCase(FD_VALUE)) then
Value := varAttributeValue;
end;
//-----------------------------------------------------------------------------
// GetAttributeValue
//-----------------------------------------------------------------------------
function TEtyCondition.GetAttributeValue(strAttributeName : String) : Variant;
var
varAttributeValue : Variant;
begin
strAttributeName := LowerCase(strAttributeName);
if (strAttributeName = LowerCase(FD_ENTITY_FIELD_NAME)) then
varAttributeValue := EntityFieldName
else if (strAttributeName = LowerCase(FD_OPERATION)) then
varAttributeValue := Operation
else if (strAttributeName = LowerCase(FD_VALUE)) then
varAttributeValue := Value
else
varAttributeValue := '';
GetAttributeValue := varAttributeValue;
end;
//-----------------------------------------------------------------------------
// IsAttributeChanged
//-----------------------------------------------------------------------------
function TEtyCondition.IsAttributeChanged(strAttributeName : String) : Boolean;
begin
Result := false;
end;
//-----------------------------------------------------------------------------
// SetChangedFlag
//-----------------------------------------------------------------------------
procedure TEtyCondition.SetChangedFlag(bFlag : Boolean);
begin
end;
//-----------------------------------------------------------------------------
// ClearValue
//-----------------------------------------------------------------------------
procedure TEtyCondition.ClearValue();
begin
end;
//-----------------------------------------------------------------------------
// IsClearValue
//-----------------------------------------------------------------------------
function TEtyCondition.IsClearValue() : boolean;
begin
result := m_bIsClearValue;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -