I'm trying to do a connection between a local dataset and a remote dataset . When I run my program, the method below is called.
public void CheckCanDo()
{
if (LocalAcess.HasNonSyncedItems())
{
if (RemoteAcess.TryToSync())
{
LocalAcess.RefreshDateLastConnection();
CanDoThing = true;
}
else
{
if(LocalAcess.HasExpired)
{
CanDoThing = false;
return;
}
}
}
CanDoThing = true;
}
Is it appropriate to have a method executing actions and returning a boolean as a way to control the application's flow? Does it violate some good practice of C#? Is there a better way?