public int ObterLotesIntegrados()
        {
            int lote;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                lote = dbConnection.Query <int>(DashboardProcedures.ObterIntegrados.GetDescription(),
                                                commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault();
            }
            return(lote);
        }
        public override IEnumerable <LogLotes> ObterTodos()
        {
            IEnumerable <LogLotes> logs = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                logs = dbConnection.Query <LogLotes>(LogLotesProcedures.ObterTodos.GetDescription(),
                                                     commandType: System.Data.CommandType.StoredProcedure);
            }
            return(logs);
        }
Example #3
0
        public override IEnumerable <Permissao> ObterTodos()
        {
            IEnumerable <Permissao> permissoes = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                permissoes = dbConnection.Query <Permissao>(PermissaoProcedures.ObterTodos.GetDescription(),
                                                            commandType: System.Data.CommandType.StoredProcedure);
            }
            return(permissoes);
        }
Example #4
0
        public override IEnumerable <Categoria> ObterTodos()
        {
            IEnumerable <Categoria> categoria = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                categoria = dbConnection.Query <Categoria>(CategoriaProcedures.ObterTodos.GetDescription(),
                                                           commandType: System.Data.CommandType.StoredProcedure);
            }
            return(categoria);
        }
Example #5
0
        public IEnumerable <AcompanhamentoIntegracoes> ObterTodos()
        {
            IEnumerable <AcompanhamentoIntegracoes> acompanhamentoIntegracoes = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                acompanhamentoIntegracoes = dbConnection.Query <AcompanhamentoIntegracoes>(AcompanhamentoIntegracoesProcedures.ObterTodos.GetDescription(),
                                                                                           commandType: System.Data.CommandType.StoredProcedure);
            }
            return(acompanhamentoIntegracoes);
        }
Example #6
0
        public IEnumerable <Status> ObterPorDescricao(string descricao)
        {
            IEnumerable <Status> status = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                status = dbConnection.Query <Status>(StatusProcedures.ObterPorDescricao.GetDescription(),
                                                     new { descricao = descricao }, commandType: System.Data.CommandType.StoredProcedure);
            }
            return(status);
        }
Example #7
0
        public override IEnumerable <int_exp_Etiqueta_Producao> ObterTodos()
        {
            IEnumerable <int_exp_Etiqueta_Producao> lotes = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                lotes = dbConnection.Query <int_exp_Etiqueta_Producao>(LoteProcedures.ObterTodos.GetDescription(),
                                                                       commandType: System.Data.CommandType.StoredProcedure);
            }
            return(lotes);
        }
Example #8
0
        public int_exp_Etiqueta_Producao ObterPorDocumento(string numDocumento)
        {
            int_exp_Etiqueta_Producao lote = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                lote = dbConnection.Query <int_exp_Etiqueta_Producao>(LoteProcedures.ObterPorDocumento.GetDescription(),
                                                                      commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault();
            }
            return(lote);
        }
Example #9
0
        public override IEnumerable <Usuario> ObterTodos()
        {
            IEnumerable <Usuario> usuario = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                usuario = dbConnection.Query <Usuario>(UsuarioProcedures.ObterTodos.GetDescription(),
                                                       commandType: System.Data.CommandType.StoredProcedure);
            }
            return(usuario);
        }
        public IEnumerable <LogLotes> ObterPorUsuario(string usuario)
        {
            IEnumerable <LogLotes> logs = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                logs = dbConnection.Query <LogLotes>(LogLotesProcedures.ObterPorUsuario.GetDescription(),
                                                     new { @usuario = usuario },
                                                     commandType: System.Data.CommandType.StoredProcedure);
            }
            return(logs);
        }
Example #11
0
        public override int_exp_Etiqueta_Producao ObterPorId(int id)
        {
            int_exp_Etiqueta_Producao lotes = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                lotes = dbConnection.Query <int_exp_Etiqueta_Producao>(LoteProcedures.ObterPorId.GetDescription(),
                                                                       new { @Id = id },
                                                                       commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault();
            }
            return(lotes);
        }
