|

楼主 |
发表于 2007-11-8 10:09:12
|
显示全部楼层
最初由 atiger 发布
[B]你是怎么传环境进去的,把代码都帖出来看看 [/B]
//流程第1个功能流转之前
//**************************************************************
//*参数说明
//*AStrTitle为流程监控的主题,如:发文流程;请假流程等
//*AStrNumber为表的唯一表识,例如**编号之类的主键
//*此函数在非启动环节功能beforFlowOut()中使用
//**************************************************************
procedure TGZJD.OneBeforFlowUpData(AContext: TContext;AStrTitle,AStrNumber:string);
var
//数据库字段变量定义
strLcid,strXzhj,strClrid,strGwid,strClrbmid,strFuncurl,
strXygclrid,strXygrzt,strNextFunc,strKssj,strJgts:string;
//查询用
strSelet:string;
Query:TQuery;
//中间字段定义
name,det,intosql:string;
//有关环境定义
lContextCurrent: Business.Model.TContextCurrent;
upset:TSQLDataSet;
//常量定义
const strClzt='处理中';
begin
//环境上下文
lContextCurrent := Business.Model.TContextCurrent.Create(AContext);
upset:=TSQLDataSet.Create(self);
Query:=TQuery.Create(self);
upset.Database.URL:='Biz:\OABGZDHXT\BGZDHSJK.DATABASE';
//流程id取值
strLcid:=lContextCurrent.FlowControl.Flow.GUID;
//现在环节取值
name:=lContextCurrent.Operator.DisplayName;
det:=lContextCurrent.Dept.DisplayName;
strXzhj:=det+'('+name+')';
//处理人id,岗位id,部门id取值
strClrbmid:=lContextCurrent.Dept.ID;
strGwid:=lContextCurrent.PositionMember.ID;
strClrid:=lContextCurrent.Operator.ID;
//功能URL
strFuncurl:= lContextCurrent.GetDefaultFunc.BizClassURL.BizURL.URL;
//开始时间
strKssj:=DateToStr(now);
//经过天数
strJgts:='0';
//
strSelet:='select LCID from GZJKB where LCID='''+strLcid+'''';
Query.ConnectionString:='DATABASEURL=Biz:\OABGZDHXT\BGZDHSJK.DATABASE';
Query.CommandText:=strSelet;
//Query.Execute;
Query.Open;
intosql:='insert into GZJKB (LCID,JKZT,XZHJ,CLZT,GNURL,CLRID,CLRGWID,CLRBMID,KSSJ,JGTS,JKBH)VALUES('''+strLcid+''','''+AStrTitle+''','''+strXzhj+''','''+strClzt+''','''+strFuncurl+''','''+strClrid+''','''+strGwid+''','''+strClrbmid+''','''+strKssj+''','''+strJgts+''','''+AStrNumber+''')';
if Query.IsEmpty then
begin
with upset do
begin
close;
sql.Clear;
sql.Text:=intosql;
upset.Execute;
upset.Close;
end;
end;
end;
lForm.AfterFlowUpdata(self.Context,strNextpID,strNextFuncURL,strPassday); |
|