public void CarregarAlertas() { ProdutosDAL objDal = new ProdutosDAL(); try { DataTable tab = null; DataTable tabcp = null; DataTable tabcr = null; tabcr = LocalizarContasAReceber(); tabcp = LocalizarContasAPagar(); tab = objDal.localizarProdutoEstoque(); if (tabcr.Rows.Count > 0) { dgContasAReceber.Visible = true; dgContasAReceber.DataSource = tabcr; lblContasAReber.Visible = true; } else { dgContasAReceber.Visible = false; lblContasAReber.Visible = false; } if (tabcp.Rows.Count > 0) { dgContasAPgAlerta.Visible = true; dgContasAPgAlerta.DataSource = tabcp; lblcpAlerta.Visible = true; } else { dgContasAPgAlerta.Visible = false; lblcpAlerta.Visible = false; } if (tab.Rows.Count > 0) { txtAlerta.Visible = true; txtAlerta.Text = "Atenção existe produtos com estoque zerado ou estoque mínimo na sua capacidade"; } else { txtAlerta.Visible = false; } } catch (Exception) { throw; } }