Example #12
0
        public string ObterNumDocumento()
        {
            string numeroDocumento = "";

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                numeroDocumento = dbConnection.Query <string>(TransferenciaProcedures.ObterNumeroDocumento.GetDescription(),
                                                              commandType: System.Data.CommandType.StoredProcedure)
                                  .FirstOrDefault();
            }
            return(numeroDocumento);
        }
Example #13
0
        public IEnumerable <Lembrete> ObterTodos(int usuarioId)
        {
            IEnumerable <Lembrete> lembretes = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                lembretes = dbConnection.Query <Lembrete>(LembretesProcedures.ObterTodos.GetDescription(),
                                                          new { @usuarioId = usuarioId },
                                                          commandType: System.Data.CommandType.StoredProcedure);
            }
            return(lembretes);
        }
        public IEnumerable <Transferencia> ObterTransferencias(DateTime dataInicio, DateTime dataFim)
        {
            IEnumerable <Transferencia> transferencias = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                transferencias = dbConnection.Query <Transferencia>(RelatorioTransferenciaProcedures.
                                                                    ObterTransferencias.GetDescription(),
                                                                    new { @DataInicio = dataInicio, @DataFim = dataFim },
                                                                    commandType: System.Data.CommandType.StoredProcedure);
            }
            return(transferencias);
        }
Example #15
0
        public IEnumerable <Movimento> ObterPorPeriodo(DateTime dataInicioMovimento, DateTime dataFimMovimento)
        {
            IEnumerable <Movimento> documentoTransferencias = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                documentoTransferencias = dbConnection.Query <Movimento>(MovimentosGeradosProcedures
                                                                         .ObterMovimentosPorPeriodo.GetDescription(),
                                                                         new { @DataMovimentoInicio = dataInicioMovimento, @DataMovimentoFim = dataFimMovimento },
                                                                         commandType: System.Data.CommandType.StoredProcedure);
            }
            return(documentoTransferencias);
        }
        public IEnumerable <Etiqueta> ObterEtiquetasGeradas(DateTime dataInicio, DateTime dataFim)
        {
            IEnumerable <Etiqueta> etiquetas = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                etiquetas = dbConnection.Query <Etiqueta>(EtiquetasGeradasProcedures.
                                                          ObterEtiquetasGeradas.GetDescription(),
                                                          new { @dataInicio = dataInicio, @dataFim = dataFim },
                                                          commandType: System.Data.CommandType.StoredProcedure);
            }
            return(etiquetas);
        }
Example #17
0
        public IEnumerable <Permissao> ObterPorDescricao(string descricao)
        {
            IEnumerable <Permissao> permissoes = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                permissoes = dbConnection.Query <Permissao>(PermissaoProcedures.ObterPorDescricao.GetDescription(), new
                {
                    descricao = descricao
                }, commandType: System.Data.CommandType.StoredProcedure);
            }
            return(permissoes);
        }
Example #18
0
        public IEnumerable <DocumentoTransferencia> Visualizar(string numDocumento, string tipoDocumento)
        {
            IEnumerable <DocumentoTransferencia> documentoTransferencias = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                documentoTransferencias = dbConnection.Query <DocumentoTransferencia>(DocumentoTransferenciaProcedures.
                                                                                      ImpressaoDocumentoTransferencia.GetDescription(),
                                                                                      new { @numDocumento = numDocumento, @tipoDocumento = tipoDocumento },
                                                                                      commandType: System.Data.CommandType.StoredProcedure);
            }
            return(documentoTransferencias);
        }
Example #19
0
        public IEnumerable <Categoria> ObterPorDescricao(string descricao)
        {
            IEnumerable <Categoria> categoria = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                categoria = dbConnection.Query <Categoria>(CategoriaProcedures.ObterPorDescricao.GetDescription(), new
                {
                    descricao = descricao
                }, commandType: System.Data.CommandType.StoredProcedure);
            }
            return(categoria);
        }
