ulogictype.pas
来自「非长好的DELPHI办公系统 直接可以用」· PAS 代码 · 共 59 行
PAS
59 行
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 + =
减小字号Ctrl + -
显示快捷键?