1
private int dia;
private int mes;
private int ano;
public bool GravaData(int d, int m, int a)
{
if ((d > 0 && d <= 31) && (m > 0 && m <= 12) && (ano > 0))
{
dia = d;
mes = m;
ano = a;
return true;
}
else
{
return false;
}
}
Your problem is here
(ano > 0)
when it would actually be(a > 0)
see working: https://dotnetfiddle.net/SrDIMw– NoobSaibot