1
public List<R> GetA(DateTime dataMov)
{
connection();
List<R> menuList = new List<R>();
try
{
con.Open();
using (SqlCommand cmd = new SqlCommand("SELECT r.nome,r.cos,r.estoque, r.bala as 'balance', movimento, movimento, (estoque + r.balance) as 'diver' FROM R_ATI r left join DR_DIA d on d.conta = r.cos where movimento = '" + dataMov.ToString("s") + "' and movimento = '" + dataMov.ToString("s") + "' and r.estoque <> 0.0", con))
{
var r = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (r.HasRows)
{
foreach (DbDataRecord s in r)
{
menuList.Add(new Renda
{
papel = Convert.ToString(s["nome"]),
cos = Convert.ToString(s["cos"]),
curva = Convert.ToDouble(s["estoque"]),
curvaA = Convert.ToDouble(s["balance"]),
divergencia = Convert.ToDouble(s["divergencia"])
});
}
}
}
}
catch (Exception ex)
{
con.Close();
throw ex;
}
finally
{ con.Close(); }
return menuList;
}
To mount this grid I use more than one database, it is in my model I would like to know how to put a warning to the user, warning that when this list does not appear on the screen, it indicates that someone is using the database. Thank you