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

📄 updasttc.pas

📁 拥有全套神州数码马易飞ERP源码,现上传部分源码
💻 PAS
字号:
unit updASTTC;

interface

uses sysUtils, dbtables, db, bde, updBase, ComObj, CONSTDEF;

type
  TUpdateASTTC = class(TBaseUpdateUnit)
  private
    FOtherVar: variant;
    FValue: variant;
    function update_byASTI12(xQrySource: TQuery): Boolean;
    function update_byASTI02(xQrySource: TQuery): Boolean;
    function update_byACRI02(xQrySource: TQuery): Boolean;
    function update_byACPI02(xQrySource: TQuery): Boolean;
  public
    function update(xQrySource: TQuery; xAction: string;
       var xMsg,xValue: variant; xOtherVar: variant; xUserData: variant): Boolean;
  end;

implementation

function TUpdateASTTC.update(xQrySource: TQuery; xAction: string;
           var xMsg,xValue: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
  Result := True;
  self.saveVar(xAction, xOtherVar, xUserData);
  FOtherVar:= xOtherVar;
  FValue := varArrayCreate([0,2], VarOleStr);
  try
    setDBName(xQrySource.databaseName);
    if compareText(self.SourceTxnCode, 'TXNASTI12') = 0 then
      Result := update_byASTI12(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNASTI02') = 0 then
      Result := update_byASTI02(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNACRI02') = 0 then
      Result := update_byACRI02(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNACPI02') = 0 then
      Result := update_byACPI02(xQrySource)
    else
    begin
    end;
  finally
    //VarArrayUnlock(self.Msg);
    self.Query1.close;
    self.Query1.UnPrepare;
  end;
  xMsg := self.Msg;
  xValue:=FValue;
end;

function TUpdateASTTC.update_byASTI12(xQrySource: TQuery): Boolean;
var
  mExist: Boolean;
begin
  Result := True;
  self.Msg[0] := 'skip';
  self.Msg[1] := 'ASTTC';

  with xqrySource do
  begin
    self.Msg[2] := FieldByName('TF001').asString+' '+
                   FieldByName('TF002').asString+' '+
                   FieldByName('TF003').asString;
  end;

  try
    with self.Query1 do
    begin
      close;
      SQL.clear;
      RequestLive := False;
      SQL.add('select * from $$ASTTC');
      SQL.add(' where TC001=:TC001 and TC002=:TC002');
      SQL.add('   and TC004=:TC004 ');
      ParamByName('TC001').asString := xqrySource.FieldByName('TF001').asString;
      ParamByName('TC002').asString := xqrySource.FieldByName('TF002').asString;
      ParamByName('TC004').asString := xqrySource.FieldByName('TF003').asString;
      open;
      first;
      mExist := not eof;
      if ((not mExist) and (self.Action = 'A')) then  //ぃ

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -