zoukankan      html  css  js  c++  java
  • delete CDU

    function DeletePDU(){
    global $person;
    $this->MakeSafe();

    // Do not attempt anything else if the lookup fails
    if(!$this->GetPDU()){return false;}

    // Check rights
    $cab=new Cabinet();
    $cab->CabinetID=$this->CabinetID;
    $cab->GetCabinet();

    //person 不具有写权限 ,无法删除设备
    if(!$person->canWrite($cab->AssignedTo)){return false;}

    // First, remove any connections to the PDU
    $tmpConn=new PowerConnection();
    $tmpConn->PDUID=$this->PDUID;
    $connList=$tmpConn->GetConnectionsByPDU();

    foreach($connList as $delConn){
    $delConn->RemoveConnection();
    }

    // Clear out any records from PDUStats, possible S.U.T. involving changing
    // a devicetype but leaving behind a phantom reading for a non-power device
    $sql="DELETE FROM fac_PDUStats WHERE PDUID=$this->PDUID;";
    $this->exec($sql);

    $sql="DELETE FROM fac_PowerDistribution WHERE PDUID=$this->PDUID;";
    if(!$this->exec($sql)){
    // Something went south and this didn't delete.
    return false;
    }else{
    (class_exists('LogActions'))?LogActions::LogThis($this):'';
    return true;
    }
    }
  • 相关阅读:
    OCP-1Z0-053-V12.02-367题
    OCP-1Z0-053-V12.02-16题
    OCP-1Z0-053-V12.02-21题
    OCP-1Z0-053-V12.02-368题
    OCP-1Z0-053-V12.02-356题
    VC++ 线程池(h)
    OCP-1Z0-053-V12.02-361题
    OCP-1Z0-053-V12.02-355题
    OCP-1Z0-053-V12.02-289题
    OCP-1Z0-053-V12.02-100题
  • 原文地址:https://www.cnblogs.com/hehexu/p/8643096.html
Copyright © 2011-2022 走看看