Ejemplo n.º 1
0
        public IList <Fornecedor> GetAllByEmpresaCategoria(string startsWith, int empresaId, int categoriaId, int maxRows)
        {
            int grupoId = (from a in this.SessaoAtual.Query <Empresa>()
                           where a.Id == empresaId
                           select a.Grupo.Id).SingleOrDefault();

            return((from a in SessaoAtual.Query <Fornecedor>()
                    where a.Grupo.Id == grupoId && a.RazaoSocial.ToUpper().StartsWith(startsWith.ToUpper())
                    select a).ToList());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Abre uma transação se já não houver uma já existente
 /// </summary>
 /// <exception cref="Exception">Erro ao iniciar uma transação</exception>
 public void IniciarTransacao()
 {
     try
     {
         if (!TemTransacaoAberta())
         {
             SessaoAtual.BeginTransaction();
         }
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Ejemplo n.º 3
0
        public IList <entities.DTO.ContasDTO> GetContasByDashboard(int empresaId, int quantidadesDia)
        {
            DateTime dt = DateTime.Now.AddDays(quantidadesDia);

            return((from a in SessaoAtual.Query <Boleto>()
                    where a.Empresa.Id == empresaId && a.DataPagamento == null && a.DataVencimento < dt
                    select new ContasDTO()
            {
                Id = a.Id,
                EmpresaId = empresaId,
                Empresa = a.Empresa.NomeFantasia,
                Fornecedor = a.Fornecedor.RazaoSocial,
                FornecedorId = a.Fornecedor.Id,
                Numero = a.Numero,
                Valor = a.Valor,
                DataPagamento = a.DataPagamento,
                DataVencimento = a.DataVencimento
            }).ToList());
        }
Ejemplo n.º 4
0
 public IList <ContasDTO> GetContasByDashboard(int empresaId, DateTime inicio, DateTime termino)
 {
     return((from a in SessaoAtual.Query <Boleto>()
             where
             a.Empresa.Id == empresaId &&
             a.DataVencimento.Date >= inicio &&
             a.DataVencimento.Date <= termino
             select new ContasDTO()
     {
         Id = a.Id,
         EmpresaId = empresaId,
         Empresa = a.Empresa.NomeFantasia,
         Fornecedor = a.Fornecedor.RazaoSocial,
         FornecedorId = a.Fornecedor.Id,
         Numero = a.Numero,
         Valor = a.Valor,
         DataPagamento = a.DataPagamento,
         DataVencimento = a.DataVencimento,
         TemCompra = a.Compra != null,
         CompraId = a.Compra != null ? a.Compra.Id : 0
     }).ToList());
 }
Ejemplo n.º 5
0
 public IList <Fornecedor> GetAllByGrupo(int grupoId)
 {
     return((from a in SessaoAtual.Query <Fornecedor>()
             where a.Grupo.Id == grupoId
             select a).ToList());
 }