-
-
Save jvanhoesen/a385ca54d3f87a4694728f6c509c9a27 to your computer and use it in GitHub Desktop.
Primary Data-Access-Class RowSelected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Enables Approve/Reject buttons when a document goes to 'Pending Approval' | |
| /// Disables header fields except for 'Hold' checkbox when doc is off hold | |
| /// </summary> | |
| protected virtual void _(Events.RowSelected<AATimeRequest> e) | |
| { | |
| if (e.Row is AATimeRequest row) | |
| { | |
| if (Setup.Current.TimeRequestApproval ?? false) //Approvals are set | |
| { | |
| Approve.SetEnabled(row.Status == AATimeRequestStatus.PendingApproval && row.IsApprover == true); | |
| Reject.SetEnabled(row.Status == AATimeRequestStatus.PendingApproval && row.IsApprover == true); | |
| } | |
| else //No approvals | |
| { | |
| Approve.SetEnabled(row.Status == AATimeRequestStatus.PendingApproval); | |
| Reject.SetEnabled(row.Status == AATimeRequestStatus.PendingApproval); | |
| } | |
| e.Cache.SetEnabled<AATimeRequest.employeeID>(row, row.Status == AATimeRequestStatus.OnHold); | |
| e.Cache.SetEnabled<AATimeRequest.date>(row, row.Status == AATimeRequestStatus.OnHold); | |
| e.Cache.SetEnabled<AATimeRequest.description>(row, row.Status == AATimeRequestStatus.OnHold); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment