예제 #1
0
 public function Editar(modelEmissor $emissor)
 {
     try {
         $sql = "UPDATE nfe_emissor set \n\t\t\t\tCNPJ =:CNPJ, xNome =:xNome, xFant =:xFant, xLgr =:xLgr, nro =:nro, xCpl =:xCpl, \n\t\t\t\txBairro =:xBairro, cMun =:cMun, xMun =:xMun, UF =:UF, CEP =:CEP, cPais =:cPais, \n\t\t\t\txPais =:xPais, fone =:fone, IE =:IE, IEST =:IEST, IM =:IM, CNAE =:CNAE, CRT =:CRT ";
         $p_sql = Conexao::getInstance()->prepare($sql);
         $p_sql->bindValue(":CNPJ", $emissor->getCNPJ());
         $p_sql->bindValue(":xNome", $emissor->getxNome());
         $p_sql->bindValue(":xFant", $emissor->getxFant());
         $p_sql->bindValue(":xLgr", $emissor->getxLgr());
         $p_sql->bindValue(":nro", $emissor->getnro());
         $p_sql->bindValue(":xCpl", $emissor->getxCpl());
         $p_sql->bindValue(":xBairro", $emissor->getxBairro());
         $p_sql->bindValue(":cMun", $emissor->getcMun());
         $p_sql->bindValue(":xMun", $emissor->getxMun());
         $p_sql->bindValue(":UF", $emissor->getUF());
         $p_sql->bindValue(":CEP", $emissor->getCEP());
         $p_sql->bindValue(":cPais", $emissor->getcPais());
         $p_sql->bindValue(":xPais", $emissor->getxPais());
         $p_sql->bindValue(":fone", $emissor->getfone());
         $p_sql->bindValue(":IE", $emissor->getIE());
         $p_sql->bindValue(":IEST", $emissor->getIEST());
         $p_sql->bindValue(":IM", $emissor->getIM());
         $p_sql->bindValue(":CNAE", $emissor->getCNAE());
         $p_sql->bindValue(":CRT", $emissor->getCRT());
         return $p_sql->execute();
     } catch (Exception $e) {
         print "Ocorreu um erro ao tentar executar esta ação tente novamente mais tarde.";
         CriaLog::Logger('Erro: Código: ' . $e->getCode() . ' Mensagem: ' . $e->getMessage());
     }
 }