Skip to content

Instantly share code, notes, and snippets.

@BrianMRO
Last active September 30, 2021 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrianMRO/d1cc58b6deff39ff48d4c08b8f645b90 to your computer and use it in GitHub Desktop.
Save BrianMRO/d1cc58b6deff39ff48d4c08b8f645b90 to your computer and use it in GitHub Desktop.
Approval Views
#region Views
public SelectFrom<MyDAC>.View Document;
public SelectFrom<MySetupApproval>.View SetupApproval;
#endregion
#region SetupApproval View Delegate
// only return approval maps for the
// approval engine when RequestApproval is true
public IEnumerable setupApproval()
{
MyDAC myRecord = Document.Current;
if ((myRecord?.RequestApproval ?? false) != true)
{
yield return null;
}
else
{
foreach(MySetupApproval approval in
SelectFrom<MySetupApproval>.View.Select(this))
{
yield return approval;
}
}
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment