bool TDonaz_app::check_don(const long codsog, const TDate datadon)
{
	bool ok = TRUE;
	TRectype* key = new TRectype(LF_DONAZ);
	key->put(DON_CODICE, codsog);
	TRecord_array adon = TRecord_array(LF_DONAZ, DON_PROGDON);
	int err = adon.read(key);
	if (err == NOERR)
	{
		for (int r=1; r<=adon.rows(); r++)
		{
			const TRectype& riga = adon.row(r);
			const TDate dataact = riga.get(DON_DATADON);
			if (dataact == datadon)
				ok = FALSE;
		}
	}
	return ok;
}