09/07/2026 - DAL (ITENSLOTE)
This commit is contained in:
parent
fd6956d4db
commit
a2268913b2
@ -1,6 +1,7 @@
|
|||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -1012,9 +1013,565 @@ namespace DAL
|
|||||||
}//MelhorLote
|
}//MelhorLote
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
#region Indicadores - Indicators
|
||||||
|
public int QuantidadeLotes()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
"SELECT COUNT(*) FROM Itens_Lotes", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeLotes
|
||||||
|
public int QuantidadeProdutos()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT COUNT(DISTINCT COD_ITEM)
|
||||||
|
FROM Itens_Lotes", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeProdutos
|
||||||
|
public int QuantidadeLotesAtivos()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE ATIVO=1", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeLotesAtivos
|
||||||
|
public int QuantidadeLotesInativos()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE ATIVO=0", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeLotesInativos
|
||||||
|
public int QuantidadeVencidos()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_VALIDADE < GETDATE()
|
||||||
|
AND ATIVO=1", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeVencidos
|
||||||
|
public int QuantidadeAVencer(int dias)
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_VALIDADE
|
||||||
|
BETWEEN GETDATE() AND DATEADD(DAY,@DIAS,GETDATE())
|
||||||
|
AND ATIVO=1", conexao);
|
||||||
|
|
||||||
|
cmd.Parameters.AddWithValue("@DIAS", dias);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeAVencer
|
||||||
|
public int QuantidadeSemValidade()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_VALIDADE IS NULL", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeSemValidade
|
||||||
|
public decimal QuantidadeTotalEstoque()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT ISNULL(SUM(QUANTIDADE),0)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE ATIVO=1", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDecimal(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeTotalEstoque
|
||||||
|
public decimal QuantidadeDisponivelEstoque()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT ISNULL(SUM(QUANTIDADE_DISPONIVEL),0)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE ATIVO=1", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDecimal(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeDisponivelEstoque
|
||||||
|
public decimal QuantidadeReservadaEstoque()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT ISNULL(SUM(QUANTIDADE_RESERVADA),0)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE ATIVO=1", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDecimal(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeReservadaEstoque
|
||||||
|
public decimal MaiorQuantidade()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT ISNULL(MAX(QUANTIDADE),0)
|
||||||
|
FROM Itens_Lotes", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDecimal(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//MaiorQuantidade
|
||||||
|
public decimal MenorQuantidade()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(
|
||||||
|
@"SELECT ISNULL(MIN(QUANTIDADE),0)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE QUANTIDADE>0", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDecimal(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//MenorQuantidade
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region Estatísticas - Statisticss
|
||||||
|
|
||||||
|
public string ProdutoComMaisLotes()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT TOP 1 COD_ITEM
|
||||||
|
FROM Itens_Lotes
|
||||||
|
GROUP BY COD_ITEM
|
||||||
|
ORDER BY COUNT(*) DESC", conexao);
|
||||||
|
|
||||||
|
object obj = cmd.ExecuteScalar();
|
||||||
|
|
||||||
|
//return obj == null ? "" : obj.ToString();
|
||||||
|
return Convert.ToString(obj) ?? string.Empty;
|
||||||
|
}
|
||||||
|
}//ProdutoComMaisLotes
|
||||||
|
public string ProdutoComMenosLotes()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT TOP 1 COD_ITEM
|
||||||
|
FROM Itens_Lotes
|
||||||
|
GROUP BY COD_ITEM
|
||||||
|
ORDER BY COUNT(*) ASC", conexao);
|
||||||
|
|
||||||
|
object obj = cmd.ExecuteScalar();
|
||||||
|
|
||||||
|
return Convert.ToString(obj) ?? string.Empty;
|
||||||
|
}
|
||||||
|
}//ProdutoComMenosLotes
|
||||||
|
public string FornecedorComMaisLotes()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT TOP 1 FORNECEDOR
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE FORNECEDOR<>''
|
||||||
|
GROUP BY FORNECEDOR
|
||||||
|
ORDER BY COUNT(*) DESC", conexao);
|
||||||
|
|
||||||
|
object obj = cmd.ExecuteScalar();
|
||||||
|
|
||||||
|
return Convert.ToString(obj) ?? string.Empty;
|
||||||
|
}
|
||||||
|
}//FornecedorComMaisLotes
|
||||||
|
public string FornecedorComMenosLotes()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT TOP 1 FORNECEDOR
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE FORNECEDOR<>''
|
||||||
|
GROUP BY FORNECEDOR
|
||||||
|
ORDER BY COUNT(*) ASC", conexao);
|
||||||
|
|
||||||
|
object obj = cmd.ExecuteScalar();
|
||||||
|
|
||||||
|
return Convert.ToString(obj) ?? string.Empty;
|
||||||
|
}
|
||||||
|
}//FornecedorComMenosLotes
|
||||||
|
public decimal MediaQuantidadeLote()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT ISNULL(AVG(QUANTIDADE),0)
|
||||||
|
FROM Itens_Lotes", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDecimal(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//MediaQuantidadeLote
|
||||||
|
public double MediaDiasValidade()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao ))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT ISNULL(AVG(DATEDIFF(DAY,GETDATE(),DATA_VALIDADE)),0)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_VALIDADE IS NOT NULL", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDouble(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//MediaDiasValidade
|
||||||
|
public int ProdutosSemLote()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM Itens
|
||||||
|
WHERE CODIGO NOT IN
|
||||||
|
(
|
||||||
|
SELECT DISTINCT COD_ITEM
|
||||||
|
FROM Itens_Lotes
|
||||||
|
)", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//ProdutosSemLote
|
||||||
|
public int LotesSemMovimento()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_ALTERACAO IS NULL", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//LotesSemMovimento
|
||||||
|
public int LotesComEstoqueZero()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE QUANTIDADE<=0", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//LotesComEstoqueZero
|
||||||
|
public int LotesComEstoquePositivo()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE QUANTIDADE>0", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//LotesComEstoquePositivo
|
||||||
|
public decimal QuantidadeMediaPorProduto()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT ISNULL(AVG(Total),0)
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT SUM(QUANTIDADE) Total
|
||||||
|
FROM Itens_Lotes
|
||||||
|
GROUP BY COD_ITEM
|
||||||
|
) X", conexao);
|
||||||
|
|
||||||
|
return Convert.ToDecimal(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeMediaPorProduto
|
||||||
|
public int QuantidadeProdutosComMaisDeUmLote()
|
||||||
|
{
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlCommand cmd = new SqlCommand(@"
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT COD_ITEM
|
||||||
|
FROM Itens_Lotes
|
||||||
|
GROUP BY COD_ITEM
|
||||||
|
HAVING COUNT(*)>1
|
||||||
|
) X", conexao);
|
||||||
|
|
||||||
|
return Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
}
|
||||||
|
}//QuantidadeProdutosComMaisDeUmLote
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region Relatórios - Reports
|
||||||
|
|
||||||
|
public DataTable ListarTodos()
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.ObjetoStringConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
ORDER BY COD_ITEM, DATA_VALIDADE", conexao);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}//ListarTodos
|
||||||
|
public DataTable ListarPorProduto(string codItem)
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE COD_ITEM=@COD_ITEM
|
||||||
|
ORDER BY DATA_VALIDADE", conexao);
|
||||||
|
|
||||||
|
da.SelectCommand.Parameters.AddWithValue("@COD_ITEM", codItem);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ListarPorFornecedor(string fornecedor)
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.StringDeConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE FORNECEDOR=@FORNECEDOR
|
||||||
|
ORDER BY COD_ITEM", conexao);
|
||||||
|
|
||||||
|
da.SelectCommand.Parameters.AddWithValue("@FORNECEDOR", fornecedor);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ListarVencidos()
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.StringDeConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_VALIDADE<GETDATE()
|
||||||
|
AND ATIVO=1
|
||||||
|
ORDER BY DATA_VALIDADE", conexao);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ListarAVencer(int dias)
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.StringDeConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_VALIDADE BETWEEN GETDATE() AND DATEADD(DAY,@DIAS,GETDATE())
|
||||||
|
AND ATIVO=1
|
||||||
|
ORDER BY DATA_VALIDADE", conexao);
|
||||||
|
|
||||||
|
da.SelectCommand.Parameters.AddWithValue("@DIAS", dias);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ListarSemValidade()
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.StringDeConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE DATA_VALIDADE IS NULL", conexao);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ListarEstoqueZero()
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.StringDeConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE QUANTIDADE<=0
|
||||||
|
ORDER BY COD_ITEM", conexao);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ListarAtivos()
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.StringDeConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE ATIVO=1
|
||||||
|
ORDER BY COD_ITEM", conexao);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ListarInativos()
|
||||||
|
{
|
||||||
|
DataTable tabela = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conexao = new SqlConnection(DadosDaConexao.StringDeConexao))
|
||||||
|
{
|
||||||
|
conexao.Open();
|
||||||
|
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(@"
|
||||||
|
SELECT *
|
||||||
|
FROM Itens_Lotes
|
||||||
|
WHERE ATIVO=0
|
||||||
|
ORDER BY COD_ITEM", conexao);
|
||||||
|
|
||||||
|
da.Fill(tabela);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tabela;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1023,8 +1580,8 @@ namespace DAL
|
|||||||
//Parte 8.3 -> Concluida
|
//Parte 8.3 -> Concluida
|
||||||
//Parte 8.4 -> Concluida
|
//Parte 8.4 -> Concluida
|
||||||
//Parte 8.5 -> Concluida
|
//Parte 8.5 -> Concluida
|
||||||
//Parte 8.6
|
//Parte 8.6 -> Concluida
|
||||||
//Parte 8.7
|
//Parte 8.7 -> Concluida
|
||||||
//Parte 8.8
|
//Parte 8.8
|
||||||
//Parte 8.9
|
//Parte 8.9
|
||||||
//Parte 8.10
|
//Parte 8.10
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user