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

📄 updpurmd.pas

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

interface

uses sysUtils, dbtables, Bde, updBase, LibStrs;

type
  TUpdatePURMD = class(TBaseUpdateUnit)
  private
    function update_byQMSI07(xQrySource: TQuery): Boolean;
    function update_byQMSI08(xQrySource: TQuery): Boolean;
    function update_byQMSI10(xQrySource: TQuery): Boolean;
  public
    function update(xQrySource: TQuery; xAction: string;
       var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
  end;

implementation

function TUpdatePURMD.update(xQrySource: TQuery; xAction: string;
           var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
  Result := True;
  self.saveVar(xAction, xOtherVar, xUserData);
  try
    setDBName(xQrySource.databaseName);
    if compareText(self.SourceTxnCode, 'TXNQMSI07') = 0 then
      Result := update_byQMSI07(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNQMSI08') = 0 then
      Result := update_byQMSI08(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNQMSI10') = 0 then
      Result := update_byQMSI10(xQrySource)
    else
    begin
    end;
  finally
    self.Query1.close;
    self.Query1.UnPrepare;
  end;
  xMsg := self.Msg;
end;

function TUpdatePURMD.update_byQMSI07(xQrySource: TQuery): Boolean;
var
  mNUM,mMD001,mTG005,mTH004,mMD002,mMD003,mMD004,mMA016:String;
  i,mReNum:integer;
begin
  Result := True;
  self.Msg[0] := 'skip';
  self.Msg[1] := 'PURMD';
  self.Msg[2] := xQrySource.FieldByName('TA001').asString+' '+
                 xQrySource.FieldByName('TA002').asString+' '+
                 xQrySource.FieldByName('TA003').asString;
  try
    with self.Query2 do
    begin
      close;
      SQL.clear;
      RequestLive := False;
      SQL.add('select * from $$QMSMA ');
      open;
    end;
    with self.Query1 do
    begin
      if (Query2.FieldByName('MA011').asString='Y') then
      begin
        close;
        SQL.clear;
        RequestLive := False;
        SQL.add('select TG005,TH004 from $$PURTG,$$PURTH  ');
        SQL.add(' where TH001=TG001 AND TH002=TG002 AND TH001=:TH001 AND TH002=:TH002 AND TH003=:TH003');
        ParamByName('TH001').asString := xQrySource.FieldByName('TA001').asString;
        ParamByName('TH002').asString := xQrySource.FieldByName('TA002').asString;
        ParamByName('TH003').asString := xQrySource.FieldByName('TA003').asString;
        open;
        First;
        mTG005:=FieldByName('TG005').asString;
        mTH004:=FieldByName('TH004').asString;

        close;
        SQL.clear;
        RequestLive := False;
        SQL.add('select PURMD.* from $$PURMD PURMD ');
        SQL.add(' where MD001=:MD001 AND MD002=:MD002 AND MD006=''****'' '); //890911 ADD MD006
        ParamByName('MD001').asString := mTG005;
        ParamByName('MD002').asString := mTH004;
        open;
        First;
        if not eof then
        begin
          self.OldFlag := FieldByName('FLAG').asInteger;
          self.NewFlag := self.OldFlag + 1;
          if self.NewFlag > C_MAXFLAG then self.NewFlag := 1;
          mMA016:='';
          mMD001:= FieldByName('MD001').asString; //紅坝

⌨️ 快捷键说明

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