updrmata.pas

来自「拥有全套神州数码马易飞ERP源码,现上传部分源码」· PAS 代码 · 共 75 行

PAS
75
字号
unit UpdRMATA;

interface

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

type
  TUpdateRMATA = class(TBaseUpdateUnit)
  private
    FOtherVar: variant;
    function update_byRMAI15(xQrySource: TQuery): Boolean;
    function update_byRMAI14(xQrySource: TQuery): Boolean;
    function update_byRMAI13(xQrySource: TQuery): Boolean;
  public
    function update(xQrySource: TQuery; xAction: string;
       var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
  end;

implementation

function TUpdateRMATA.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, 'TXNRMAI15') = 0 then
      Result := update_byRMAI15(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNRMAI14') = 0 then
      Result := update_byRMAI14(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNRMAI13') = 0 then
      Result := update_byRMAI13(xQrySource)
    else
    begin
    end;
  finally
    self.Query1.Close;
    self.Query1.UnPrepare;
  end;
  xMsg := self.Msg;
end;

function TUpdateRMATA.update_byRMAI15(xQrySource: TQuery): Boolean;
var
  mExist: Boolean;
  mTA031:String;
begin
  Result := True;
  self.Msg[0] := 'skip';
  self.Msg[1] := 'RMATA';

  with xqrySource do
  begin
    self.Msg[2] := Format('%s %s',
      [FieldByName('TI014').asString,FieldByName('TI015').asString]);
  end;

  try
    with self.Query1 do
    begin
      close;
      SQL.clear;
      RequestLive := False;
      SQL.add('select * from $$RMATA ');
      SQL.add('where TA001=:TA001 and TA002=:TA002');
      ParamByName('TA001').asString := xqrySource.FieldByName('TI014').asString;
      ParamByName('TA002').asString := xqrySource.FieldByName('TI015').asString;
      open;
      first;
      mExist := not eof;
      if mExist then //Τт

⌨️ 快捷键说明

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