public override bool Connect(int Terminal) { AssepontoRep.DBApp bd = new AssepontoRep.DBApp(); //string Cpf = bd.getFieldValueString(String.Format("SELECT TRM_AUTENTICACAO_CPF FROM Terminais WHERE TRM_IND = {0}", Terminal)); //string Senha = bd.getFieldValueString(String.Format("SELECT TRM_AUTENTICACAO_SENHA FROM Terminais WHERE TRM_IND = {0}", Terminal)); //string Host = bd.getFieldValueString(String.Format("SELECT TRM_IP FROM Terminais WHERE TRM_IND = {0}", Terminal)); string Cpf = TerminalDados.OperadorCpf; string Senha = TerminalDados.OperadorSenha; string Host = TerminalDados.IP; try { if (!String.IsNullOrEmpty(Cpf) && !String.IsNullOrEmpty(Senha) && !String.IsNullOrEmpty(Host)) { repProtocol.SetHost(Host); //RepProtocolTestSuite.RestServices rs = new RestServices(); repProtocol.SetAuth(Regex.Replace(Cpf, "[^0-9]", ""), Senha, RepProtocolTestSuite.Utils.HexStringToByteArray(TerminalDados.Pin)); } return(true); } catch { return(false); } }
void Authenticate(int Terminal) { AssepontoRep.DBApp bd = new AssepontoRep.DBApp(); string Cpf = bd.getFieldValueString(String.Format("SELECT TRM_AUTENTICACAO_CPF FROM Terminais WHERE TRM_IND = {0}", Terminal)); string Senha = bd.getFieldValueString(String.Format("SELECT TRM_AUTENTICACAO_SENHA FROM Terminais WHERE TRM_IND = {0}", Terminal)); string Host = bd.getFieldValueString(String.Format("SELECT TRM_IP FROM Terminais WHERE TRM_IND = {0}", Terminal)); if (Cpf != String.Empty && Senha != String.Empty && Host != String.Empty) { repProtocol.SetHost(Host); repProtocol.SetAuth(System.Text.RegularExpressions.Regex.Replace(Cpf, "[^0-9]", ""), Senha); } }