public IList <PreVendaCabecalhoDTO> SelectPreVendaCabecalho(PreVendaCabecalhoDTO preVendaCabecalho)
        {
            try
            {
                IList <PreVendaCabecalhoDTO> Resultado = null;
                using (ISession Session = NHibernateHelper.getSessionFactory().OpenSession())
                {
                    NHibernateDAL <PreVendaCabecalhoDTO> DAL = new NHibernateDAL <PreVendaCabecalhoDTO>(Session);
                    Resultado = DAL.Select(preVendaCabecalho);

                    foreach (PreVendaCabecalhoDTO objP in Resultado)
                    {
                        NHibernateDAL <PreVendaDetalheDTO> DALDetalhe = new NHibernateDAL <PreVendaDetalheDTO>(Session);
                        objP.ListaPreVendaDetalhe = DAL.Select <PreVendaDetalheDTO>(new PreVendaDetalheDTO {
                            IdPreVendaCabecalho = objP.Id
                        });

                        if (objP.ListaPreVendaDetalhe == null)
                        {
                            objP.ListaPreVendaDetalhe = new List <PreVendaDetalheDTO>();
                        }
                    }
                }
                return(Resultado);
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
            }
        }
        public EmpresaDTO SelectId(int id)
        {
            try
            {
                EmpresaDTO resultado = Session.Get <EmpresaDTO>(id);

                NHibernateDAL <EmpresaEnderecoDTO> DAL = new NHibernateDAL <EmpresaEnderecoDTO>(Session);
                resultado.ListaEndereco = DAL.Select <EmpresaEnderecoDTO>(new EmpresaEnderecoDTO {
                    IdEmpresa = resultado.Id
                });

                if (resultado.ListaEndereco == null)
                {
                    resultado.ListaEndereco = new List <EmpresaEnderecoDTO>();
                }
                else
                {
                    for (int i = 0; i <= resultado.ListaEndereco.Count - 1; i++)
                    {
                        if (resultado.ListaEndereco[i].Principal == "S")
                        {
                            resultado.EnderecoPrincipal = resultado.ListaEndereco[i];
                        }
                    }
                }

                return(resultado);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public static IList <R06DTO> ConsultaR06Lista(string pFiltro)
        {
            try
            {
                IList <R06DTO> Resultado = null;
                using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
                {
                    NHibernateDAL <R06DTO> DAL = new NHibernateDAL <R06DTO>(Session);

                    String ConsultaSql = "from R06DTO where " + pFiltro;
                    Resultado = DAL.SelectListaSql <R06DTO>(ConsultaSql);

                    // Consulta lista de detalhes
                    for (int i = 0; i <= Resultado.Count - 1; i++)
                    {
                        NHibernateDAL <R07DTO> DALDetalhe = new NHibernateDAL <R07DTO>(Session);
                        Resultado[i].ListaR07 = DALDetalhe.Select <R07DTO>(
                            new R07DTO {
                            IdR06 = Resultado[i].Id
                        });

                        if (Resultado[i].ListaR07 == null)
                        {
                            Resultado[i].ListaR07 = new List <R07DTO>();
                        }
                    }
                }
                return(Resultado);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
            }
        }
        public static NotaFiscalCabecalhoDTO ConsultaNotaFiscalCabecalho(string pFiltro)
        {
            try
            {
                NotaFiscalCabecalhoDTO Resultado = null;
                using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
                {
                    NHibernateDAL <NotaFiscalCabecalhoDTO> DAL = new NHibernateDAL <NotaFiscalCabecalhoDTO>(Session);

                    String ConsultaSql = "from NotaFiscalCabecalhoDTO where " + pFiltro;
                    Resultado = DAL.SelectObjetoSql <NotaFiscalCabecalhoDTO>(ConsultaSql);

                    // Consulta lista de detalhes
                    NHibernateDAL <NotaFiscalDetalheDTO> DALDetalhe = new NHibernateDAL <NotaFiscalDetalheDTO>(Session);
                    Resultado.ListaNotaFiscalDetalhe = DALDetalhe.Select <NotaFiscalDetalheDTO>(
                        new NotaFiscalDetalheDTO {
                        IdNotaFiscalCabecalho = Resultado.Id
                    });

                    if (Resultado.ListaNotaFiscalDetalhe == null)
                    {
                        Resultado.ListaNotaFiscalDetalhe = new List <NotaFiscalDetalheDTO>();
                    }
                }
                return(Resultado);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
            }
        }
        public PreVendaCabecalhoDTO SelectObjetoPreVendaCabecalho(string pFiltro)
        {
            try
            {
                PreVendaCabecalhoDTO Resultado = null;
                using (ISession Session = NHibernateHelper.getSessionFactory().OpenSession())
                {
                    NHibernateDAL <PreVendaCabecalhoDTO> DAL = new NHibernateDAL <PreVendaCabecalhoDTO>(Session);
                    Resultado = DAL.SelectObjetoSql <PreVendaCabecalhoDTO>(pFiltro);

                    if (Resultado != null)
                    {
                        NHibernateDAL <PreVendaDetalheDTO> DALDetalhe = new NHibernateDAL <PreVendaDetalheDTO>(Session);
                        Resultado.ListaPreVendaDetalhe = DAL.Select <PreVendaDetalheDTO>(new PreVendaDetalheDTO {
                            IdPreVendaCabecalho = Resultado.Id
                        });

                        if (Resultado.ListaPreVendaDetalhe == null)
                        {
                            Resultado.ListaPreVendaDetalhe = new List <PreVendaDetalheDTO>();
                        }
                    }
                }
                return(Resultado);
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
            }
        }
        public IList <DavCabecalhoDTO> SelectDavCabecalhoPagina(int primeiroResultado, int quantidadeResultados, DavCabecalhoDTO davCabecalho)
        {
            try
            {
                IList <DavCabecalhoDTO> Resultado = null;
                using (ISession Session = NHibernateHelper.getSessionFactory().OpenSession())
                {
                    NHibernateDAL <DavCabecalhoDTO> DAL = new NHibernateDAL <DavCabecalhoDTO>(Session);
                    Resultado = DAL.SelectPagina <DavCabecalhoDTO>(primeiroResultado, quantidadeResultados, davCabecalho);

                    foreach (DavCabecalhoDTO objP in Resultado)
                    {
                        NHibernateDAL <DavDetalheDTO> DALDetalhe = new NHibernateDAL <DavDetalheDTO>(Session);
                        objP.ListaDavDetalhe = DAL.Select <DavDetalheDTO>(new DavDetalheDTO {
                            IdDavCabecalho = objP.Id
                        });

                        if (objP.ListaDavDetalhe == null)
                        {
                            objP.ListaDavDetalhe = new List <DavDetalheDTO>();
                        }
                    }
                }
                return(Resultado);
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
            }
        }
Exemple #7
0
        public IEnumerable <AcbrMonitorPorta> ConsultarLista()
        {
            IList <AcbrMonitorPorta> Resultado = null;

            using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
            {
                NHibernateDAL <AcbrMonitorPorta> DAL = new NHibernateDAL <AcbrMonitorPorta>(Session);
                Resultado = DAL.Select(new AcbrMonitorPorta());
            }
            return(Resultado);
        }
Exemple #8
0
        public IEnumerable <PdvTipoPlano> ConsultarLista()
        {
            IList <PdvTipoPlano> Resultado = null;

            using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
            {
                NHibernateDAL <PdvTipoPlano> DAL = new NHibernateDAL <PdvTipoPlano>(Session);
                Resultado = DAL.Select(new PdvTipoPlano());
            }
            return(Resultado);
        }
Exemple #9
0
        public IEnumerable <FinLancamentoPagar> ConsultarLista()
        {
            IList <FinLancamentoPagar> Resultado = null;

            using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
            {
                NHibernateDAL <FinLancamentoPagar> DAL = new NHibernateDAL <FinLancamentoPagar>(Session);
                Resultado = DAL.Select(new FinLancamentoPagar());
            }
            return(Resultado);
        }
Exemple #10
0
 public static IList <ViewTotalPagamentoEcfMovimentoDTO> ConsultaViewTotalPagamentoMovimentoLista(ViewTotalPagamentoEcfMovimentoDTO pViewTotalPagamentoMovimento)
 {
     try
     {
         IList <ViewTotalPagamentoEcfMovimentoDTO> Resultado = null;
         using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
         {
             NHibernateDAL <ViewTotalPagamentoEcfMovimentoDTO> DAL = new NHibernateDAL <ViewTotalPagamentoEcfMovimentoDTO>(Session);
             Resultado = DAL.Select(pViewTotalPagamentoMovimento);
         }
         return(Resultado);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public IList <NfeCabecalhoDTO> SelectNfeCabecalho(NfeCabecalhoDTO nfeCabecalho)
 {
     try
     {
         IList <NfeCabecalhoDTO> resultado = null;
         using (ISession Session = NHibernateHelper.getSessionFactory().OpenSession())
         {
             NHibernateDAL <NfeCabecalhoDTO> DAL = new NHibernateDAL <NfeCabecalhoDTO>(Session);
             resultado = DAL.Select(nfeCabecalho);
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public IList <UnidadeProdutoDTO> SelectUnidadeProduto(UnidadeProdutoDTO unidadeProduto)
 {
     try
     {
         IList <UnidadeProdutoDTO> resultado = null;
         using (ISession Session = NHibernateHelper.getSessionFactory().OpenSession())
         {
             NHibernateDAL <UnidadeProdutoDTO> DAL = new NHibernateDAL <UnidadeProdutoDTO>(Session);
             resultado = DAL.Select(unidadeProduto);
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public static IList <NfeConfiguracaoDTO> ConsultaNfeConfiguracaoLista(NfeConfiguracaoDTO pNfeConfiguracao)
 {
     try
     {
         IList <NfeConfiguracaoDTO> Resultado = null;
         using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
         {
             NHibernateDAL <NfeConfiguracaoDTO> DAL = new NHibernateDAL <NfeConfiguracaoDTO>(Session);
             Resultado = DAL.Select(pNfeConfiguracao);
         }
         return(Resultado);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public static IList <EcfSangriaDTO> ConsultaEcfSangriaLista(EcfSangriaDTO pEcfSangria)
 {
     try
     {
         IList <EcfSangriaDTO> Resultado = null;
         using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
         {
             NHibernateDAL <EcfSangriaDTO> DAL = new NHibernateDAL <EcfSangriaDTO>(Session);
             Resultado = DAL.Select(pEcfSangria);
         }
         return(Resultado);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public IList <ViewControleAcessoDTO> SelectControleAcesso(ViewControleAcessoDTO viewControleAcesso)
 {
     try
     {
         IList <ViewControleAcessoDTO> Resultado = null;
         using (ISession session = NHibernateHelper.GetSessionFactory().OpenSession())
         {
             NHibernateDAL <ViewControleAcessoDTO> DAL = new NHibernateDAL <ViewControleAcessoDTO>(session);
             Resultado = DAL.Select(viewControleAcesso);
         }
         return(Resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public IList <VendedorDTO> SelectVendedor(VendedorDTO vendedor)
 {
     try
     {
         IList <VendedorDTO> Resultado = null;
         using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
         {
             NHibernateDAL <VendedorDTO> DAL = new NHibernateDAL <VendedorDTO>(Session);
             Resultado = DAL.Select(vendedor);
         }
         return(Resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public IList <TipoPagamentoDTO> SelectTipoPagamento(TipoPagamentoDTO tipoPagamento)
 {
     try
     {
         IList <TipoPagamentoDTO> Resultado = null;
         using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
         {
             NHibernateDAL <TipoPagamentoDTO> DAL = new NHibernateDAL <TipoPagamentoDTO>(Session);
             Resultado = DAL.Select(tipoPagamento);
         }
         return(Resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
        public static IList <NfeCabecalhoDTO> ConsultaNfceVendaCabecalhoLista(string pFiltro)
        {
            try
            {
                IList <NfeCabecalhoDTO> Resultado = null;
                using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
                {
                    NHibernateDAL <NfeCabecalhoDTO> DAL = new NHibernateDAL <NfeCabecalhoDTO>(Session);

                    String ConsultaSql = "from NfeCabecalhoDTO where " + pFiltro;
                    Resultado = DAL.SelectListaSql <NfeCabecalhoDTO>(ConsultaSql);

                    if (Resultado != null)
                    {
                        for (int i = 0; i <= Resultado.Count - 1; i++)
                        {
                            // Consulta lista de detalhes
                            NHibernateDAL <NfeDetalheDTO> DALDetalhe = new NHibernateDAL <NfeDetalheDTO>(Session);
                            Resultado[i].ListaNfeDetalhe = DALDetalhe.Select <NfeDetalheDTO>(
                                new NfeDetalheDTO {
                                IdNfeCabecalho = Resultado[i].Id
                            });

                            // Consulta lista de pagamentos
                            NHibernateDAL <NfeFormaPagamentoDTO> DALPagamento = new NHibernateDAL <NfeFormaPagamentoDTO>(Session);
                            Resultado[i].ListaNfeFormaPagamento = DALPagamento.Select <NfeFormaPagamentoDTO>(
                                new NfeFormaPagamentoDTO {
                                IdNfeCabecalho = Resultado[i].Id
                            });
                        }
                    }
                }
                return(Resultado);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
            }
        }
        public IList <EmpresaDTO> Select(EmpresaDTO objeto)
        {
            try
            {
                IList <EmpresaDTO> resultado = base.Select <EmpresaDTO>(objeto);

                foreach (EmpresaDTO objP in resultado)
                {
                    NHibernateDAL <EmpresaEnderecoDTO> DAL = new NHibernateDAL <EmpresaEnderecoDTO>(Session);
                    objP.ListaEndereco = DAL.Select <EmpresaEnderecoDTO>(new EmpresaEnderecoDTO {
                        IdEmpresa = objP.Id
                    });

                    if (objP.ListaEndereco == null)
                    {
                        objP.ListaEndereco = new List <EmpresaEnderecoDTO>();
                    }
                    else
                    {
                        for (int i = 0; i <= objP.ListaEndereco.Count - 1; i++)
                        {
                            if (objP.ListaEndereco[i].Principal == "S")
                            {
                                objP.EnderecoPrincipal = objP.ListaEndereco[i];
                            }
                        }
                    }
                }

                return(resultado);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static EcfVendaCabecalhoDTO ConsultaEcfVendaCabecalho(string pFiltro)
        {
            try
            {
                EcfVendaCabecalhoDTO Resultado = null;
                using (ISession Session = NHibernateHelper.GetSessionFactory().OpenSession())
                {
                    NHibernateDAL <EcfVendaCabecalhoDTO> DAL = new NHibernateDAL <EcfVendaCabecalhoDTO>(Session);

                    String ConsultaSql = "from EcfVendaCabecalhoDTO where " + pFiltro;
                    Resultado = DAL.SelectObjetoSql <EcfVendaCabecalhoDTO>(ConsultaSql);

                    if (Resultado != null)
                    {
                        // Consulta lista de detalhes
                        NHibernateDAL <EcfVendaDetalheDTO> DALDetalhe = new NHibernateDAL <EcfVendaDetalheDTO>(Session);
                        Resultado.ListaEcfVendaDetalhe = DALDetalhe.Select <EcfVendaDetalheDTO>(
                            new EcfVendaDetalheDTO {
                            IdEcfVendaCabecalho = Resultado.Id
                        });

                        // Consulta lista de pagamentos
                        NHibernateDAL <EcfTotalTipoPagamentoDTO> DALPagamento = new NHibernateDAL <EcfTotalTipoPagamentoDTO>(Session);
                        Resultado.ListaEcfTotalTipoPagamento = DALPagamento.Select <EcfTotalTipoPagamentoDTO>(
                            new EcfTotalTipoPagamentoDTO {
                            IdEcfVendaCabecalho = Resultado.Id
                        });
                    }
                }
                return(Resultado);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
            }
        }