Exemple #1
0
        public void conector_passwd(string VarAux1, string VarAux2, string VarAux3, string VarAux5, string VarAux6, string passwd, string newpasswd)
        {
            int    temp   = 0;
            string select = "";

            select  = "replace INTO `conector`.`licenca_adm`";
            select += "     ( ";
            select += "        `cnpj`, ";
            select += "        `aquisicao`, ";
            select += "        `periodoUso`, ";
            select += "        `password`, ";
            select += "        `statusPgto`, ";
            select += "        `idloja` ";
            select += "    ) ";
            select += "    VALUES ";
            select += "( ";
            select += "        ?VarAux1, ";
            select += "        ?VarAux2, ";
            select += "        ?VarAux3, ";
            select += "        AES_ENCRYPT(?Passwd,?newPasswd), ";
            select += "        ?VarAux5, ";
            select += "        ?VarAux6 ";
            select += ")";
            try
            {
                banco.abreConexao();
                banco.iniciarTransacao();
                banco.singleTransaction(select);
                banco.addParametro("?VarAux1", VarAux1);
                banco.addParametro("?VarAux2", VarAux2);
                banco.addParametro("?VarAux3", VarAux3);
                banco.addParametro("?passwd", passwd);
                banco.addParametro("?newpasswd", newpasswd);
                banco.addParametro("?VarAux5", VarAux5);
                banco.addParametro("?VarAux6", VarAux6);
                banco.procedimentoText();
                banco.commit();
            }
            catch (Exception erro)
            {
                banco.rollback();
                temp = 1;
            }
            finally
            {
                banco.fechaConexao();
                if (temp == 0)
                {
                }
            }
        }