|
楼主 |
发表于 2007-8-9 14:49:10
|
显示全部楼层
新增工种劳保品对劳保品发放进行初始化}
procedure TLBPFFXX.InitFFAddNewWorkTypeLBP(LaoBaoPinGUID,WorkType:string);
var ZhigongDataSet:TSQLDataSet;
begin
{1:根据WorkType 在职工数据集中查询工种=WorkType的职工GUID
2:循环上一步的数据集每一行
2.1:对每个职工都在发放表中插入一条"计划"记录 顺便将 LaoBaoPinGUID
作为字段插入
3:end
}
ZhigongDataSet:=TSQLDataSet.Create(nil);
ZhigongDataSet.Database.URL:='Biz:\LBPFF\AQSJK.Database';
with ZhigongDataSet do
begin
SQL.Text:='SELECT * FROM YGXXB where GZ='+WorkType;
Open;
try
while not Eof do
begin
DataSetLBPFFSJJ.Append;
DataSetLBPFFSJJ.FieldByName('ZG').AsString:=FieldByName('GUID').AsString;
DataSetLBPFFSJJ.FieldByName('LBP').AsString:=LaoBaoPinGUID;
DataSetLBPFFSJJ.FieldByName('SCQFSL').AsInteger:= 0 ;
DataSetLBPFFSJJ.FieldByName('JHSL').AsInteger:= 0;
DataSetLBPFFSJJ.FieldByName('SFSL').AsInteger:=0 ;
DataSetLBPFFSJJ.FieldByName('BCQFSL').AsInteger:= 0 ;
DataSetLBPFFSJJ.FieldByName('ZDJHRQ').AsString:= SysUtils.FormatDateTime('YYYY-MM-DD',SysUtils.Now);
DataSetLBPFFSJJ.FieldByName('FFBJ').AsInteger:=1 ;
DataSetLBPFFSJJ.FieldByName('JHBJ').AsInteger:=0 ;
DataSetLBPFFSJJ.FieldByName('CSHBJ').AsInteger:=1 ;
DataSetLBPFFSJJ.FieldByName('SCFFRQ').AsString:= SysUtils.FormatDateTime('YYYY-MM-DD',SysUtils.Now);//GetLastFFData()计算上次发放日期
DataSetLBPFFSJJ.FieldByName('BCSJFFRQ').AsString:= SysUtils.FormatDateTime('YYYY-MM-DD',SysUtils.Now); //GetLastFFData()计算上次发放日期
DataSetLBPFFSJJ.FieldByName('EWFFBZ').AsInteger:= 0 ;
DataSetLBPFFSJJ.FieldByName('ZTBZ').AsInteger:= 0 ;
Next;
end;//while
DataSetLBPFFSJJ.ApplyUpdates;
finally
DataSetLBPFFSJJ.Free;
end;
end;
end; |
|