📄 ulogictype.pas
字号:
unit uLogicType;
interface
uses
uDM,Classes,SysUtils,DB;
type
TLogicType = class(Tobject)
private
typeDM:TDM;
typeList:TStrings;
public
function GetTypeList:TStrings;
function GetBhByName(typeName:string):string;
constructor create;
destructor Destroy;override;
end;
implementation
constructor TLogicType.create;
begin
typeDM:=TDM.create(nil);
typeList:=TStringList.Create;
end;
destructor TLogicType.Destroy;
begin
freeandnil(typeDM);
freeandnil(typeList);
inherited;
end;
function TLogicType.GetTypeList:TStrings;
var
i: Integer;
tmpstrs: TStrings;
begin
tmpstrs:=TStringlist.Create;
with typeDM do
begin
adqTemp.sql.Clear;
adqTemp.sql.add('select * from typeTable');
adqTemp.Open;
for i:=1 to adqTemp.RecordCount do
begin
tmpstrs.Add(adqTemp.Fieldbyname('name').AsString);
adqTemp.Next;
end;
result:=tmpstrs;
end;
end;
function TLogicType.GetBhByName(typeName:string):string;
begin
typeDM.adqTemp.Locate('name',typeName,[loPartialKey]);
result:=typeDM.adqTemp.FieldByName('bh').AsString;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -