⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 updbommd.pas

📁 拥有全套神州数码马易飞ERP源码,现上传部分源码
💻 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 + -