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

📄 updmocta.pas

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

interface

uses sysUtils, dbtables, bde, updBASE, ComObj, CONSTDEF, LibStrs;

type
  TUpdateMOCTA = class(TBaseUpdateUnit)
  private
    FOtherVar: variant;
    function update_byMOCI03(xQrySource: TQuery): Boolean;
    function update_byMOCI04(xQrySource: TQuery): Boolean;
    function update_byMOCI05(xQrySource: TQuery): Boolean;
    function update_byMOCI06(xQrySource: TQuery): Boolean;
    function update_byMOCI07(xQrySource: TQuery): Boolean;
    function update_byMOCI12(xQrySource: TQuery): Boolean;
    function update_bySFCI05(xQrySource: TQuery): Boolean;
  public
    function update(xQrySource: TQuery; xAction: string;
       var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
  end;

implementation

function TUpdateMOCTA.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, 'TXNMOCI03') = 0 then
      Result := update_byMOCI03(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNMOCI05') = 0 then
      Result := update_byMOCI05(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNMOCI04') = 0 then
      Result := update_byMOCI04(xQrySource)
    else
    if ((compareText(self.SourceTxnCode, 'TXNMOCI06') = 0) OR (compareText(self.SourceTxnCode, 'TXNMOCI11') = 0)) then
      Result := update_byMOCI06(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNMOCI07') = 0 then
      Result := update_byMOCI07(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNMOCI12') = 0 then
      Result := update_byMOCI12(xQrySource)
    else
    if compareText(self.SourceTxnCode, 'TXNSFCI05') = 0 then
      Result := update_bySFCI05(xQrySource)
    else
    begin
    end;
  finally
    self.Query1.close;
    self.Query2.close;
  end;
  xMsg := self.Msg;
end;

{function TUpdateMOCTA.update_byMOCI03(xQrySource: TQuery): Boolean;
var
  mExist:Boolean;
  mTA011,mTA012 : String ;
  mTA016,mSum:Double;
begin
  Result := True;
  self.Msg[0] := 'skip';
  self.Msg[1] := 'MOCTA';
  With xQrySource do
  self.Msg[2] := FieldByName('TC001').asString+' '+
                 FieldByName('TC002').asString;

//  if (((xQrySource.FieldByName('TE011').asString='') or (xQrySource.FieldByName('TE011').isnull)) or
//      ((xQrySource.FieldByName('TE012').asString='') or (xQrySource.FieldByName('TE012').isnull))) then Exit;

  if self.Action = 'A' then   //絋粄
    self.Sign := 1
  else
    self.Sign := -1;

  try
    with self.Query2 do
    begin
      close;
      SQL.clear;
      RequestLive := False;
      SQL.add('select * from $$MOCTD ');
      SQL.add(' where TD001=:TD001 AND TD002=:TD002 ');
      ParamByName('TD001').asString := xQrySource.FieldByName('TC001').asString;
      ParamByName('TD002').asString := xQrySource.FieldByName('TC002').asString;
      open;
      first ;
      while not eof do
      begin
        with self.Query1 do
        begin
          close;
          SQL.clear;
          RequestLive := False;
          SQL.add('select * from $$MOCTA  ');
          SQL.add(' where TA001=:TA001 and TA002=:TA002 ');
          ParamByName('TA001').asString := Query2.FieldByName('TD003').asString;
          ParamByName('TA002').asString := Query2.FieldByName('TD004').asString;
          open;
          first ;
          mExist:= not eof ;
          if mExist then //

⌨️ 快捷键说明

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