示例#1
0
        //Alterado para SqlServer
        public static int getConvIdCartao(string codigo, string digito)
        {
            BD             BD      = new BD();
            int            conv_id = -1;
            SafeDataReader dr      = BD.GetDataReader("SELECT conv_id FROM cartoes WHERE (codigo = '" + codigo + "' and digito = '" + digito + "') or ( codcartimp = '" + codigo + digito + "')", null);

            try
            {
                if (dr.Read())
                {
                    conv_id = dr.GetInt32("conv_id");
                }
            }
            finally
            {
                dr.Close();
            }
            return(conv_id);
        }
示例#2
0
        public static bool ComandaValida(int comanda)
        {
            BD             BD      = new BD();
            bool           retorno = false;
            SafeDataReader dr      = BD.GetDataReader("SELECT COMANDA FROM CRED_COMANDA_STATUS WHERE COMANDA = " + comanda, null);

            try
            {
                if (dr.Read())
                {
                    retorno = dr.GetString(0) != null;
                }
            }
            finally
            {
                dr.Close();
            }
            return(retorno);
        }
示例#3
0
        public static bool GetObrigadoPassarSenhaConveniado(Credenciados cred)
        {
            BD             BD      = new BD();
            bool           retorno = false;
            SafeDataReader dr      = BD.GetDataReader("select coalesce(obrigar_senha,'N') as obrigar_senha FROM EMP_CRED_OBRIGA_SENHA where empres_id = " + cred.Empresa.Empres_id.ToString() + " estab_id = " + cred.Cred_id.ToString(), null);

            try
            {
                if (dr.Read())
                {
                    retorno = dr.GetString(0) == "S";
                }
            }
            finally
            {
                dr.Close();
            }
            return(retorno);
        }
示例#4
0
        //Alterado para SqlServer
        public static bool UtilizaRecarga(int cred_id)
        {
            BD             BD      = new BD();
            bool           retorno = false;
            SafeDataReader dr      = BD.GetDataReader("SELECT UTILIZA_RECARGA FROM CREDENCIADOS WHERE CRED_ID = " + cred_id, null);

            try
            {
                if (dr.Read())
                {
                    retorno = dr.GetString(0) == "S";
                }
            }
            finally
            {
                dr.Close();
            }
            return(retorno);
        }
示例#5
0
        public static bool StatusComanda(int cred_id, int comanda)
        {
            BD             BD      = new BD();
            bool           retorno = false;
            SafeDataReader dr      = BD.GetDataReader("SELECT STATUS FROM CRED_COMANDA_STATUS WHERE CRED_ID = " + cred_id + " AND COMANDA = " + comanda, null);

            try
            {
                if (dr.Read())
                {
                    retorno = dr.GetString(0) == "F";
                }
            }
            finally
            {
                dr.Close();
            }
            return(retorno);
        }
示例#6
0
        public static bool VerifSenha(Credenciados cred)
        {
            BD             BD      = new BD();
            bool           retorno = false;
            SafeDataReader dr      = BD.GetDataReader("Select SENHA from credenciados where APAGADO <> 'S' and CRED_ID = " + cred.Cred_id, null);

            try
            {
                if (dr.Read())
                {
                    cred.Senha = dr.GetString(0);
                    retorno    = true;
                }
            }
            finally
            {
                dr.Close();
            }
            return(retorno);
        }
示例#7
0
        public static bool RecargaConfirmada(long nsu)
        {
            BD             BD      = new BD();
            bool           retorno = false;
            SafeDataReader dr      = BD.GetDataReader("SELECT RECARGA_REALIZADA FROM RECARGA_CONFIRMADAS WHERE NSU_TAN = " + nsu, null);

            try
            {
                if (dr.Read())
                {
                    retorno = dr.GetString(0) == "S";
                }
            }
            finally
            {
                dr.Close();
            }

            return(retorno);
        }
示例#8
0
        public static Credenciados Get_Id_Senha_Nome(int codacesso)
        {
            BD             BD   = new BD();
            SafeDataReader dr   = BD.GetDataReader("SELECT cred_id, senha, nome  FROM Credenciados WHERE apagado <> 'S' AND codacesso =  " + codacesso, null);
            Credenciados   cred = new Credenciados();

            try
            {
                if (dr.Read())
                {
                    cred.Senha   = dr.GetString("senha");
                    cred.Cred_id = dr.GetInt32("cred_id");
                    cred.Nome    = dr.GetString("nome");
                }
            }
            finally
            {
                dr.Close();
            }

            return(cred);
        }
示例#9
0
        public static byte[] GetImagemPremio(int premio_id)
        {
            string sql = " SELECT imagem";

            sql += " FROM Fidel_Premios";
            sql += " WHERE premio_id=" + premio_id;

            BD             BD = new BD();
            SafeDataReader dr = BD.GetDataReader(sql, null);

            try
            {
                dr.Read();

                byte[] imagem = dr.GetBytes(0);
                return(imagem);
            }
            finally
            {
                dr.Close();
            }
        }
示例#10
0
        public static string GetEmpresIdsProibVendaNome()
        {
            string s = string.Empty;

            BD             BD = new BD();
            SafeDataReader dr = BD.GetDataReader("SELECT empres_id FROM Empresas WHERE apagado <> 'S' AND venda_nome <> 'S' ", null);

            try
            {
                while (dr.Read())
                {
                    s += "," + dr.GetString(0);
                }
            }
            finally
            {
                dr.Close();
            }
            if (s.Length > 0)
            {
                s = s.Remove(0, 1);
            }
            return(s);
        }