public List <EntUsuario> ObterTodos(String Usuario, String Email, Int32 Status, DbTransaction transaction, Database db)
        {
            DbCommand dbCommand = db.GetStoredProcCommand("STP_UsuarioSelecionarTodos");

            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Usuario"), DbType.String, Usuario);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Email"), DbType.String, Email);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Status"), DbType.Boolean, IntUtils.ToBooleanNullProc(Status));
            dbCommand.CommandTimeout = BdConfig.CommmandTimeout;

            using (DbDataReader dtrDados = (System.Data.Common.DbDataReader)db.ExecuteReader(dbCommand, transaction))
            {
                if (dtrDados != null && dtrDados.HasRows)
                {
                    return(this.Popular(dtrDados));
                }
                else
                {
                    return(new List <EntUsuario>());
                }
            }
        }
        public List <EntOperacao> ObterTodos(String Operacao, Int32 Carteira, Int32 IsVenda, Int32 Status, DbTransaction transaction, Database db)
        {
            DbCommand dbCommand = db.GetStoredProcCommand("STP_OperacaoSelecionarTodos");

            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Operacao"), DbType.String, Operacao);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Carteira"), DbType.Int32, IntUtils.ToIntNullProc(Carteira));
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("IsVenda"), DbType.Int32, IntUtils.ToBooleanNullProc(IsVenda));
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Status"), DbType.Boolean, IntUtils.ToBooleanNullProc(Status));
            dbCommand.CommandTimeout = BdConfig.CommmandTimeout;

            using (DbDataReader dtrDados = (System.Data.Common.DbDataReader)db.ExecuteReader(dbCommand, transaction))
            {
                if (dtrDados != null && dtrDados.HasRows)
                {
                    return(this.Popular(dtrDados));
                }
                else
                {
                    return(new List <EntOperacao>());
                }
            }
        }
        public List <EntIndicador> ObterTodos(String Indicador, Int32 Moeda, DateTime DataInicio, DateTime DataFim, Int32 Status, DbTransaction transaction, Database db)
        {
            DbCommand dbCommand = db.GetStoredProcCommand("STP_IndicadorSelecionarTodos");

            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Indicador"), DbType.String, Indicador);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Moeda"), DbType.Int32, IntUtils.ToIntNullProc(Moeda));
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Status"), DbType.Boolean, IntUtils.ToBooleanNullProc(Status));
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("DataInicio"), DbType.DateTime, DataInicio);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("DataFim"), DbType.DateTime, DataFim);
            dbCommand.CommandTimeout = BdConfig.CommmandTimeout;

            using (DbDataReader dtrDados = (System.Data.Common.DbDataReader)db.ExecuteReader(dbCommand, transaction))
            {
                if (dtrDados != null && dtrDados.HasRows)
                {
                    return(this.Popular(dtrDados));
                }
                else
                {
                    return(new List <EntIndicador>());
                }
            }
        }
Example #4
0
        public List <EntEmail> ObterTodos(String Email, String Titulo, DateTime DataInicio, DateTime DataFim, Int32 IsEnvioSucesso, Int32 Status, DbTransaction transaction, Database db)
        {
            DbCommand dbCommand = db.GetStoredProcCommand("STP_EmailSelecionarTodos");

            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Email"), DbType.String, Email);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Titulo"), DbType.String, Titulo);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("DataInicio"), DbType.DateTime, DataInicio);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("DataFim"), DbType.DateTime, DataFim);
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("IsEnvioSucesso"), DbType.Int32, IntUtils.ToBooleanNullProc(IsEnvioSucesso));
            db.AddInParameter(dbCommand, StringUtils.TrataParametroProc("Status"), DbType.Boolean, IntUtils.ToBooleanNullProc(Status));
            dbCommand.CommandTimeout = BdConfig.CommmandTimeout;

            using (DbDataReader dtrDados = (System.Data.Common.DbDataReader)db.ExecuteReader(dbCommand, transaction))
            {
                if (dtrDados != null && dtrDados.HasRows)
                {
                    return(this.Popular(dtrDados));
                }
                else
                {
                    return(new List <EntEmail>());
                }
            }
        }