|

楼主 |
发表于 2008-3-5 11:19:43
|
显示全部楼层
创建公共数据集.公共数据集的代码如下:
unit GGZYJ;
interface
uses
Business.System, Business.Model,Business.data;
type
TGGZYJ = class(TBizLibrary)
Query1: TQuery;
private
{private declarations}
public
{public declarations}
procedure czrz(AContext:TContext;czmk,cznr:string);
end;
implementation
procedure TGGZYJ.czrz(AContext:TContext;czmk,cznr:string);
var
Query_czrz:TQuery;
lContextCurrent: TContextCurrent;
ygxm,dlzh,szbm:string;
begin
lContextCurrent := Business.Model.TContextCurrent.Create(AContext);
ygxm:=lContextCurrent.Operator.DisplayName;
dlzh:=lContextCurrent.Operator.ID;
szbm:=lContextCurrent.Dept.DisplayName;
Query_czrz:=TQuery.Create(SELF);
Query_czrz.Close;
Query_czrz.ConnectionString := 'DATABASEURL=Biz:\RLZYGLXT\RLZYGLXTSJK.Database';
Query_czrz.CommandText := 'insert CZRZ(YGBH,YGXM,DLZH,SZBM,CZMK,CZSJ,CZNR,XZ) values('''+dlzh+''','''+ygxm+''','''+dlzh+''','''+szbm+''','''+czmk+''','''+SysUtils.DateTimeToStr(SysUtils.Now)+''','''+cznr+''',0)';
Query_czrz.Execute;
end;
end. |
|