Example #20
0
        public override Categoria ObterPorId(int id)
        {
            Categoria categoria = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                categoria = dbConnection.Query <Categoria>(CategoriaProcedures.ObterPorId.GetDescription(), new
                {
                    id = id
                }, commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault();
            }
            return(categoria);
        }
Example #21
0
        public override Status ObterPorId(int id)
        {
            Status status = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                status = dbConnection.Query <Status>(StatusProcedures.ObterPorId.GetDescription(), new
                {
                    id = id
                },
                                                     commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault();
            }
            return(status);
        }
Example #22
0
        public Permissao ObterPorSigla(string sigla)
        {
            Permissao permissao = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                permissao = dbConnection.Query <Permissao>(PermissaoProcedures.ObterPorSigla.GetDescription(), new
                {
                    sigla = sigla
                }, commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault();
            }

            return(permissao);
        }
        public IEnumerable <LogLotes> ObterPorPeriodo(DateTime dataInicio, DateTime dataFim)
        {
            IEnumerable <dynamic> query = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                query = dbConnection.Query <dynamic>(LogLotesProcedures.ObterPorPeriodo.GetDescription(), new
                {
                    dataInicio = dataInicio,
                    dataFim    = dataFim
                }, commandType: System.Data.CommandType.StoredProcedure);
            }

            AutoMapper.Configuration.AddIdentifier(typeof(LogLotes), "LogLoteId");

            IEnumerable <LogLotes> logLotes = (AutoMapper.MapDynamic <LogLotes>(query, false) as IEnumerable <LogLotes>);

            return(logLotes);
        }
Example #24
0
        public override IEnumerable <Transferencia> ObterTodos()
        {
            IEnumerable <dynamic> query = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                query = dbConnection.Query <dynamic>(TransferenciaProcedures.ObterTodos.GetDescription(),
                                                     commandType: System.Data.CommandType.StoredProcedure);
            }

            AutoMapper.Configuration.AddIdentifier(typeof(Transferencia), "TransferenciaId");
            AutoMapper.Configuration.AddIdentifier(typeof(int_exp_Etiqueta_Producao), "ApontamentoProducaoId");
            AutoMapper.Configuration.AddIdentifier(typeof(Usuario), "UsuarioId");
            AutoMapper.Configuration.AddIdentifier(typeof(Categoria), "CategoriaId");

            IEnumerable <Transferencia> transferencias = (AutoMapper.MapDynamic <Transferencia>(query, false) as IEnumerable <Transferencia>);

            return(transferencias);
        }
Example #25
0
        public override Permissao ObterPorId(int id)
        {
            IEnumerable <dynamic> query = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                query = dbConnection.Query <dynamic>(PermissaoProcedures.ObterPorId.GetDescription(), new
                {
                    id = id
                }, commandType: System.Data.CommandType.StoredProcedure);
            }

            AutoMapper.Configuration.AddIdentifier(typeof(Permissao), "PermissaoId");
            AutoMapper.Configuration.AddIdentifier(typeof(Usuario), "UsuarioId");

            Permissao permissao = (AutoMapper.MapDynamic <Permissao>(query, false) as IEnumerable <Permissao>).FirstOrDefault();

            return(permissao);
        }
Example #26
0
        public override Lembrete ObterPorId(int id)
        {
            IEnumerable <dynamic> query = null;

            using (DbConnection dbConnection = new SqlConnection(ConexaoBancoDeDados.ObterStringConexao()))
            {
                query = dbConnection.Query <dynamic>(LembretesProcedures.ObterPorId.GetDescription(), new
                {
                    @lembreteId = id
                }, commandType: System.Data.CommandType.StoredProcedure);
            }

            AutoMapper.Configuration.AddIdentifier(typeof(Transferencia), "NumeroDocumento");
            AutoMapper.Configuration.AddIdentifier(typeof(int_exp_Etiqueta_Producao), "ApontamentoProducaoId");

            Lembrete lembrete = (AutoMapper.MapDynamic <Lembrete>(query, false) as IEnumerable <Lembrete>).FirstOrDefault();

            return(lembrete);
        }