zoukankan      html  css  js  c++  java
  • 删除业务判断


     function CheckCanDelete(const EntityID: Integer):Boolean;
      
    var aSQLQuery:TSQLQuery;
      
    begin
        Result:
    =False;
        aSQLQuery:
    =TSQLQuery.Create(nil);
        
    with aSQLQuery do try
          Close;SQL.Clear;
          SQLConnection:
    =SQLConn;
          SQL.Add(
    'Select EntityID from OutWorkBillsItems');
          SQL.Add(
    'where SysID=:SysID and EntityID=:EntityID');
          ParamByName(
    'SysID').AsInteger:=GetSysID;
          ParamByName(
    'EntityID').AsInteger:=EntityID;
          Open;
          
    if Eof and Bof then begin
            Result:
    =True;
            Exit;
          
    end else begin
          
    if MessageDLG('提单明细已经存在,确定要同时删除吗?', mtConfirmation, [mbYes, mbNo], 0)<>mrYes then
             
    // Showmessage('存在明细项目,不允许删除 !')  //Result:=False;
              Exit;

            Close;SQL.Clear;
            SQL.Add(
    'Delete from OutWorkBillsItems');
            SQL.Add(
    'where SysID=:SysID and EntityID=:EntityID');
            ParamByName(
    'SysID').AsInteger:=GetSysID;
            ParamByName(
    'EntityID').AsInteger:=EntityID;
            ExecSQL(False);
            Result:
    =True;
          
    end;
        
    finally
          Free;
        
    end;
      
    end;

      
    procedure OnBeforeDeleteEntity(const ActID, EntityID: Integer; var CanDelete: Boolean);
      
    begin
        CanDelete:
    =CheckCanDelete(EntityID);
      
    end
  • 相关阅读:
    信息收集渠道:文本分享类网站Paste Site
    泛域名Wildcard Domain
    分享Kali Linux 2017年第12周镜像文件
    同源策略Same-origin policy
    Wireshark如何选择多行
    GPP加密破解工具gpp-decrypt
    HTTP基础认证Basic Authentication
    HAXM 6.0.5显示不兼容Windows
    分享Kali Linux 2017年第11周镜像文件
    bitShark对Android版本的支持
  • 原文地址:https://www.cnblogs.com/CNQCJ/p/1358485.html
Copyright © 2011-2022 走看看