Exemple #1
0
        //Alterado para SqlServer
        public static bool MovimentacoesAberto(string codigo)
        {
            try
            {
                BD     BD        = new BD();
                string cartao_id = BD.GetOneRow("select cartao_id from cartoes where codigo=" + codigo, null)["cartao_id"].ToString();

                int count = 0;
                using (SafeDataReader dr = BD.GetDataReader("SELECT count(*) FROM contacorrente WHERE COALESCE(baixa_conveniado,'N') = 'N' AND cartao_id = " + cartao_id, null))
                {
                    if ((dr.HasRows()) && (dr.Read()))
                    {
                        count = dr.GetInt32(0);
                    }
                    dr.Close();
                }
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }