?? updepsta.pas
字號:
unit updEPSTA;
interface
uses sysUtils, dbtables, Bde, updBase, ComObj, CONSTDEF;
type
TUpdateEPSTA = class(TBaseUpdateUnit)
private
FOtherVar: variant;
function update_byEPSI06(xQrySource: TQuery): Boolean;
function update_byEPSI07(xQrySource: TQuery): Boolean;
public
function update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
end;
implementation
function TUpdateEPSTA.update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
Result := True;
self.saveVar(xAction, xOtherVar, xUserData);
FOtherVar:= xOtherVar;
try
setDBName(xQrySource.databaseName);
if compareText(self.SourceTxnCode, 'TXNEPSI06') = 0 then
Result := update_byEPSI06(xQrySource)
else
if compareText(self.SourceTxnCode, 'TXNEPSI07') = 0 then
Result := update_byEPSI07(xQrySource)
else
begin
end;
finally
self.Query1.close;
self.Query1.UnPrepare;
end;
xMsg := self.Msg;
end;
function TUpdateEPSTA.update_byEPSI06(xQrySource: TQuery): Boolean;
var
mExist: Boolean;
mCOP_TC037,mCOP_TC038,mTA065,mTA066:String;
mTA029:Double;
begin
Result := True;
self.Msg[0] := 'skip';
self.Msg[1] := 'EPSTA';
with xQrySource do
begin
self.Msg[2] := FieldByName('TA001').asString+' '+FieldByName('TA002').asString;
end;
mCOP_TC037:=FOtherVar[1];
mCOP_TC038:=FOtherVar[2];
try
with self.Query1 do
begin
close;
SQL.clear;
RequestLive := False;
SQL.add('select SUM(TB013) as TB013 from $$EPSTB EPSTB ');
SQL.add(' where TB001=:TB001 and TB002=:TB002 ');
ParamByName('TB001').asString := xQrySource.FieldByName('TA001').asString;
ParamByName('TB002').asString := xQrySource.FieldByName('TA002').asString;
open;
first ;
mExist:= not eof ;
if mExist then //
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -