?? updbommd.pas
字號:
unit updBOMMD;
interface
uses sysUtils, dbtables, db, bde, updBase,ConstDEF;
type
TUpdateBOMMD = class(TBaseUpdateUnit)
private
FOtherVar: variant;
function update_byBOMI04(xQrySource: TQuery): Boolean;
public
function update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
end;
implementation
uses LibStrs;
function TUpdateBOMMD.update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
Result := True;
self.saveVar(xAction, xOtherVar, xUserData);
FOtherVar:= xOtherVar;
try
self.setDBname(xQrySource.DatabaseName);
if compareText(self.SourceTxnCode, 'TXNBOMI04') = 0 then
Result := update_byBOMI04(xQrySource)
else
begin
end;
finally
//VarArrayUnlock(self.Msg);
self.Query1.Close;
self.Query1.UnPrepare;
end;
xMsg := self.Msg;
end;
function TUpdateBOMMD.update_byBOMI04(xQrySource: TQuery): Boolean;
var
mExist,mModiMD001: Boolean;
mType: integer;
mMD001,mMD002,mMD003,mMD004,mMD005,mTC105,mTC005:String;
mMD009,mMD010,mMD011,mMD012,mMD013,mMD014,mMD015,mMD017:String;
mMD006,mMD007,mMD008:Double;
begin
Result := True;
self.Msg[0] := 'skip';
self.Msg[1] := 'BOMMD';
with xqrySource do
begin
self.Msg[2] := Format('%s %s %s',
[FieldByName('TB001').asString,FieldByName('TB002').asString,
FieldByName('TB003').asString]);
end;
try
with self.Query2 do
begin
close;
SQL.clear;
RequestLive := False;
// SQL.add('select * from $$BOMTB,$$BOMTC ');
// SQL.add(' where TC001=TB001 and TC002=TB002 and TC003=TB003 ');
// SQL.add(' and TB001=:TB001 and TB002=:TB002 and TB003=:TB003 ');
case SQLTYPE of
dtMSSQL :begin
SQL.add('select * from $$BOMTB ');
SQL.add(' Left join $$BOMTC on TC001=TB001 and TC002=TB002 and TC003=TB003 ');
SQL.add(' where TB001=:TB001 and TB002=:TB002 and TB003=:TB003 ');
end;
dtORACLE:begin
SQL.add('select * from $$BOMTB,$$BOMTC ');
SQL.add(' where TB001=:TB001 and TB002=:TB002 and TB003=:TB003 AND TC001(+)=TB001 and TC002(+)=TB002 and TC003(+)=TB003 ');
end;
end;
ParamByName('TB001').asString := xqrySource.FieldByName('TB001').asString;
ParamByName('TB002').asString := xqrySource.FieldByName('TB002').asString;
ParamByName('TB003').asString := xqrySource.FieldByName('TB003').asString;
open;
first;
mModiMD001:=False;
if self.Query2.FieldByName('TB104').asString<>self.Query2.FieldByName('TB004').asString then
mModiMD001:=True; //
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -